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 =========================================================================*/
31 #ifndef __vtkMultiProcessStream_h
32 #define __vtkMultiProcessStream_h
33 
34 #include "vtkParallelCoreModule.h" // For export macro
35 #include "vtkObject.h"
36 #include <vector> // needed for vector.
37 #include <string> // needed for string.
38 
40 {
41 public:
46 
48 
50  vtkMultiProcessStream& operator << (float value);
53  vtkMultiProcessStream& operator << (unsigned int value);
54  vtkMultiProcessStream& operator << (unsigned char value);
55  vtkMultiProcessStream& operator << (vtkTypeInt64 value);
56  vtkMultiProcessStream& operator << (vtkTypeUInt64 value);
60 
62 
63  vtkMultiProcessStream& operator >> (double &value);
64  vtkMultiProcessStream& operator >> (float &value);
65  vtkMultiProcessStream& operator >> (int &value);
66  vtkMultiProcessStream& operator >> (char &value);
67  vtkMultiProcessStream& operator >> (unsigned int &value);
68  vtkMultiProcessStream& operator >> (unsigned char &value);
69  vtkMultiProcessStream& operator >> (vtkTypeInt64 &value);
70  vtkMultiProcessStream& operator >> (vtkTypeUInt64 &value);
71  vtkMultiProcessStream& operator >> (std::string &value);
74 
76 
77  void Push(double array[], unsigned int size);
78  void Push(float array[], unsigned int size);
79  void Push(int array[], unsigned int size);
80  void Push(char array[], unsigned int size);
81  void Push(unsigned int array[], unsigned int size );
82  void Push(unsigned char array[], unsigned int size );
83  void Push(vtkTypeInt64 array[], unsigned int size );
84  void Push(vtkTypeUInt64 array[], unsigned int size );
86 
88 
94  void Pop(double*& array, unsigned int& size);
95  void Pop(float*& array, unsigned int& size);
96  void Pop(int*& array, unsigned int& size);
97  void Pop(char*& array, unsigned int& size);
98  void Pop(unsigned int*& array, unsigned int& size );
99  void Pop(unsigned char*& array, unsigned int& size );
100  void Pop(vtkTypeInt64*& array, unsigned int& size );
101  void Pop(vtkTypeUInt64*& array, unsigned int& size );
103 
104 
106  void Reset();
107 
109  int Size();
110 
112 
114  int RawSize()
115  {return(this->Size()+1);};
117 
119  bool Empty();
120 
122 
125  void GetRawData(std::vector<unsigned char>& data) const;
126  void GetRawData( unsigned char*& data, unsigned int &size );
127  void SetRawData(const std::vector<unsigned char>& data);
128  void SetRawData(const unsigned char*, unsigned int size);
130 
131 private:
132  class vtkInternals;
133  vtkInternals* Internals;
134  unsigned char Endianness;
135  enum
136  {
137  BigEndian,
138  LittleEndian
139  };
140 };
141 
142 #endif
143 
144 
145 // VTK-HeaderTest-Exclude: vtkMultiProcessStream.h
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
GLsizeiptr size
Definition: vtkgl.h:11843
stream used to pass data across processes using vtkMultiProcessController.
#define VTKPARALLELCORE_EXPORT
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkIndent &o)
GLsizei const GLchar ** string
Definition: vtkgl.h:12011