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 << (unsigned int value); 00054 vtkMultiProcessStream& operator << (unsigned char value); 00055 vtkMultiProcessStream& operator << (vtkTypeInt64 value); 00056 vtkMultiProcessStream& operator << (vtkTypeUInt64 value); 00057 vtkMultiProcessStream& operator << (const std::string& value); 00058 vtkMultiProcessStream& operator << (const vtkMultiProcessStream&); 00060 00062 00063 vtkMultiProcessStream& operator >> (double &value); 00064 vtkMultiProcessStream& operator >> (float &value); 00065 vtkMultiProcessStream& operator >> (int &value); 00066 vtkMultiProcessStream& operator >> (char &value); 00067 vtkMultiProcessStream& operator >> (unsigned int &value); 00068 vtkMultiProcessStream& operator >> (unsigned char &value); 00069 vtkMultiProcessStream& operator >> (vtkTypeInt64 &value); 00070 vtkMultiProcessStream& operator >> (vtkTypeUInt64 &value); 00071 vtkMultiProcessStream& operator >> (std::string &value); 00072 vtkMultiProcessStream& operator >> (vtkMultiProcessStream&); 00074 00076 00077 void Push(double array[], unsigned int size); 00078 void Push(float array[], unsigned int size); 00079 void Push(int array[], unsigned int size); 00080 void Push(char array[], unsigned int size); 00081 void Push(unsigned int array[], unsigned int size ); 00082 void Push(unsigned char array[], unsigned int size ); 00083 void Push(vtkTypeInt64 array[], unsigned int size ); 00084 void Push(vtkTypeUInt64 array[], unsigned int size ); 00086 00088 00094 void Pop(double*& array, unsigned int& size); 00095 void Pop(float*& array, unsigned int& size); 00096 void Pop(int*& array, unsigned int& size); 00097 void Pop(char*& array, unsigned int& size); 00098 void Pop(unsigned int*& array, unsigned int& size ); 00099 void Pop(unsigned char*& array, unsigned int& size ); 00100 void Pop(vtkTypeInt64*& array, unsigned int& size ); 00101 void Pop(vtkTypeUInt64*& array, unsigned int& size ); 00103 00104 00106 void Reset(); 00107 00109 int Size(); 00110 00112 00114 int RawSize() 00115 {return(this->Size()+1);}; 00117 00119 bool Empty(); 00120 00122 00125 void GetRawData(std::vector<unsigned char>& data) const; 00126 void GetRawData( unsigned char*& data, unsigned int &size ); 00127 void SetRawData(const std::vector<unsigned char>& data); 00128 void SetRawData(const unsigned char*, unsigned int size); 00130 00131 private: 00132 class vtkInternals; 00133 vtkInternals* Internals; 00134 unsigned char Endianness; 00135 enum 00136 { 00137 BigEndian, 00138 LittleEndian 00139 }; 00140 }; 00141 00142 #endif 00143 00144 00145 // VTK-HeaderTest-Exclude: vtkMultiProcessStream.h