ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkCommunicationErrorCatcher.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <string>
11 
12 #include "qPCL.h" // needed for export macro
13 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
14 
15 class vtkCommunicator;
16 class vtkMultiProcessController;
17 class vtkObject;
18 
20 public:
21  vtkCommunicationErrorCatcher(vtkMultiProcessController*);
22  vtkCommunicationErrorCatcher(vtkCommunicator*);
24 
28  bool GetErrorsRaised() const { return this->ErrorsRaised; }
29 
33  const std::string& GetErrorMessages() const { return this->ErrorMessages; }
34 
35 private:
37  void operator=(const vtkCommunicationErrorCatcher&) = delete;
38 
39  void Initialize();
40  void OnErrorEvent(vtkObject* caller, unsigned long eventid, void* calldata);
41 
42  vtkWeakPointer<vtkMultiProcessController> Controller;
43  vtkWeakPointer<vtkCommunicator> Communicator;
44 
45  bool ErrorsRaised;
46  std::string ErrorMessages;
47  unsigned long ControllerObserverId;
48  unsigned long CommunicatorObserverId;
49 };
50 
51 // VTK-HeaderTest-Exclude: vtkCommunicationErrorCatcher.h
const std::string & GetErrorMessages() const
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15