6 #ifndef MarshaledG4HCofThisEvent_H 7 #define MarshaledG4HCofThisEvent_H 12 #include "G4SDManager.hh" 14 #include "ExN02TrackerHit.hh" 15 #include "MarshaledExN02TrackerHit.h" 22 #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++){
119 anElement = param->
GetHC(index);
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++){
155 copy_off += marEle.getBufferSize();
160 msh_cursor += msh_currentSize;
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
void unmarshalTo(G4HCofThisEvent *obj)
G4HCofThisEvent * unmarshal()
G4int GetNumberOfCollections()
G4VHitsCollection * GetHC(G4int i)
~MarshaledG4HCofThisEvent()
MarshaledG4HCofThisEvent(G4HCofThisEvent *objptr)
G4VHitsCollection * unmarshal()
MarshaledG4HCofThisEvent(void *buf, char isUnmarshaling= 'u')
ShadowedMarshaledG4HCofThisEvent * Shadowed_param