vtkMaterialInterfacePieceTransaction.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: $RCSfile$
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 =========================================================================*/
28 #ifndef vtkMaterialInterfacePieceTransaction_h
29 #define vtkMaterialInterfacePieceTransaction_h
30 
31 #include "vtkPVVTKExtensionsFiltersMaterialInterfaceModule.h" //needed for exports
32 #include "vtkSystemIncludes.h"
33 
34 #include <iostream>
35 
37 {
38 public:
39  enum
40  {
41  TYPE = 0,
42  REMOTE_PROC = 1,
43  SIZE = 2
44  };
45  //
48  //
49  vtkMaterialInterfacePieceTransaction(char type, int remoteProc)
50  {
51  this->Initialize(type, remoteProc);
52  }
53  //
54  void Initialize(char type, int remoteProc)
55  {
56  this->Data[TYPE] = (int)type;
57  this->Data[REMOTE_PROC] = remoteProc;
58  }
59  //
60  bool Empty() const { return this->Data[TYPE] == 0; }
61  //
62  void Clear()
63  {
64  this->Data[TYPE] = 0;
65  this->Data[REMOTE_PROC] = -1;
66  }
67  //
68  void Pack(int* buf)
69  {
70  buf[0] = this->Data[TYPE];
71  buf[1] = this->Data[REMOTE_PROC];
72  }
73  //
74  void UnPack(int* buf)
75  {
76  this->Data[TYPE] = buf[0];
77  this->Data[REMOTE_PROC] = buf[1];
78  }
79  //
80  char GetType() const { return (char)this->Data[TYPE]; }
81  //
82  int GetRemoteProc() const { return this->Data[REMOTE_PROC]; }
83  //
84  int GetFlatSize() const { return SIZE; }
85 private:
86  int Data[SIZE];
87 };
89 std::ostream& operator<<(std::ostream& sout, const vtkMaterialInterfacePieceTransaction& ta);
90 #endif
91 
92 // VTK-HeaderTest-Exclude: vtkMaterialInterfacePieceTransaction.h
VTKPVVTKEXTENSIONSFILTERSMATERIALINTERFACE_EXPORT std::ostream & operator<<(std::ostream &sout, const vtkMaterialInterfacePieceTransaction &ta)
int
#define VTKPVVTKEXTENSIONSFILTERSMATERIALINTERFACE_EXPORT