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 "vtkObject.h" 00051 00052 class vtkMultiProcessController; 00053 class vtkCommunicator; 00054 00055 class VTK_PARALLEL_EXPORT vtkProcessGroup : public vtkObject 00056 { 00057 public: 00058 vtkTypeMacro(vtkProcessGroup, vtkObject); 00059 static vtkProcessGroup *New(); 00060 virtual void PrintSelf(ostream &os, vtkIndent indent); 00061 00063 00066 void Initialize(vtkMultiProcessController *controller); 00067 void Initialize(vtkCommunicator *communicator); 00069 00071 00072 vtkGetObjectMacro(Communicator, vtkCommunicator); 00074 00080 void SetCommunicator(vtkCommunicator *communicator); 00081 00083 00085 vtkGetMacro(NumberOfProcessIds, int); 00087 00092 int GetProcessId(int pos) { return this->ProcessIds[pos]; } 00093 00096 int GetLocalProcessId(); 00097 00102 int FindProcessId(int processId); 00103 00106 int AddProcessId(int processId); 00107 00112 int RemoveProcessId(int processId); 00113 00116 void RemoveAllProcessIds(); 00117 00119 void Copy(vtkProcessGroup *group); 00120 00121 protected: 00122 vtkProcessGroup(); 00123 virtual ~vtkProcessGroup(); 00124 00125 int *ProcessIds; 00126 int NumberOfProcessIds; 00127 00128 vtkCommunicator *Communicator; 00129 00130 private: 00131 vtkProcessGroup(const vtkProcessGroup &); // Not implemented 00132 void operator=(const vtkProcessGroup &); // Not implemented 00133 }; 00134 00135 #endif //__vtkProcessGroup_h