6 #ifndef MarshaledG4HitsCollection_H 7 #define MarshaledG4HitsCollection_H 15 #include "MarshaledObj.h" 40 msh_isUnmarshalDone =
false;
50 : MarshaledObj(buf, isUnmarshaling) {
51 msh_isUnmarshalDone =
false;
62 if(msh_size <= MSH_HEADER_SIZE) {
71 this->msh_isUnmarshalDone =
true;
79 if(msh_size <= MSH_HEADER_SIZE) {
86 this->msh_isUnmarshalDone =
true;
93 int msh_currentSize = 0;
95 throw "Tried to marshal in obj marked isUnmarshaling == true";
103 EXTEND_BUFFER(msh_currentSize +
sizeof(
int) +
sizeof(
int));
105 msh_field_begin = msh_cursor;
108 msh_cursor +=
sizeof(int);
115 memcpy( msh_cursor+copy_off, &elementNum,
sizeof(
int));
116 copy_off +=
sizeof(int);
117 for(
int index=0;index<elementNum;index++){
118 ExN02TrackerHit* anElement;
120 MarshaledExN02TrackerHit marEle(anElement);
121 EXTEND_BUFFER(marEle.getBufferSize());
122 memcpy(msh_cursor+copy_off, marEle.getBuffer(), marEle.getBufferSize());
123 copy_off += marEle.getBufferSize();
125 msh_currentSize = copy_off;
129 msh_cursor += msh_currentSize;
132 tmp = (msh_cursor-msh_field_begin) -
sizeof(
int);
133 memcpy(msh_field_begin, &tmp,
sizeof(
int));
136 msh_size = msh_cursor - msh_buffer;
137 MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
142 int msh_currentSize = 0;
144 memcpy(&msh_currentSize, msh_cursor,
sizeof(
int));
145 msh_cursor +=
sizeof(int);
150 memcpy(&elementNum, msh_cursor+copy_off,
sizeof(
int));
151 copy_off +=
sizeof(int);
152 for(
int index=0;index<elementNum;index++){
153 MarshaledExN02TrackerHit marEle(msh_cursor+copy_off);
154 ExN02TrackerHit* anElement = (ExN02TrackerHit* )marEle.unmarshal();
155 copy_off += marEle.getBufferSize();
160 msh_cursor += msh_currentSize;
174 msh_isUnmarshalDone =
false;
175 this->param = objptr;
184 : MarshaledObj(buf, isUnmarshaling) {
185 msh_isUnmarshalDone =
false;
196 if(msh_size <= MSH_HEADER_SIZE) {
205 this->msh_isUnmarshalDone =
true;
213 if(msh_size <= MSH_HEADER_SIZE) {
220 this->msh_isUnmarshalDone =
true;
227 int msh_currentSize = 0;
228 if (isUnmarshaling())
229 throw "Tried to marshal in obj marked isUnmarshaling == true";
238 EXTEND_BUFFER(msh_currentSize +
sizeof(
int) +
sizeof(
int));
240 msh_field_begin = msh_cursor;
243 msh_cursor +=
sizeof(int);
248 EXTEND_BUFFER(marParent.getBufferSize());
249 memcpy(msh_cursor,marParent.getBuffer(), marParent.getBufferSize());
250 msh_currentSize = marParent.getBufferSize();
254 msh_cursor += msh_currentSize;
257 tmp = (msh_cursor-msh_field_begin) -
sizeof(
int);
258 memcpy(msh_field_begin, &tmp,
sizeof(
int));
261 msh_size = msh_cursor - msh_buffer;
262 MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
267 int msh_currentSize = 0;
269 memcpy(&msh_currentSize, msh_cursor,
sizeof(
int));
270 msh_cursor +=
sizeof(int);
277 msh_cursor += msh_currentSize;
G4HitsCollection * unmarshal()
MarshaledG4HitsCollection(G4HitsCollection *objptr)
MarshaledG4HitsCollection(void *buf, char isUnmarshaling= 'u')
ShadowedMarshaledG4HitsCollection * Shadowed_param
void unmarshalTo(G4THitsCollection< T > *obj)
ShadowedMarshaledG4THitsCollection< T > * Shadowed_param
G4THitsCollection< T > * unmarshal()
void unmarshalTo(G4HitsCollection *obj)
MarshaledG4THitsCollection(G4THitsCollection< T > *objptr)
~MarshaledG4HitsCollection()
~MarshaledG4THitsCollection()
G4THitsCollection< T > * param
MarshaledG4THitsCollection(void *buf, char isUnmarshaling= 'u')