VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkMultiProcessStream.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00031 #ifndef vtkMultiProcessStream_h 00032 #define vtkMultiProcessStream_h 00033 00034 #include "vtkParallelCoreModule.h" // For export macro 00035 #include "vtkObject.h" 00036 #include <vector> // needed for vector. 00037 #include <string> // needed for string. 00038 00039 class VTKPARALLELCORE_EXPORT vtkMultiProcessStream 00040 { 00041 public: 00042 vtkMultiProcessStream(); 00043 vtkMultiProcessStream(const vtkMultiProcessStream&); 00044 ~vtkMultiProcessStream(); 00045 vtkMultiProcessStream& operator=(const vtkMultiProcessStream&); 00046 00048 00049 vtkMultiProcessStream& operator << (double value); 00050 vtkMultiProcessStream& operator << (float value); 00051 vtkMultiProcessStream& operator << (int value); 00052 vtkMultiProcessStream& operator << (char value); 00053 vtkMultiProcessStream& operator << (bool value); 00054 vtkMultiProcessStream& operator << (unsigned int value); 00055 vtkMultiProcessStream& operator << (unsigned char value); 00056 vtkMultiProcessStream& operator << (vtkTypeInt64 value); 00057 vtkMultiProcessStream& operator << (vtkTypeUInt64 value); 00058 vtkMultiProcessStream& operator << (const std::string& value); 00059 // Without this operator, the compiler would convert 00060 // a char* to a bool instead of a std::string. 00061 vtkMultiProcessStream& operator << (const char* value); 00062 vtkMultiProcessStream& operator << (const vtkMultiProcessStream&); 00064 00066 00067 vtkMultiProcessStream& operator >> (double &value); 00068 vtkMultiProcessStream& operator >> (float &value); 00069 vtkMultiProcessStream& operator >> (int &value); 00070 vtkMultiProcessStream& operator >> (char &value); 00071 vtkMultiProcessStream& operator >> (bool &value); 00072 vtkMultiProcessStream& operator >> (unsigned int &value); 00073 vtkMultiProcessStream& operator >> (unsigned char &value); 00074 vtkMultiProcessStream& operator >> (vtkTypeInt64 &value); 00075 vtkMultiProcessStream& operator >> (vtkTypeUInt64 &value); 00076 vtkMultiProcessStream& operator >> (std::string &value); 00077 vtkMultiProcessStream& operator >> (vtkMultiProcessStream&); 00079 00081 00082 void Push(double array[], unsigned int size); 00083 void Push(float array[], unsigned int size); 00084 void Push(int array[], unsigned int size); 00085 void Push(char array[], unsigned int size); 00086 void Push(unsigned int array[], unsigned int size ); 00087 void Push(unsigned char array[], unsigned int size ); 00088 void Push(vtkTypeInt64 array[], unsigned int size ); 00089 void Push(vtkTypeUInt64 array[], unsigned int size ); 00091 00093 00099 void Pop(double*& array, unsigned int& size); 00100 void Pop(float*& array, unsigned int& size); 00101 void Pop(int*& array, unsigned int& size); 00102 void Pop(char*& array, unsigned int& size); 00103 void Pop(unsigned int*& array, unsigned int& size ); 00104 void Pop(unsigned char*& array, unsigned int& size ); 00105 void Pop(vtkTypeInt64*& array, unsigned int& size ); 00106 void Pop(vtkTypeUInt64*& array, unsigned int& size ); 00108 00109 00111 void Reset(); 00112 00114 int Size(); 00115 00117 00119 int RawSize() 00120 {return(this->Size()+1);}; 00122 00124 bool Empty(); 00125 00127 00130 void GetRawData(std::vector<unsigned char>& data) const; 00131 void GetRawData( unsigned char*& data, unsigned int &size ); 00132 void SetRawData(const std::vector<unsigned char>& data); 00133 void SetRawData(const unsigned char*, unsigned int size); 00135 00136 private: 00137 class vtkInternals; 00138 vtkInternals* Internals; 00139 unsigned char Endianness; 00140 enum 00141 { 00142 BigEndian, 00143 LittleEndian 00144 }; 00145 }; 00146 00147 #endif 00148 00149 00150 // VTK-HeaderTest-Exclude: vtkMultiProcessStream.h