6 #ifndef MarshaledG4VHitsCollection_H 7 #define MarshaledG4VHitsCollection_H 15 #include "MarshaledObj.h" 33 msh_isUnmarshalDone =
false;
45 : MarshaledObj(buf, isUnmarshaling) {
46 msh_isUnmarshalDone =
false;
57 if(msh_size <= MSH_HEADER_SIZE) {
64 else if(msh_typechoice == 0){
67 else if(msh_typechoice == 1){
70 else if(msh_typechoice == 2){
75 this->msh_isUnmarshalDone =
true;
85 if(msh_size <= MSH_HEADER_SIZE) {
92 this->msh_isUnmarshalDone =
true;
101 int msh_currentSize = 0;
102 if (isUnmarshaling())
103 throw "Tried to marshal in obj marked isUnmarshaling == true";
112 EXTEND_BUFFER(msh_currentSize +
sizeof(
int) +
sizeof(
int));
114 msh_field_begin = msh_cursor;
117 msh_cursor +=
sizeof(int);
124 EXTEND_BUFFER(var.getBufferSize());
125 msh_currentSize = var.getBufferSize();
126 memcpy(msh_cursor, var.getBuffer(), var.getBufferSize());
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);
154 msh_cursor += msh_currentSize;
159 int msh_currentSize = 0;
160 if (isUnmarshaling())
161 throw "Tried to marshal in obj marked isUnmarshaling == true";
170 EXTEND_BUFFER(msh_currentSize +
sizeof(
int) +
sizeof(
int));
172 msh_field_begin = msh_cursor;
175 msh_cursor +=
sizeof(int);
182 EXTEND_BUFFER(var.getBufferSize());
183 msh_currentSize = var.getBufferSize();
184 memcpy(msh_cursor, var.getBuffer(), var.getBufferSize());
187 msh_cursor += msh_currentSize;
190 tmp = (msh_cursor-msh_field_begin) -
sizeof(
int);
191 memcpy(msh_field_begin, &tmp,
sizeof(
int));
194 msh_size = msh_cursor - msh_buffer;
195 MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
200 int msh_currentSize = 0;
202 memcpy(&msh_currentSize, msh_cursor,
sizeof(
int));
203 msh_cursor +=
sizeof(int);
209 Shadowed_param->
SDname=anElement;
212 msh_cursor += msh_currentSize;
217 int msh_currentSize = 0;
218 if (isUnmarshaling())
219 throw "Tried to marshal in obj marked isUnmarshaling == true";
228 EXTEND_BUFFER(msh_currentSize +
sizeof(
int) +
sizeof(
int));
230 msh_field_begin = msh_cursor;
233 msh_cursor +=
sizeof(int);
238 else if((param->
GetName() ==
"calCollection") ){
241 EXTEND_BUFFER(marChild.getBufferSize());
242 memcpy(msh_cursor,marChild.getBuffer(), marChild.getBufferSize());
243 msh_currentSize = marChild.getBufferSize();
246 else if( (param->
GetName() ==
"muonCollection") ){
249 EXTEND_BUFFER(marChild.getBufferSize());
250 memcpy(msh_cursor,marChild.getBuffer(), marChild.getBufferSize());
251 msh_currentSize = marChild.getBufferSize();
257 EXTEND_BUFFER(marChild.getBufferSize());
258 memcpy(msh_cursor,marChild.getBuffer(), marChild.getBufferSize());
259 msh_currentSize = marChild.getBufferSize();
265 msh_cursor += msh_currentSize;
268 tmp = (msh_cursor-msh_field_begin) -
sizeof(
int);
269 memcpy(msh_field_begin, &tmp,
sizeof(
int));
272 msh_size = msh_cursor - msh_buffer;
273 MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
278 int msh_currentSize = 0;
280 memcpy(&msh_currentSize, msh_cursor,
sizeof(
int));
281 msh_cursor +=
sizeof(int);
285 else if(msh_typechoice == 0){
289 else if(msh_typechoice == 1){
293 else if(msh_typechoice == 2){
299 msh_cursor += msh_currentSize;
MarshaledG4VHitsCollection(void *buf, char isUnmarshaling= 'u')
void unmarshalTo(G4THitsCollection< T > *obj)
void unmarshalTo(G4VHitsCollection *obj)
~MarshaledG4VHitsCollection()
void unmarshalTo(G4String *obj)
MarshaledG4VHitsCollection(G4VHitsCollection *objptr)
G4VHitsCollection * unmarshal()