LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
MarshaledG4VHitsCollection Class Reference

#include "MarshaledG4VHitsCollection.h"

Inheritance diagram for MarshaledG4VHitsCollection:

Public Member Functions

 MarshaledG4VHitsCollection (G4VHitsCollection *objptr)
 
 MarshaledG4VHitsCollection (void *buf, char isUnmarshaling= 'u')
 
 ~MarshaledG4VHitsCollection ()
 
G4VHitsCollectionunmarshal ()
 
void unmarshalTo (G4VHitsCollection *obj)
 
void marshal1 ()
 
void unmarshal1 ()
 
void marshal2 ()
 
void unmarshal2 ()
 
void marshal3 ()
 
void unmarshal3 ()
 
 MarshaledG4VHitsCollection (G4VHitsCollection *objptr)
 
 MarshaledG4VHitsCollection (void *buf, char isUnmarshaling= 'u')
 
 ~MarshaledG4VHitsCollection ()
 
G4VHitsCollectionunmarshal ()
 
void unmarshalTo (G4VHitsCollection *obj)
 
void marshal1 ()
 
void unmarshal1 ()
 
void marshal2 ()
 
void unmarshal2 ()
 
void marshal3 ()
 
void unmarshal3 ()
 

Public Attributes

G4VHitsCollectionparam
 
ShadowedMarshaledG4VHitsCollectionShadowed_param
 

Detailed Description

Definition at line 23 of file MarshaledG4VHitsCollection.h.

Constructor & Destructor Documentation

MarshaledG4VHitsCollection::MarshaledG4VHitsCollection ( G4VHitsCollection objptr)
inline

Definition at line 32 of file MarshaledG4VHitsCollection.h.

32  : MarshaledObj() {
33  msh_isUnmarshalDone = false;
34  this->param = objptr;
36  if (objptr == NULL)
37  return;
38 
39  marshal1();
40  marshal2();
41  marshal3();
42 }
ShadowedMarshaledG4VHitsCollection * Shadowed_param
MarshaledG4VHitsCollection::MarshaledG4VHitsCollection ( void *  buf,
char  isUnmarshaling = 'u' 
)
inline

Definition at line 44 of file MarshaledG4VHitsCollection.h.

45 : MarshaledObj(buf, isUnmarshaling) {
46  msh_isUnmarshalDone = false;
47 }
MarshaledG4VHitsCollection::~MarshaledG4VHitsCollection ( )
inline

Definition at line 49 of file MarshaledG4VHitsCollection.h.

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

Definition at line 32 of file MarshaledG4VHitsCollection.h.

32  : MarshaledObj() {
33  msh_isUnmarshalDone = false;
34  this->param = objptr;
36  if (objptr == NULL)
37  return;
38 
39  marshal1();
40  marshal2();
41  marshal3();
42 }
ShadowedMarshaledG4VHitsCollection * Shadowed_param
MarshaledG4VHitsCollection::MarshaledG4VHitsCollection ( void *  buf,
char  isUnmarshaling = 'u' 
)
inline

Definition at line 44 of file MarshaledG4VHitsCollection.h.

45 : MarshaledObj(buf, isUnmarshaling) {
46  msh_isUnmarshalDone = false;
47 }
MarshaledG4VHitsCollection::~MarshaledG4VHitsCollection ( )
inline

Definition at line 49 of file MarshaledG4VHitsCollection.h.

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

Member Function Documentation

void MarshaledG4VHitsCollection::marshal1 ( )
inline

Definition at line 90 of file MarshaledG4VHitsCollection.h.

References G4VHitsCollection::GetName(), and tmp.

90  {
91  //declare field_size to be the size of this field
92  int msh_currentSize = 0;
93  if (isUnmarshaling())
94  throw "Tried to marshal in obj marked isUnmarshaling == true";
95 
96  //Copy the sizespec into msh_currentSize here:
97  {
98  // no need to declare size since msh_currentSize is already assigned in the MARSHAL field
99 
100  }
101 
102  //Increase the size of buffer if needed
103  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int)); // 4 bytes for the total size of field, 4 bytes for the number of elements in the array (in the case of array marshaling)
104  //Mark the beginning position for this field, will write the total size of this field here later
105  msh_field_begin = msh_cursor;
106 
107  //Advance cursor of distance = sizeof(int)
108  msh_cursor += sizeof(int);
109 
110  //Now just copy "get" functions here
111  {
112  G4String anElement;
113  anElement = param->GetName();
114  MarshaledG4String var(&anElement);
115  EXTEND_BUFFER(var.getBufferSize());
116  msh_currentSize = var.getBufferSize();
117  memcpy(msh_cursor, var.getBuffer(), var.getBufferSize());
118  }
119  //Now advance the cursor
120  msh_cursor += msh_currentSize;
121  //Now set the size of this field
122  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
123  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
124  memcpy(msh_field_begin, &tmp, sizeof(int));
125 
126  //Now set msh_size
127  msh_size = msh_cursor - msh_buffer;
128  MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
129 }
Float_t tmp
Definition: plot.C:37
void MarshaledG4VHitsCollection::marshal1 ( )
inline

Definition at line 99 of file MarshaledG4VHitsCollection.h.

References G4VHitsCollection::GetName(), and tmp.

99  {
100  //declare field_size to be the size of this field
101  int msh_currentSize = 0;
102  if (isUnmarshaling())
103  throw "Tried to marshal in obj marked isUnmarshaling == true";
104 
105  //Copy the sizespec into msh_currentSize here:
106  {
107  // no need to declare size since msh_currentSize is already assigned in the MARSHAL field
108 
109  }
110 
111  //Increase the size of buffer if needed
112  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int)); // 4 bytes for the total size of field, 4 bytes for the number of elements in the array (in the case of array marshaling)
113  //Mark the beginning position for this field, will write the total size of this field here later
114  msh_field_begin = msh_cursor;
115 
116  //Advance cursor of distance = sizeof(int)
117  msh_cursor += sizeof(int);
118 
119  //Now just copy "get" functions here
120  {
121  G4String anElement;
122  anElement = param->GetName();
123  MarshaledG4String var(&anElement);
124  EXTEND_BUFFER(var.getBufferSize());
125  msh_currentSize = var.getBufferSize();
126  memcpy(msh_cursor, var.getBuffer(), var.getBufferSize());
127  }
128  //Now advance the cursor
129  msh_cursor += msh_currentSize;
130  //Now set the size of this field
131  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
132  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
133  memcpy(msh_field_begin, &tmp, sizeof(int));
134 
135  //Now set msh_size
136  msh_size = msh_cursor - msh_buffer;
137  MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
138 }
Float_t tmp
Definition: plot.C:37
void MarshaledG4VHitsCollection::marshal2 ( )
inline

Definition at line 148 of file MarshaledG4VHitsCollection.h.

References G4VHitsCollection::GetSDname(), and tmp.

148  {
149  //declare field_size to be the size of this field
150  int msh_currentSize = 0;
151  if (isUnmarshaling())
152  throw "Tried to marshal in obj marked isUnmarshaling == true";
153 
154  //Copy the sizespec into msh_currentSize here:
155  {
156  // no need to declare size since msh_currentSize is already assigned in the MARSHAL field
157 
158  }
159 
160  //Increase the size of buffer if needed
161  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int)); // 4 bytes for the total size of field, 4 bytes for the number of elements in the array (in the case of array marshaling)
162  //Mark the beginning position for this field, will write the total size of this field here later
163  msh_field_begin = msh_cursor;
164 
165  //Advance cursor of distance = sizeof(int)
166  msh_cursor += sizeof(int);
167 
168  //Now just copy "get" functions here
169  {
170  G4String anElement;
171  anElement = param->GetSDname();
172  MarshaledG4String var(&anElement);
173  EXTEND_BUFFER(var.getBufferSize());
174  msh_currentSize = var.getBufferSize();
175  memcpy(msh_cursor, var.getBuffer(), var.getBufferSize());
176  }
177  //Now advance the cursor
178  msh_cursor += msh_currentSize;
179  //Now set the size of this field
180  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
181  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
182  memcpy(msh_field_begin, &tmp, sizeof(int));
183 
184  //Now set msh_size
185  msh_size = msh_cursor - msh_buffer;
186  MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
187 }
Float_t tmp
Definition: plot.C:37
void MarshaledG4VHitsCollection::marshal2 ( )
inline

Definition at line 157 of file MarshaledG4VHitsCollection.h.

References G4VHitsCollection::GetSDname(), and tmp.

157  {
158  //declare field_size to be the size of this field
159  int msh_currentSize = 0;
160  if (isUnmarshaling())
161  throw "Tried to marshal in obj marked isUnmarshaling == true";
162 
163  //Copy the sizespec into msh_currentSize here:
164  {
165  // no need to declare size since msh_currentSize is already assigned in the MARSHAL field
166 
167  }
168 
169  //Increase the size of buffer if needed
170  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int)); // 4 bytes for the total size of field, 4 bytes for the number of elements in the array (in the case of array marshaling)
171  //Mark the beginning position for this field, will write the total size of this field here later
172  msh_field_begin = msh_cursor;
173 
174  //Advance cursor of distance = sizeof(int)
175  msh_cursor += sizeof(int);
176 
177  //Now just copy "get" functions here
178  {
179  G4String anElement;
180  anElement = param->GetSDname();
181  MarshaledG4String var(&anElement);
182  EXTEND_BUFFER(var.getBufferSize());
183  msh_currentSize = var.getBufferSize();
184  memcpy(msh_cursor, var.getBuffer(), var.getBufferSize());
185  }
186  //Now advance the cursor
187  msh_cursor += msh_currentSize;
188  //Now set the size of this field
189  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
190  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
191  memcpy(msh_field_begin, &tmp, sizeof(int));
192 
193  //Now set msh_size
194  msh_size = msh_cursor - msh_buffer;
195  MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
196 }
Float_t tmp
Definition: plot.C:37
void MarshaledG4VHitsCollection::marshal3 ( )
inline

Definition at line 206 of file MarshaledG4VHitsCollection.h.

References tmp.

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  //code for size, just dummy code because the size will be set correctly at the end of marshaling code
215 
216  }
217 
218  //Increase the size of buffer if needed
219  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int)); // 4 bytes for the total size of field, 4 bytes for the number of elements in the array (in the case of array marshaling)
220  //Mark the beginning position for this field, will write the total size of this field here later
221  msh_field_begin = msh_cursor;
222 
223  //Advance cursor of distance = sizeof(int)
224  msh_cursor += sizeof(int);
225 
226  //Now just copy "get" functions here
227  {
230  EXTEND_BUFFER(marChild.getBufferSize());
231  memcpy(msh_cursor,marChild.getBuffer(), marChild.getBufferSize());
232  msh_currentSize = marChild.getBufferSize();
233  msh_typechoice = 0;
234 
235  }
236  //Now advance the cursor
237  msh_cursor += msh_currentSize;
238  //Now set the size of this field
239  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
240  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
241  memcpy(msh_field_begin, &tmp, sizeof(int));
242 
243  //Now set msh_size
244  msh_size = msh_cursor - msh_buffer;
245  MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
246 }
Float_t tmp
Definition: plot.C:37
void MarshaledG4VHitsCollection::marshal3 ( )
inline

Definition at line 215 of file MarshaledG4VHitsCollection.h.

References G4VHitsCollection::GetName(), and tmp.

215  {
216  //declare field_size to be the size of this field
217  int msh_currentSize = 0;
218  if (isUnmarshaling())
219  throw "Tried to marshal in obj marked isUnmarshaling == true";
220 
221  //Copy the sizespec into msh_currentSize here:
222  {
223  //code for size, just dummy code because the size will be set correctly at the end of marshaling code
224 
225  }
226 
227  //Increase the size of buffer if needed
228  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int)); // 4 bytes for the total size of field, 4 bytes for the number of elements in the array (in the case of array marshaling)
229  //Mark the beginning position for this field, will write the total size of this field here later
230  msh_field_begin = msh_cursor;
231 
232  //Advance cursor of distance = sizeof(int)
233  msh_cursor += sizeof(int);
234 
235  //Now just copy "get" functions here
236  {
237  if(0){}
238  else if((param->GetName() == "calCollection") ){
241  EXTEND_BUFFER(marChild.getBufferSize());
242  memcpy(msh_cursor,marChild.getBuffer(), marChild.getBufferSize());
243  msh_currentSize = marChild.getBufferSize();
244  msh_typechoice = 0;
245  }
246  else if( (param->GetName() == "muonCollection") ){
249  EXTEND_BUFFER(marChild.getBufferSize());
250  memcpy(msh_cursor,marChild.getBuffer(), marChild.getBufferSize());
251  msh_currentSize = marChild.getBufferSize();
252  msh_typechoice = 1;
253  }
254  else if( true ){
257  EXTEND_BUFFER(marChild.getBufferSize());
258  memcpy(msh_cursor,marChild.getBuffer(), marChild.getBufferSize());
259  msh_currentSize = marChild.getBufferSize();
260  msh_typechoice = 2;
261  }
262 
263  }
264  //Now advance the cursor
265  msh_cursor += msh_currentSize;
266  //Now set the size of this field
267  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
268  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
269  memcpy(msh_field_begin, &tmp, sizeof(int));
270 
271  //Now set msh_size
272  msh_size = msh_cursor - msh_buffer;
273  MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
274 }
Float_t tmp
Definition: plot.C:37
G4VHitsCollection* MarshaledG4VHitsCollection::unmarshal ( )
inline

Definition at line 55 of file MarshaledG4VHitsCollection.h.

Referenced by MarshaledG4HCofThisEvent::unmarshal1().

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  {
64  }
66  this->msh_isUnmarshalDone = true;
67  unmarshal1();
68  unmarshal2();
69  unmarshal3();
70  return this->param;
71  }
72 }
ShadowedMarshaledG4VHitsCollection * Shadowed_param
G4VHitsCollection* MarshaledG4VHitsCollection::unmarshal ( )
inline

Definition at line 55 of file MarshaledG4VHitsCollection.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  if(0){}
64  else if(msh_typechoice == 0){
66  }
67  else if(msh_typechoice == 1){
69  }
70  else if(msh_typechoice == 2){
72  }
73  }
75  this->msh_isUnmarshalDone = true;
76  unmarshal1();
77  unmarshal2();
78  unmarshal3();
79  return this->param;
80  }
81 }
ShadowedMarshaledG4VHitsCollection * Shadowed_param
void MarshaledG4VHitsCollection::unmarshal1 ( )
inline

Definition at line 131 of file MarshaledG4VHitsCollection.h.

References G4VHitsCollection::collectionName, and MarshaledG4String::unmarshalTo().

131  {
132  //declare currentSize to be the size of this field
133  int msh_currentSize = 0;
134  //copy the size of the current field into currentSize
135  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
136  msh_cursor += sizeof(int);
137  //Now copy the setspec here
138  {
139  MarshaledG4String var(msh_cursor, 'u');
140  G4String anElement;
141  var.unmarshalTo(&anElement);
142  Shadowed_param->collectionName=anElement;
143 
144  }
145  msh_cursor += msh_currentSize;
146 }
ShadowedMarshaledG4VHitsCollection * Shadowed_param
void MarshaledG4VHitsCollection::unmarshal1 ( )
inline

Definition at line 140 of file MarshaledG4VHitsCollection.h.

References G4VHitsCollection::collectionName, and MarshaledG4String::unmarshalTo().

140  {
141  //declare currentSize to be the size of this field
142  int msh_currentSize = 0;
143  //copy the size of the current field into currentSize
144  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
145  msh_cursor += sizeof(int);
146  //Now copy the setspec here
147  {
148  MarshaledG4String var(msh_cursor, 'u');
149  G4String anElement;
150  var.unmarshalTo(&anElement);
151  Shadowed_param->collectionName=anElement;
152 
153  }
154  msh_cursor += msh_currentSize;
155 }
ShadowedMarshaledG4VHitsCollection * Shadowed_param
void MarshaledG4VHitsCollection::unmarshal2 ( )
inline

Definition at line 189 of file MarshaledG4VHitsCollection.h.

References G4VHitsCollection::SDname, and MarshaledG4String::unmarshalTo().

189  {
190  //declare currentSize to be the size of this field
191  int msh_currentSize = 0;
192  //copy the size of the current field into currentSize
193  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
194  msh_cursor += sizeof(int);
195  //Now copy the setspec here
196  {
197  MarshaledG4String var(msh_cursor, 'u');
198  G4String anElement;
199  var.unmarshalTo(&anElement);
200  Shadowed_param->SDname=anElement;
201 
202  }
203  msh_cursor += msh_currentSize;
204 }
ShadowedMarshaledG4VHitsCollection * Shadowed_param
void MarshaledG4VHitsCollection::unmarshal2 ( )
inline

Definition at line 198 of file MarshaledG4VHitsCollection.h.

References G4VHitsCollection::SDname, and MarshaledG4String::unmarshalTo().

198  {
199  //declare currentSize to be the size of this field
200  int msh_currentSize = 0;
201  //copy the size of the current field into currentSize
202  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
203  msh_cursor += sizeof(int);
204  //Now copy the setspec here
205  {
206  MarshaledG4String var(msh_cursor, 'u');
207  G4String anElement;
208  var.unmarshalTo(&anElement);
209  Shadowed_param->SDname=anElement;
210 
211  }
212  msh_cursor += msh_currentSize;
213 }
ShadowedMarshaledG4VHitsCollection * Shadowed_param
void MarshaledG4VHitsCollection::unmarshal3 ( )
inline

Definition at line 248 of file MarshaledG4VHitsCollection.h.

References MarshaledG4THitsCollection< T >::unmarshalTo().

248  {
249  //declare currentSize to be the size of this field
250  int msh_currentSize = 0;
251  //copy the size of the current field into currentSize
252  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
253  msh_cursor += sizeof(int);
254  //Now copy the setspec here
255  {
257  marObj.unmarshalTo((G4THitsCollection<ExN02TrackerHit>*)param);
258 
259  }
260  msh_cursor += msh_currentSize;
261 }
void MarshaledG4VHitsCollection::unmarshal3 ( )
inline

Definition at line 276 of file MarshaledG4VHitsCollection.h.

References MarshaledG4THitsCollection< T >::unmarshalTo().

276  {
277  //declare currentSize to be the size of this field
278  int msh_currentSize = 0;
279  //copy the size of the current field into currentSize
280  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
281  msh_cursor += sizeof(int);
282  //Now copy the setspec here
283  {
284  if(0){}
285  else if(msh_typechoice == 0){
287  marObj.unmarshalTo((G4THitsCollection<ExN04CalorimeterHit>*)param);
288  }
289  else if(msh_typechoice == 1){
290  MarshaledG4THitsCollection<ExN04MuonHit> marObj(msh_cursor);
291  marObj.unmarshalTo((G4THitsCollection<ExN04MuonHit>*)param);
292  }
293  else if(msh_typechoice == 2){
295  marObj.unmarshalTo((G4THitsCollection<ExN04TrackerHit>*)param);
296  }
297 
298  }
299  msh_cursor += msh_currentSize;
300 }
void MarshaledG4VHitsCollection::unmarshalTo ( G4VHitsCollection obj)
inline

Definition at line 74 of file MarshaledG4VHitsCollection.h.

74  {
75  //We don't want to unmarshal the buffer is empty.
76  if(msh_size <= MSH_HEADER_SIZE) {
77  //This is buggy, we can't always assume that
78  //obj == NULL <==> List is empty.
79  return;
80  } else {
81  this->param = obj;
83  this->msh_isUnmarshalDone = true;
84  unmarshal1();
85  unmarshal2();
86  unmarshal3();
87  }
88 }
ShadowedMarshaledG4VHitsCollection * Shadowed_param
void MarshaledG4VHitsCollection::unmarshalTo ( G4VHitsCollection obj)
inline

Definition at line 83 of file MarshaledG4VHitsCollection.h.

83  {
84  //We don't want to unmarshal the buffer is empty.
85  if(msh_size <= MSH_HEADER_SIZE) {
86  //This is buggy, we can't always assume that
87  //obj == NULL <==> List is empty.
88  return;
89  } else {
90  this->param = obj;
92  this->msh_isUnmarshalDone = true;
93  unmarshal1();
94  unmarshal2();
95  unmarshal3();
96  }
97 }
ShadowedMarshaledG4VHitsCollection * Shadowed_param

Member Data Documentation

G4VHitsCollection * MarshaledG4VHitsCollection::param

Definition at line 25 of file MarshaledG4VHitsCollection.h.

ShadowedMarshaledG4VHitsCollection * MarshaledG4VHitsCollection::Shadowed_param

Definition at line 26 of file MarshaledG4VHitsCollection.h.


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