VTK
vtkMultiProcessStream.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMultiProcessStream.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
29 #ifndef vtkMultiProcessStream_h
30 #define vtkMultiProcessStream_h
31 
32 #include "vtkParallelCoreModule.h" // For export macro
33 #include "vtkObject.h"
34 #include <vector> // needed for vector.
35 #include <string> // needed for string.
36 
37 class VTKPARALLELCORE_EXPORT vtkMultiProcessStream
38 {
39 public:
44 
46 
59  // Without this operator, the compiler would convert
60  // a char* to a bool instead of a std::string.
64 
66 
69  vtkMultiProcessStream& operator >> (double &value);
70  vtkMultiProcessStream& operator >> (float &value);
71  vtkMultiProcessStream& operator >> (int &value);
72  vtkMultiProcessStream& operator >> (char &value);
73  vtkMultiProcessStream& operator >> (bool &value);
74  vtkMultiProcessStream& operator >> (unsigned int &value);
75  vtkMultiProcessStream& operator >> (unsigned char &value);
76  vtkMultiProcessStream& operator >> (vtkTypeInt64 &value);
77  vtkMultiProcessStream& operator >> (vtkTypeUInt64 &value);
78  vtkMultiProcessStream& operator >> (std::string &value);
81 
83 
86  void Push(double array[], unsigned int size);
87  void Push(float array[], unsigned int size);
88  void Push(int array[], unsigned int size);
89  void Push(char array[], unsigned int size);
90  void Push(unsigned int array[], unsigned int size );
91  void Push(unsigned char array[], unsigned int size );
92  void Push(vtkTypeInt64 array[], unsigned int size );
93  void Push(vtkTypeUInt64 array[], unsigned int size );
95 
97 
104  void Pop(double*& array, unsigned int& size);
105  void Pop(float*& array, unsigned int& size);
106  void Pop(int*& array, unsigned int& size);
107  void Pop(char*& array, unsigned int& size);
108  void Pop(unsigned int*& array, unsigned int& size );
109  void Pop(unsigned char*& array, unsigned int& size );
110  void Pop(vtkTypeInt64*& array, unsigned int& size );
111  void Pop(vtkTypeUInt64*& array, unsigned int& size );
113 
114 
118  void Reset();
119 
123  int Size();
124 
129  int RawSize()
130  {return(this->Size()+1);};
131 
135  bool Empty();
136 
138 
142  void GetRawData(std::vector<unsigned char>& data) const;
143  void GetRawData( unsigned char*& data, unsigned int &size );
144  void SetRawData(const std::vector<unsigned char>& data);
145  void SetRawData(const unsigned char*, unsigned int size);
146  std::vector<unsigned char> GetRawData() const;
148 
149 private:
150  class vtkInternals;
151  vtkInternals* Internals;
152  unsigned char Endianness;
153  enum
154  {
155  BigEndian,
156  LittleEndian
157  };
158 };
159 
160 #endif
161 
162 
163 // VTK-HeaderTest-Exclude: vtkMultiProcessStream.h
vtkX3D::value
Definition: vtkX3D.h:220
vtkX3D::data
Definition: vtkX3D.h:315
vtkMultiProcessStream
stream used to pass data across processes using vtkMultiProcessController.
Definition: vtkMultiProcessStream.h:37
vtkMultiProcessStream::RawSize
int RawSize()
Returns the size of the raw data returned by GetRawData.
Definition: vtkMultiProcessStream.h:129
vtkX3D::size
Definition: vtkX3D.h:253
operator<<
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkIndent &o)
vtkObject.h
vtkX3D::string
Definition: vtkX3D.h:490