vtkMaterialInterfacePieceTransaction.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkMaterialInterfacePieceTransaction_h
18 #define vtkMaterialInterfacePieceTransaction_h
19 
20 #include "vtkPVVTKExtensionsFiltersMaterialInterfaceModule.h" //needed for exports
21 
22 #include <iostream> // for std::ostream
23 
25 {
26 public:
27  enum
28  {
29  TYPE = 0,
30  REMOTE_PROC = 1,
31  SIZE = 2
32  };
33  //
36  //
37  vtkMaterialInterfacePieceTransaction(char type, int remoteProc)
38  {
39  this->Initialize(type, remoteProc);
40  }
41  //
42  void Initialize(char type, int remoteProc)
43  {
44  this->Data[TYPE] = (int)type;
45  this->Data[REMOTE_PROC] = remoteProc;
46  }
47  //
48  bool Empty() const { return this->Data[TYPE] == 0; }
49  //
50  void Clear()
51  {
52  this->Data[TYPE] = 0;
53  this->Data[REMOTE_PROC] = -1;
54  }
55  //
56  void Pack(int* buf)
57  {
58  buf[0] = this->Data[TYPE];
59  buf[1] = this->Data[REMOTE_PROC];
60  }
61  //
62  void UnPack(int* buf)
63  {
64  this->Data[TYPE] = buf[0];
65  this->Data[REMOTE_PROC] = buf[1];
66  }
67  //
68  char GetType() const { return (char)this->Data[TYPE]; }
69  //
70  int GetRemoteProc() const { return this->Data[REMOTE_PROC]; }
71  //
72  int GetFlatSize() const { return SIZE; }
73 
74 private:
75  int Data[SIZE];
76 };
78 std::ostream& operator<<(std::ostream& sout, const vtkMaterialInterfacePieceTransaction& ta);
79 #endif
VTKPVVTKEXTENSIONSFILTERSMATERIALINTERFACE_EXPORT std::ostream & operator<<(std::ostream &sout, const vtkMaterialInterfacePieceTransaction &ta)
int
#define VTKPVVTKEXTENSIONSFILTERSMATERIALINTERFACE_EXPORT