6 #ifndef MarshaledG4String_H 7 #define MarshaledG4String_H 15 #include "MarshaledObj.h" 33 msh_isUnmarshalDone =
false;
43 : MarshaledObj(buf, isUnmarshaling) {
44 msh_isUnmarshalDone =
false;
55 if(msh_size <= MSH_HEADER_SIZE) {
64 this->msh_isUnmarshalDone =
true;
72 if(msh_size <= MSH_HEADER_SIZE) {
79 this->msh_isUnmarshalDone =
true;
86 int msh_currentSize = 0;
88 throw "Tried to marshal in obj marked isUnmarshaling == true";
92 int size = param->size()+1;
94 msh_currentSize =
size;
98 EXTEND_BUFFER(msh_currentSize +
sizeof(
int) +
sizeof(
int));
100 msh_field_begin = msh_cursor;
103 msh_cursor +=
sizeof(int);
107 memcpy(msh_cursor, param->c_str(), param->size());
108 *(msh_cursor+param->size()) =
'\0';
112 msh_cursor += msh_currentSize;
115 tmp = (msh_cursor-msh_field_begin) -
sizeof(
int);
116 memcpy(msh_field_begin, &tmp,
sizeof(
int));
119 msh_size = msh_cursor - msh_buffer;
120 MSH_SET_TOTALSIZE(msh_size); MSH_SET_TYPECHOICE(msh_typechoice);
125 int msh_currentSize = 0;
127 memcpy(&msh_currentSize, msh_cursor,
sizeof(
int));
128 msh_cursor +=
sizeof(int);
135 msh_cursor += msh_currentSize;
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
MarshaledG4String(G4String *objptr)
void unmarshalTo(G4String *obj)
MarshaledG4String(void *buf, char isUnmarshaling= 'u')