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) {
66 this->msh_isUnmarshalDone =
true;
76 if(msh_size <= MSH_HEADER_SIZE) {
83 this->msh_isUnmarshalDone =
true;
92 int msh_currentSize = 0;
94 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 EXTEND_BUFFER(var.getBufferSize());
116 msh_currentSize = var.getBufferSize();
117 memcpy(msh_cursor, var.getBuffer(), var.getBufferSize());
120 msh_cursor += msh_currentSize;
123 tmp = (msh_cursor-msh_field_begin) -
sizeof(
int);
124 memcpy(msh_field_begin, &tmp,
sizeof(
int));
127 msh_size = msh_cursor - msh_buffer;
128 MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
133 int msh_currentSize = 0;
135 memcpy(&msh_currentSize, msh_cursor,
sizeof(
int));
136 msh_cursor +=
sizeof(int);
145 msh_cursor += msh_currentSize;
150 int msh_currentSize = 0;
151 if (isUnmarshaling())
152 throw "Tried to marshal in obj marked isUnmarshaling == true";
161 EXTEND_BUFFER(msh_currentSize +
sizeof(
int) +
sizeof(
int));
163 msh_field_begin = msh_cursor;
166 msh_cursor +=
sizeof(int);
173 EXTEND_BUFFER(var.getBufferSize());
174 msh_currentSize = var.getBufferSize();
175 memcpy(msh_cursor, var.getBuffer(), var.getBufferSize());
178 msh_cursor += msh_currentSize;
181 tmp = (msh_cursor-msh_field_begin) -
sizeof(
int);
182 memcpy(msh_field_begin, &tmp,
sizeof(
int));
185 msh_size = msh_cursor - msh_buffer;
186 MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
191 int msh_currentSize = 0;
193 memcpy(&msh_currentSize, msh_cursor,
sizeof(
int));
194 msh_cursor +=
sizeof(int);
200 Shadowed_param->
SDname=anElement;
203 msh_cursor += msh_currentSize;
208 int msh_currentSize = 0;
209 if (isUnmarshaling())
210 throw "Tried to marshal in obj marked isUnmarshaling == true";
219 EXTEND_BUFFER(msh_currentSize +
sizeof(
int) +
sizeof(
int));
221 msh_field_begin = msh_cursor;
224 msh_cursor +=
sizeof(int);
230 EXTEND_BUFFER(marChild.getBufferSize());
231 memcpy(msh_cursor,marChild.getBuffer(), marChild.getBufferSize());
232 msh_currentSize = marChild.getBufferSize();
237 msh_cursor += msh_currentSize;
240 tmp = (msh_cursor-msh_field_begin) -
sizeof(
int);
241 memcpy(msh_field_begin, &tmp,
sizeof(
int));
244 msh_size = msh_cursor - msh_buffer;
245 MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
250 int msh_currentSize = 0;
252 memcpy(&msh_currentSize, msh_cursor,
sizeof(
int));
253 msh_cursor +=
sizeof(int);
260 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()
G4VHitsCollection * param
ShadowedMarshaledG4VHitsCollection * Shadowed_param