vtkCommunicationErrorCatcher.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkCommunicationErrorCatcher.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
31 #ifndef vtkCommunicationErrorCatcher_h
32 #define vtkCommunicationErrorCatcher_h
33 
34 #include "vtkPVVTKExtensionsCoreModule.h" // needed for export macro
35 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
36 #include <string>
37 
38 class vtkCommunicator;
40 class vtkObject;
41 
43 {
44 public:
48 
52  bool GetErrorsRaised() const { return this->ErrorsRaised; }
53 
57  const std::string& GetErrorMessages() const { return this->ErrorMessages; }
58 
59 private:
61  void operator=(const vtkCommunicationErrorCatcher&) = delete;
62 
63  void Initialize();
64  void OnErrorEvent(vtkObject* caller, unsigned long eventid, void* calldata);
65 
68 
69  bool ErrorsRaised;
70  std::string ErrorMessages;
71  unsigned long ControllerObserverId;
72  unsigned long CommunicatorObserverId;
73 };
74 
75 #endif
76 // 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.