vtkCommunicationErrorCatcher.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkCommunicationErrorCatcher_h
20 #define vtkCommunicationErrorCatcher_h
21 
22 #include "vtkPVVTKExtensionsCoreModule.h" // needed for export macro
23 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
24 #include <string> // for std::string
25 
26 class vtkCommunicator;
28 class vtkObject;
29 
31 {
32 public:
36 
40  bool GetErrorsRaised() const { return this->ErrorsRaised; }
41 
45  const std::string& GetErrorMessages() const { return this->ErrorMessages; }
46 
47 private:
49  void operator=(const vtkCommunicationErrorCatcher&) = delete;
50 
51  void Initialize();
52  void OnErrorEvent(vtkObject* caller, unsigned long eventid, void* calldata);
53 
56 
57  bool ErrorsRaised;
58  std::string ErrorMessages;
59  unsigned long ControllerObserverId;
60  unsigned long CommunicatorObserverId;
61 };
62 
63 #endif
64 // VTK-HeaderTest-Exclude: vtkCommunicationErrorCatcher.h
helper class to catch errors from vtkMultiProcessController and vtkCommunicator.
#define VTKPVVTKEXTENSIONSCORE_EXPORT
const std::string & GetErrorMessages() const
Get the combined error messages.
bool GetErrorsRaised() const
Get the status of errors.