Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkCommunicator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCommunicator.h,v $
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 =========================================================================*/
00047 #ifndef __vtkCommunicator_h
00048 #define __vtkCommunicator_h
00049 
00050 #include "vtkObject.h"
00051 
00052 class vtkDataSet;
00053 class vtkImageData;
00054 class vtkDataObject;
00055 class vtkDataArray;
00056 
00057 class VTK_PARALLEL_EXPORT vtkCommunicator : public vtkObject
00058 {
00059 
00060 public:
00061 
00062   vtkTypeRevisionMacro(vtkCommunicator, vtkObject);
00063   void PrintSelf(ostream& os, vtkIndent indent);
00064 
00067   virtual int Send(vtkDataObject* data, int remoteHandle, int tag);
00068 
00071   virtual int Send(vtkDataArray* data, int remoteHandle, int tag);
00072   
00074 
00075   virtual int Send(int* data, int length, int remoteHandle, int tag) = 0;
00076   virtual int Send(unsigned long* data, int length, int remoteHandle, 
00077                    int tag) = 0;
00078   virtual int Send(unsigned char* data, int length, int remoteHandle, 
00079                    int tag) = 0;
00080   virtual int Send(char* data, int length, int remoteHandle, 
00081                    int tag) = 0;
00082   virtual int Send(float* data, int length, int remoteHandle, 
00083                    int tag) = 0;
00084   virtual int Send(double* data, int length, int remoteHandle, 
00085                    int tag) = 0;
00086 #ifdef VTK_USE_64BIT_IDS
00087   virtual int Send(vtkIdType* data, int length, int remoteHandle, 
00088                    int tag) = 0;
00090 #endif
00091 
00092 
00095   virtual int Receive(vtkDataObject* data, int remoteHandle, int tag);
00096 
00099   virtual int Receive(vtkDataArray* data, int remoteHandle, int tag);
00100 
00102 
00104   virtual int Receive(int* data, int length, int remoteHandle, 
00105                       int tag) = 0;
00106   virtual int Receive(unsigned long* data, int length, int remoteHandle,
00107                       int tag) = 0;
00108   virtual int Receive(unsigned char* data, int length, int remoteHandle, 
00109                       int tag) = 0;
00110   virtual int Receive(char* data, int length, int remoteHandle, 
00111                       int tag) = 0;
00112   virtual int Receive(float* data, int length, int remoteHandle, 
00113                       int tag) = 0;
00114   virtual int Receive(double* data, int length, int remoteHandle, 
00115                       int tag) = 0;
00116 #ifdef VTK_USE_64BIT_IDS
00117   virtual int Receive(vtkIdType* data, int length, int remoteHandle, 
00118                       int tag) = 0;
00120 #endif
00121 
00122   static void SetUseCopy(int useCopy);
00123 
00124 protected:
00125 
00126   void DeleteAndSetMarshalString(char *str, int strLength);
00127 
00128   // Write and read from marshal string
00129   // return 1 success, 0 fail
00130   int WriteObject(vtkDataObject *object);
00131   int ReadObject(vtkDataObject *object);
00132   
00133   int WriteDataSet(vtkDataSet *object);
00134   int ReadDataSet(vtkDataSet *object);
00135 
00136   int WriteImageData(vtkImageData *object);
00137   int ReadImageData(vtkImageData *object);
00138 
00139   int WriteDataArray(vtkDataArray *object);
00140   int ReadDataArray(vtkDataArray *object);
00141 
00142   vtkCommunicator();
00143   ~vtkCommunicator();
00144 
00145   char *MarshalString;
00146   int MarshalStringLength;
00147   // The data may not take up all of the string.
00148   int MarshalDataLength;
00149 
00150   static int UseCopy;
00151 
00152 private:
00153   vtkCommunicator(const vtkCommunicator&);  // Not implemented.
00154   void operator=(const vtkCommunicator&);  // Not implemented.
00155 };
00156 
00157 #endif // __vtkCommunicator_h
00158 
00159