vtkCompositeMultiProcessController.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkCompositeMultiProcessController_h
15 #define vtkCompositeMultiProcessController_h
16 
18 #include "vtkRemotingCoreModule.h" // needed for export macro
19 
21 {
22 public:
25  void PrintSelf(ostream& os, vtkIndent indent) override;
26 
27  // --------------------- Composite API -------------------------------
28 
35  int GetActiveControllerID();
36 
40  int GetNumberOfControllers();
41 
45  int GetControllerId(int idx);
46 
50  vtkMultiProcessController* GetController(int idx);
51 
58  void SetMasterController(int id);
59 
65  int GetMasterController();
66 
71  void RegisterController(vtkMultiProcessController* controller);
72 
76  void UnRegisterController(vtkMultiProcessController* controller);
77 
82  int UnRegisterActiveController();
83 
87  vtkMultiProcessController* GetActiveController();
88 
93  virtual void TriggerRMI2All(int remote, void* data, int length, int tag, bool sendToActiveToo);
94 
95  // --------------- vtkMultiProcessController API ----------------------
96  // Make sure inner vtkSocketController are initialized
97  virtual void Initialize();
98  void Initialize(int*, char***) override { this->Initialize(); };
99  void Initialize(int*, char***, int) override { this->Initialize(); };
100  void Finalize() override{}; // Empty: Same as vtkSocketController
101  void Finalize(int) override{}; // Empty: Same as vtkSocketController
102  void SingleMethodExecute() override{}; // Empty: Same as vtkSocketController
103  void MultipleMethodExecute() override{}; // Empty: Same as vtkSocketController
104  void CreateOutputWindow() override{}; // Empty: Same as vtkSocketController
105 
106  vtkCommunicator* GetCommunicator() override;
107 
108  // --------------- RMIs Overloaded API -------------------
109 
115  unsigned long AddRMICallback(vtkRMIFunctionType, void* localArg, int tag) override;
116 
118 
123  void RemoveAllRMICallbacks(int tag) override;
124  int RemoveFirstRMI(int tag) override
125  {
126  vtkWarningMacro("RemoveRMICallbacks will remove all...");
127  this->RemoveAllRMICallbacks(tag);
128  return 1;
129  }
130  bool RemoveRMICallback(unsigned long observerTagId) override;
132 
133  enum EventId
134  {
135  CompositeMultiProcessControllerChanged = 2345
136  };
137 
138 protected:
141 
142 private:
144  void operator=(const vtkCompositeMultiProcessController&) = delete;
145 
146  class vtkCompositeInternals;
147  vtkCompositeInternals* Internal;
148  friend class vtkCompositeInternals;
149 };
150 
151 #endif
virtual void RemoveAllRMICallbacks(int tag)
virtual bool RemoveRMICallback(unsigned long id)
void(* vtkRMIFunctionType)(void *localArg, void *remoteArg, int remoteArgLength, int remoteProcessId)
virtual void Initialize(int *vtkNotUsed(argc), char ***vtkNotUsed(argv))=0
#define VTKREMOTINGCORE_EXPORT
vtkCompositeMultiProcessController offer a composite implementation of vtkMultiProcessController that...
void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()
void Initialize(int *, char ***, int) override
void operator=(const vtkObjectBase &)
int RemoveFirstRMI(int tag) override
These methods are a part of the newer API to add multiple rmi callbacks.
virtual unsigned long AddRMICallback(vtkRMIFunctionType, void *localArg, int tag)
virtual vtkCommunicator * GetCommunicator()