VTK
|
00001 // -*- c++ -*- 00002 /*========================================================================= 00003 00004 Program: Visualization Toolkit 00005 Module: vtkProcessGroup.h 00006 00007 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00016 /*---------------------------------------------------------------------------- 00017 Copyright (c) Sandia Corporation 00018 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. 00019 ----------------------------------------------------------------------------*/ 00020 00047 #ifndef __vtkProcessGroup_h 00048 #define __vtkProcessGroup_h 00049 00050 #include "vtkParallelCoreModule.h" // For export macro 00051 #include "vtkObject.h" 00052 00053 class vtkMultiProcessController; 00054 class vtkCommunicator; 00055 00056 class VTKPARALLELCORE_EXPORT vtkProcessGroup : public vtkObject 00057 { 00058 public: 00059 vtkTypeMacro(vtkProcessGroup, vtkObject); 00060 static vtkProcessGroup *New(); 00061 virtual void PrintSelf(ostream &os, vtkIndent indent); 00062 00064 00067 void Initialize(vtkMultiProcessController *controller); 00068 void Initialize(vtkCommunicator *communicator); 00070 00072 00073 vtkGetObjectMacro(Communicator, vtkCommunicator); 00075 00081 void SetCommunicator(vtkCommunicator *communicator); 00082 00084 00086 vtkGetMacro(NumberOfProcessIds, int); 00088 00093 int GetProcessId(int pos) { return this->ProcessIds[pos]; } 00094 00097 int GetLocalProcessId(); 00098 00103 int FindProcessId(int processId); 00104 00107 int AddProcessId(int processId); 00108 00113 int RemoveProcessId(int processId); 00114 00117 void RemoveAllProcessIds(); 00118 00120 void Copy(vtkProcessGroup *group); 00121 00122 protected: 00123 vtkProcessGroup(); 00124 virtual ~vtkProcessGroup(); 00125 00126 int *ProcessIds; 00127 int NumberOfProcessIds; 00128 00129 vtkCommunicator *Communicator; 00130 00131 private: 00132 vtkProcessGroup(const vtkProcessGroup &); // Not implemented 00133 void operator=(const vtkProcessGroup &); // Not implemented 00134 }; 00135 00136 #endif //__vtkProcessGroup_h