VTK
vtkProcessGroup.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /*=========================================================================
3 
4  Program: Visualization Toolkit
5  Module: vtkProcessGroup.h
6 
7  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
8  All rights reserved.
9  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notice for more information.
14 
15 =========================================================================*/
16 /*----------------------------------------------------------------------------
17  Copyright (c) Sandia Corporation
18  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
19 ----------------------------------------------------------------------------*/
20 
47 #ifndef __vtkProcessGroup_h
48 #define __vtkProcessGroup_h
49 
50 #include "vtkObject.h"
51 
53 class vtkCommunicator;
54 
56 {
57 public:
58  vtkTypeMacro(vtkProcessGroup, vtkObject);
59  static vtkProcessGroup *New();
60  virtual void PrintSelf(ostream &os, vtkIndent indent);
61 
63 
66  void Initialize(vtkMultiProcessController *controller);
67  void Initialize(vtkCommunicator *communicator);
69 
71 
72  vtkGetObjectMacro(Communicator, vtkCommunicator);
74 
80  void SetCommunicator(vtkCommunicator *communicator);
81 
83 
85  vtkGetMacro(NumberOfProcessIds, int);
87 
92  int GetProcessId(int pos) { return this->ProcessIds[pos]; }
93 
96  int GetLocalProcessId();
97 
102  int FindProcessId(int processId);
103 
106  int AddProcessId(int processId);
107 
112  int RemoveProcessId(int processId);
113 
116  void RemoveAllProcessIds();
117 
119  void Copy(vtkProcessGroup *group);
120 
121 protected:
122  vtkProcessGroup();
123  virtual ~vtkProcessGroup();
124 
127 
129 
130 private:
131  vtkProcessGroup(const vtkProcessGroup &); // Not implemented
132  void operator=(const vtkProcessGroup &); // Not implemented
133 };
134 
135 #endif //__vtkProcessGroup_h
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkCommunicator * Communicator
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
int GetProcessId(int pos)
A subgroup of processes from a communicator.
#define VTK_PARALLEL_EXPORT
static vtkObject * New()
Used to send/receive messages in a multiprocess environment.
Multiprocessing communication superclass.