VTK: Parallel/Core/vtkMultiProcessStream.h Source File

| VTK 9.3.1

vtkMultiProcessStream.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
20 #ifndef vtkMultiProcessStream_h
21 #define vtkMultiProcessStream_h
22
23 #include "vtkObject.h"
24 #include "vtkParallelCoreModule.h" // For export macro
25 #include <string> // needed for string.
26 #include <vector> // needed for vector.
27
28 VTK_ABI_NAMESPACE_BEGIN
29 class VTKPARALLELCORE_EXPORT vtkMultiProcessStream
30 {
31 public:
32 vtkMultiProcessStream();
33 vtkMultiProcessStream(const vtkMultiProcessStream&);
34 ~vtkMultiProcessStream();
35 vtkMultiProcessStream& operator=(const vtkMultiProcessStream&);
36
38
41 vtkMultiProcessStream& operator<<(double value);
42 vtkMultiProcessStream& operator<<(float value);
43 vtkMultiProcessStream& operator<<(int value);
44 vtkMultiProcessStream& operator<<(char value);
45 vtkMultiProcessStream& operator<<(bool value);
46 vtkMultiProcessStream& operator<<(unsigned int value);
47 vtkMultiProcessStream& operator<<(unsigned char value);
48 vtkMultiProcessStream& operator<<(vtkTypeInt64 value);
49 vtkMultiProcessStream& operator<<(vtkTypeUInt64 value);
50 vtkMultiProcessStream& operator<<(const std::string& value);
51 // Without this operator, the compiler would convert
52 // a char* to a bool instead of a std::string.
53 vtkMultiProcessStream& operator<<(const char* value);
54 vtkMultiProcessStream& operator<<(const vtkMultiProcessStream&);
56
58
61 vtkMultiProcessStream& operator>>(double& value);
62 vtkMultiProcessStream& operator>>(float& value);
63 vtkMultiProcessStream& operator>>(int& value);
64 vtkMultiProcessStream& operator>>(char& value);
65 vtkMultiProcessStream& operator>>(bool& value);
66 vtkMultiProcessStream& operator>>(unsigned int& value);
67 vtkMultiProcessStream& operator>>(unsigned char& value);
68 vtkMultiProcessStream& operator>>(vtkTypeInt64& value);
69 vtkMultiProcessStream& operator>>(vtkTypeUInt64& value);
70 vtkMultiProcessStream& operator>>(std::string& value);
71 vtkMultiProcessStream& operator>>(vtkMultiProcessStream&);
73
75
78 void Push(double array[], unsigned int size);
79 void Push(float array[], unsigned int size);
80 void Push(int array[], unsigned int size);
81 void Push(char array[], unsigned int size);
82 void Push(unsigned int array[], unsigned int size);
83 void Push(unsigned char array[], unsigned int size);
84 void Push(vtkTypeInt64 array[], unsigned int size);
85 void Push(vtkTypeUInt64 array[], unsigned int size);
87
89
96 void Pop(double*& array, unsigned int& size);
97 void Pop(float*& array, unsigned int& size);
98 void Pop(int*& array, unsigned int& size);
99 void Pop(char*& array, unsigned int& size);
100 void Pop(unsigned int*& array, unsigned int& size);
101 void Pop(unsigned char*& array, unsigned int& size);
102 void Pop(vtkTypeInt64*& array, unsigned int& size);
103 void Pop(vtkTypeUInt64*& array, unsigned int& size);
105
109 void Reset();
110
114 int Size();
115
120 int RawSize() { return (this->Size() + 1); }
121
125 bool Empty();
126
128
132 void GetRawData(std::vector<unsigned char>& data) const;
133 void GetRawData(unsigned char*& data, unsigned int& size);
134 void SetRawData(const std::vector<unsigned char>& data);
135 void SetRawData(const unsigned char*, unsigned int size);
136 std::vector<unsigned char> GetRawData() const;
138
139 private:
140 class vtkInternals;
141 vtkInternals* Internals;
142 unsigned char Endianness;
143 enum
144 {
145 BigEndian,
146 LittleEndian
147 };
148 };
149
150 VTK_ABI_NAMESPACE_END
151 #endif
152
153 // VTK-HeaderTest-Exclude: vtkMultiProcessStream.h
vtkMultiProcessStream
stream used to pass data across processes using vtkMultiProcessController.
Definition: vtkMultiProcessStream.h:30
vtkMultiProcessStream::Pop
void Pop(vtkTypeUInt64 *&array, unsigned int &size)
Remove-array-to-stream methods.
vtkMultiProcessStream::vtkMultiProcessStream
vtkMultiProcessStream()
vtkMultiProcessStream::~vtkMultiProcessStream
~vtkMultiProcessStream()
vtkMultiProcessStream::SetRawData
void SetRawData(const unsigned char *, unsigned int size)
Serialization methods used to save/restore the stream to/from raw data.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(char value)
Add-to-stream operators.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(bool &value)
Remove-from-stream operators.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(std::string &value)
Remove-from-stream operators.
vtkMultiProcessStream::Pop
void Pop(double *&array, unsigned int &size)
Remove-array-to-stream methods.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(unsigned char value)
Add-to-stream operators.
vtkMultiProcessStream::SetRawData
void SetRawData(const std::vector< unsigned char > &data)
Serialization methods used to save/restore the stream to/from raw data.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(vtkTypeInt64 &value)
Remove-from-stream operators.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(char &value)
Remove-from-stream operators.
vtkMultiProcessStream::Empty
bool Empty()
Returns true iff the stream is empty.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(unsigned int &value)
Remove-from-stream operators.
vtkMultiProcessStream::Push
void Push(float array[], unsigned int size)
Add-array-to-stream methods.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(float &value)
Remove-from-stream operators.
vtkMultiProcessStream::GetRawData
void GetRawData(std::vector< unsigned char > &data) const
Serialization methods used to save/restore the stream to/from raw data.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(int value)
Add-to-stream operators.
vtkMultiProcessStream::Pop
void Pop(char *&array, unsigned int &size)
Remove-array-to-stream methods.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(vtkTypeUInt64 &value)
Remove-from-stream operators.
vtkMultiProcessStream::Push
void Push(unsigned int array[], unsigned int size)
Add-array-to-stream methods.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(int &value)
Remove-from-stream operators.
vtkMultiProcessStream::Pop
void Pop(unsigned char *&array, unsigned int &size)
Remove-array-to-stream methods.
vtkMultiProcessStream::Push
void Push(int array[], unsigned int size)
Add-array-to-stream methods.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(float value)
Add-to-stream operators.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(vtkTypeUInt64 value)
Add-to-stream operators.
vtkMultiProcessStream::Push
void Push(char array[], unsigned int size)
Add-array-to-stream methods.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(double &value)
Remove-from-stream operators.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(const vtkMultiProcessStream &)
Add-to-stream operators.
vtkMultiProcessStream::Reset
void Reset()
Clears everything in the stream.
vtkMultiProcessStream::Push
void Push(double array[], unsigned int size)
Add-array-to-stream methods.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(double value)
Add-to-stream operators.
vtkMultiProcessStream::Push
void Push(vtkTypeInt64 array[], unsigned int size)
Add-array-to-stream methods.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(unsigned int value)
Add-to-stream operators.
vtkMultiProcessStream::Pop
void Pop(float *&array, unsigned int &size)
Remove-array-to-stream methods.
vtkMultiProcessStream::Pop
void Pop(int *&array, unsigned int &size)
Remove-array-to-stream methods.
vtkMultiProcessStream::Pop
void Pop(unsigned int *&array, unsigned int &size)
Remove-array-to-stream methods.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(const char *value)
Add-to-stream operators.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(unsigned char &value)
Remove-from-stream operators.
vtkMultiProcessStream::Push
void Push(vtkTypeUInt64 array[], unsigned int size)
Add-array-to-stream methods.
vtkMultiProcessStream::operator=
vtkMultiProcessStream & operator=(const vtkMultiProcessStream &)
vtkMultiProcessStream::Pop
void Pop(vtkTypeInt64 *&array, unsigned int &size)
Remove-array-to-stream methods.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(const std::string &value)
Add-to-stream operators.
vtkMultiProcessStream::GetRawData
void GetRawData(unsigned char *&data, unsigned int &size)
Serialization methods used to save/restore the stream to/from raw data.
vtkMultiProcessStream::operator>>
vtkMultiProcessStream & operator>>(vtkMultiProcessStream &)
Remove-from-stream operators.
vtkMultiProcessStream::GetRawData
std::vector< unsigned char > GetRawData() const
Serialization methods used to save/restore the stream to/from raw data.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(vtkTypeInt64 value)
Add-to-stream operators.
vtkMultiProcessStream::Push
void Push(unsigned char array[], unsigned int size)
Add-array-to-stream methods.
vtkMultiProcessStream::operator<<
vtkMultiProcessStream & operator<<(bool value)
Add-to-stream operators.
vtkMultiProcessStream::Size
int Size()
Returns the size of the stream.
vtkMultiProcessStream::RawSize
int RawSize()
Returns the size of the raw data returned by GetRawData.
Definition: vtkMultiProcessStream.h:120
vtkMultiProcessStream::vtkMultiProcessStream
vtkMultiProcessStream(const vtkMultiProcessStream &)
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkObject.h