Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MarshaledExN04CalorimeterHit Class Reference

#include <MarshaledExN04CalorimeterHit.h>

Inheritance diagram for MarshaledExN04CalorimeterHit:
Collaboration diagram for MarshaledExN04CalorimeterHit:

Public Member Functions

 MarshaledExN04CalorimeterHit (ExN04CalorimeterHit *objptr)
 
 MarshaledExN04CalorimeterHit (void *buf, char chIsUnmarshaling= 'u')
 
 ~MarshaledExN04CalorimeterHit ()
 
ExN04CalorimeterHitunmarshal ()
 
void unmarshalTo (ExN04CalorimeterHit *obj)
 
void marshal1 ()
 
void unmarshal1 ()
 
void marshal2 ()
 
void unmarshal2 ()
 
void marshal3 ()
 
void unmarshal3 ()
 
void marshal4 ()
 
void unmarshal4 ()
 
- Public Member Functions inherited from MarshaledObj
 MarshaledObj ()
 
 MarshaledObj (void *buf, char chIsUnmarshaling)
 
 ~MarshaledObj ()
 
bool isUnmarshaling ()
 
void EXTEND_BUFFER (int size)
 
void resizeBuffer (size_t new_size)
 
int getBufferSize ()
 
char * getBuffer ()
 
void marshalPrimitive (void *p, int size)
 
void unmarshalPrimitive (void *p, int size)
 
 MarshaledObj ()
 
 MarshaledObj (void *buf, char chIsUnmarshaling)
 
 ~MarshaledObj ()
 
bool isUnmarshaling ()
 
void EXTEND_BUFFER (int size)
 
void resizeBuffer (size_t new_size)
 
int getBufferSize ()
 
char * getBuffer ()
 
void marshalPrimitive (void *p, int size)
 
void unmarshalPrimitive (void *p, int size)
 

Public Attributes

ExN04CalorimeterHitparam
 
ShadowedMarshaledExN04CalorimeterHitShadowed_param
 

Additional Inherited Members

- Static Public Member Functions inherited from MarshaledObj
static int ROUND_UP (int x)
 
static int ROUND_UP (int x)
 
- Protected Attributes inherited from MarshaledObj
int msh_typechoice
 
char * msh_buffer
 
char * msh_field_begin
 
size_t msh_size
 
char * msh_cursor
 
size_t msh_extent
 
bool msh_isUnmarshalDone
 

Detailed Description

Definition at line 22 of file MarshaledExN04CalorimeterHit.h.

Constructor & Destructor Documentation

MarshaledExN04CalorimeterHit::MarshaledExN04CalorimeterHit ( ExN04CalorimeterHit objptr)
inline

Definition at line 31 of file MarshaledExN04CalorimeterHit.h.

Here is the call graph for this function:

MarshaledExN04CalorimeterHit::MarshaledExN04CalorimeterHit ( void buf,
char  chIsUnmarshaling = 'u' 
)
inline

Definition at line 44 of file MarshaledExN04CalorimeterHit.h.

45 : MarshaledObj(buf, chIsUnmarshaling) {
46  msh_isUnmarshalDone = false;
47 }
bool msh_isUnmarshalDone
Definition: MarshaledObj.h:119
MarshaledExN04CalorimeterHit::~MarshaledExN04CalorimeterHit ( )
inline

Definition at line 49 of file MarshaledExN04CalorimeterHit.h.

49  {
50  //if(msh_isUnmarshalDone && this->param != NULL) {
51  //delete this->param;
52  //}
53 }

Member Function Documentation

void MarshaledExN04CalorimeterHit::marshal1 ( )
inline

Definition at line 92 of file MarshaledExN04CalorimeterHit.h.

92  {
93  //declare field_size to be the size of this field
94  int msh_currentSize = 0;
95  if (isUnmarshaling())
96  throw "Tried to marshal in obj marked isUnmarshaling == true";
97 
98  //Copy the sizespec into msh_currentSize here:
99  {
100  msh_currentSize = sizeof(G4int);
101 
102  }
103 
104  //Increase the size of buffer if needed
105  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int));
106  // 4 bytes for the total size of field, 4 bytes for the number
107  // of elements in the array (in the case of array marshaling)
108  //Mark the beginning position for this field, will write the total
109  // size of this field here later
111 
112  //Advance cursor of distance = sizeof(int)
113  msh_cursor += sizeof(int);
114 
115  //Now just copy "get" functions here
116  {
117  G4int anElement;
118  anElement = param->GetZ();
119  memcpy(msh_cursor, &anElement, sizeof(G4int));
120  }
121  //Now advance the cursor
122  msh_cursor += msh_currentSize;
123  //Now set the size of this field
124  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
125  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
126  memcpy(msh_field_begin, &tmp, sizeof(int));
127 
128  //Now set msh_size
131 }
int G4int
Definition: G4Types.hh:78
#define MSH_SET_TYPECHOICE(X)
Definition: MarshaledObj.h:21
bool isUnmarshaling()
Definition: MarshaledObj.h:92
size_t msh_size
Definition: MarshaledObj.h:110
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
void EXTEND_BUFFER(int size)
Definition: MarshaledObj.h:122
char * msh_field_begin
Definition: MarshaledObj.h:107
char * msh_cursor
Definition: MarshaledObj.h:113
#define MSH_SET_TOTALSIZE(X)
Definition: MarshaledObj.h:22
char * msh_buffer
Definition: MarshaledObj.h:104

Here is the call graph for this function:

Here is the caller graph for this function:

void MarshaledExN04CalorimeterHit::marshal2 ( )
inline

Definition at line 149 of file MarshaledExN04CalorimeterHit.h.

149  {
150  //declare field_size to be the size of this field
151  int msh_currentSize = 0;
152  if (isUnmarshaling())
153  throw "Tried to marshal in obj marked isUnmarshaling == true";
154 
155  //Copy the sizespec into msh_currentSize here:
156  {
157  msh_currentSize = sizeof(G4int);
158 
159  }
160 
161  //Increase the size of buffer if needed
162  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int));
163  // 4 bytes for the total size of field, 4 bytes for the number of
164  // elements in the array (in the case of array marshaling)
165  //Mark the beginning position for this field, will write the total
166  //size of this field here later
168 
169  //Advance cursor of distance = sizeof(int)
170  msh_cursor += sizeof(int);
171 
172  //Now just copy "get" functions here
173  {
174  G4int anElement;
175  anElement = param->GetPhi();
176  memcpy(msh_cursor, &anElement, sizeof(G4int));
177  }
178  //Now advance the cursor
179  msh_cursor += msh_currentSize;
180  //Now set the size of this field
181  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
182  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
183  memcpy(msh_field_begin, &tmp, sizeof(int));
184 
185  //Now set msh_size
188 }
int G4int
Definition: G4Types.hh:78
#define MSH_SET_TYPECHOICE(X)
Definition: MarshaledObj.h:21
bool isUnmarshaling()
Definition: MarshaledObj.h:92
size_t msh_size
Definition: MarshaledObj.h:110
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
void EXTEND_BUFFER(int size)
Definition: MarshaledObj.h:122
char * msh_field_begin
Definition: MarshaledObj.h:107
char * msh_cursor
Definition: MarshaledObj.h:113
#define MSH_SET_TOTALSIZE(X)
Definition: MarshaledObj.h:22
char * msh_buffer
Definition: MarshaledObj.h:104

Here is the call graph for this function:

Here is the caller graph for this function:

void MarshaledExN04CalorimeterHit::marshal3 ( )
inline

Definition at line 206 of file MarshaledExN04CalorimeterHit.h.

206  {
207  //declare field_size to be the size of this field
208  int msh_currentSize = 0;
209  if (isUnmarshaling())
210  throw "Tried to marshal in obj marked isUnmarshaling == true";
211 
212  //Copy the sizespec into msh_currentSize here:
213  {
214  msh_currentSize = sizeof(G4double);
215 
216  }
217 
218  //Increase the size of buffer if needed
219  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int));
220  // 4 bytes for the total size of field, 4 bytes for the number of
221  // elements in the array (in the case of array marshaling)
222  //Mark the beginning position for this field, will write the total size
223  // of this field here later
225 
226  //Advance cursor of distance = sizeof(int)
227  msh_cursor += sizeof(int);
228 
229  //Now just copy "get" functions here
230  {
231  G4double anElement;
232  anElement = param->GetEdep();
233  memcpy(msh_cursor, &anElement, sizeof(G4double));
234  }
235  //Now advance the cursor
236  msh_cursor += msh_currentSize;
237  //Now set the size of this field
238  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
239  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
240  memcpy(msh_field_begin, &tmp, sizeof(int));
241 
242  //Now set msh_size
245 }
#define MSH_SET_TYPECHOICE(X)
Definition: MarshaledObj.h:21
bool isUnmarshaling()
Definition: MarshaledObj.h:92
size_t msh_size
Definition: MarshaledObj.h:110
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
void EXTEND_BUFFER(int size)
Definition: MarshaledObj.h:122
char * msh_field_begin
Definition: MarshaledObj.h:107
char * msh_cursor
Definition: MarshaledObj.h:113
double G4double
Definition: G4Types.hh:76
#define MSH_SET_TOTALSIZE(X)
Definition: MarshaledObj.h:22
char * msh_buffer
Definition: MarshaledObj.h:104

Here is the call graph for this function:

Here is the caller graph for this function:

void MarshaledExN04CalorimeterHit::marshal4 ( )
inline

Definition at line 263 of file MarshaledExN04CalorimeterHit.h.

263  {
264  //declare field_size to be the size of this field
265  int msh_currentSize = 0;
266  if (isUnmarshaling())
267  throw "Tried to marshal in obj marked isUnmarshaling == true";
268 
269  //Copy the sizespec into msh_currentSize here:
270  {
271  msh_currentSize = sizeof(G4ThreeVector);
272 
273  }
274 
275  //Increase the size of buffer if needed
276  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int));
277  // 4 bytes for the total size of field, 4 bytes for the number of
278  // elements in the array (in the case of array marshaling)
279  //Mark the beginning position for this field, will write the total size
280  //of this field here later
282 
283  //Advance cursor of distance = sizeof(int)
284  msh_cursor += sizeof(int);
285 
286  //Now just copy "get" functions here
287  {
288  G4ThreeVector anElement;
289  anElement = param->GetPos();
290  memcpy(msh_cursor, &anElement, sizeof(G4ThreeVector));
291  }
292  //Now advance the cursor
293  msh_cursor += msh_currentSize;
294  //Now set the size of this field
295  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
296  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
297  memcpy(msh_field_begin, &tmp, sizeof(int));
298 
299  //Now set msh_size
302 }
CLHEP::Hep3Vector G4ThreeVector
#define MSH_SET_TYPECHOICE(X)
Definition: MarshaledObj.h:21
bool isUnmarshaling()
Definition: MarshaledObj.h:92
size_t msh_size
Definition: MarshaledObj.h:110
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
void EXTEND_BUFFER(int size)
Definition: MarshaledObj.h:122
char * msh_field_begin
Definition: MarshaledObj.h:107
char * msh_cursor
Definition: MarshaledObj.h:113
#define MSH_SET_TOTALSIZE(X)
Definition: MarshaledObj.h:22
char * msh_buffer
Definition: MarshaledObj.h:104

Here is the call graph for this function:

Here is the caller graph for this function:

ExN04CalorimeterHit* MarshaledExN04CalorimeterHit::unmarshal ( )
inline

Definition at line 55 of file MarshaledExN04CalorimeterHit.h.

55  {
56  //We don't want to unmarshal the buffer is empty.
57  if(msh_size <= MSH_HEADER_SIZE) {
58  //This is buggy, we can't always assume that
59  //obj == NULL <==> List is empty.
60  return NULL;
61  } else {
62  {
63  param = new ExN04CalorimeterHit();
64  }
66  this->msh_isUnmarshalDone = true;
67  unmarshal1();
68  unmarshal2();
69  unmarshal3();
70  unmarshal4();
71  return this->param;
72  }
73 }
bool msh_isUnmarshalDone
Definition: MarshaledObj.h:119
size_t msh_size
Definition: MarshaledObj.h:110
ShadowedMarshaledExN04CalorimeterHit * Shadowed_param
#define MSH_HEADER_SIZE
Definition: MarshaledObj.h:15

Here is the call graph for this function:

Here is the caller graph for this function:

void MarshaledExN04CalorimeterHit::unmarshal1 ( )
inline

Definition at line 133 of file MarshaledExN04CalorimeterHit.h.

133  {
134  //declare currentSize to be the size of this field
135  int msh_currentSize = 0;
136  //copy the size of the current field into currentSize
137  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
138  msh_cursor += sizeof(int);
139  //Now copy the setspec here
140  {
141  G4int anElement;
142  memcpy(&anElement, msh_cursor, sizeof(G4int));
143  param->SetCellID(anElement, param->GetPhi());
144 
145  }
146  msh_cursor += msh_currentSize;
147 }
int G4int
Definition: G4Types.hh:78
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
void SetCellID(G4int z, G4int phi)
char * msh_cursor
Definition: MarshaledObj.h:113

Here is the call graph for this function:

Here is the caller graph for this function:

void MarshaledExN04CalorimeterHit::unmarshal2 ( )
inline

Definition at line 190 of file MarshaledExN04CalorimeterHit.h.

190  {
191  //declare currentSize to be the size of this field
192  int msh_currentSize = 0;
193  //copy the size of the current field into currentSize
194  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
195  msh_cursor += sizeof(int);
196  //Now copy the setspec here
197  {
198  G4int anElement;
199  memcpy(&anElement, msh_cursor, sizeof(G4int));
200  param->SetCellID(param->GetZ(), anElement);
201 
202  }
203  msh_cursor += msh_currentSize;
204 }
int G4int
Definition: G4Types.hh:78
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
void SetCellID(G4int z, G4int phi)
char * msh_cursor
Definition: MarshaledObj.h:113

Here is the call graph for this function:

Here is the caller graph for this function:

void MarshaledExN04CalorimeterHit::unmarshal3 ( )
inline

Definition at line 247 of file MarshaledExN04CalorimeterHit.h.

247  {
248  //declare currentSize to be the size of this field
249  int msh_currentSize = 0;
250  //copy the size of the current field into currentSize
251  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
252  msh_cursor += sizeof(int);
253  //Now copy the setspec here
254  {
255  G4double anElement;
256  memcpy(&anElement, msh_cursor, sizeof(G4double));
257  param->SetEdep(anElement);
258 
259  }
260  msh_cursor += msh_currentSize;
261 }
void SetEdep(G4double de)
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
char * msh_cursor
Definition: MarshaledObj.h:113
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void MarshaledExN04CalorimeterHit::unmarshal4 ( )
inline

Definition at line 304 of file MarshaledExN04CalorimeterHit.h.

304  {
305  //declare currentSize to be the size of this field
306  int msh_currentSize = 0;
307  //copy the size of the current field into currentSize
308  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
309  msh_cursor += sizeof(int);
310  //Now copy the setspec here
311  {
312  G4ThreeVector anElement;
313  memcpy(&anElement, msh_cursor, sizeof(G4ThreeVector));
314  param->SetPos(anElement);
315 
316  }
317  msh_cursor += msh_currentSize;
318 }
void SetPos(G4ThreeVector xyz)
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
char * msh_cursor
Definition: MarshaledObj.h:113

Here is the call graph for this function:

Here is the caller graph for this function:

void MarshaledExN04CalorimeterHit::unmarshalTo ( ExN04CalorimeterHit obj)
inline

Definition at line 75 of file MarshaledExN04CalorimeterHit.h.

75  {
76  //We don't want to unmarshal the buffer is empty.
77  if(msh_size <= MSH_HEADER_SIZE) {
78  //This is buggy, we can't always assume that
79  //obj == NULL <==> List is empty.
80  return;
81  } else {
82  this->param = obj;
84  this->msh_isUnmarshalDone = true;
85  unmarshal1();
86  unmarshal2();
87  unmarshal3();
88  unmarshal4();
89  }
90 }
bool msh_isUnmarshalDone
Definition: MarshaledObj.h:119
size_t msh_size
Definition: MarshaledObj.h:110
ShadowedMarshaledExN04CalorimeterHit * Shadowed_param
#define MSH_HEADER_SIZE
Definition: MarshaledObj.h:15

Here is the call graph for this function:

Member Data Documentation

ExN04CalorimeterHit* MarshaledExN04CalorimeterHit::param

Definition at line 24 of file MarshaledExN04CalorimeterHit.h.

ShadowedMarshaledExN04CalorimeterHit* MarshaledExN04CalorimeterHit::Shadowed_param

Definition at line 25 of file MarshaledExN04CalorimeterHit.h.


The documentation for this class was generated from the following file: