Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
MarshaledG4String Class Reference

#include <MarshaledG4String.h>

Inheritance diagram for MarshaledG4String:
MarshaledObj MarshaledObj MarshaledObj MarshaledObj

Public Member Functions

 MarshaledG4String (G4String *objptr)
 
 MarshaledG4String (void *buf, char isUnmarshaling= 'u')
 
 ~MarshaledG4String ()
 
G4Stringunmarshal ()
 
void unmarshalTo (G4String *obj)
 
void marshal1 ()
 
void unmarshal1 ()
 
 MarshaledG4String (G4String *objptr)
 
 MarshaledG4String (void *buf, char chIsUnmarshaling= 'u')
 
 ~MarshaledG4String ()
 
G4Stringunmarshal ()
 
void unmarshalTo (G4String *obj)
 
void marshal1 ()
 
void unmarshal1 ()
 
 MarshaledG4String (G4String *objptr)
 
 MarshaledG4String (void *buf, char isUnmarshaling= 'u')
 
 ~MarshaledG4String ()
 
G4Stringunmarshal ()
 
void unmarshalTo (G4String *obj)
 
void marshal1 ()
 
void unmarshal1 ()
 
 MarshaledG4String (G4String *objptr)
 
 MarshaledG4String (void *buf, char chIsUnmarshaling= 'u')
 
 ~MarshaledG4String ()
 
G4Stringunmarshal ()
 
void unmarshalTo (G4String *obj)
 
void marshal1 ()
 
void unmarshal1 ()
 
- Public Member Functions inherited from MarshaledObj
 MarshaledObj ()
 
 MarshaledObj (void *buf, char chIsUnmarshaling)
 
 ~MarshaledObj ()
 
bool isUnmarshaling ()
 
void EXTEND_BUFFER (int size)
 
void resizeBuffer (size_t new_size)
 
int getBufferSize ()
 
char * getBuffer ()
 
void marshalPrimitive (void *p, int size)
 
void unmarshalPrimitive (void *p, int size)
 
 MarshaledObj ()
 
 MarshaledObj (void *buf, char chIsUnmarshaling)
 
 ~MarshaledObj ()
 
bool isUnmarshaling ()
 
void EXTEND_BUFFER (int size)
 
void resizeBuffer (size_t new_size)
 
int getBufferSize ()
 
char * getBuffer ()
 
void marshalPrimitive (void *p, int size)
 
void unmarshalPrimitive (void *p, int size)
 

Data Fields

G4Stringparam
 
ShadowedMarshaledG4StringShadowed_param
 

Additional Inherited Members

- Static Public Member Functions inherited from MarshaledObj
static int ROUND_UP (int x)
 
static int ROUND_UP (int x)
 
- Protected Attributes inherited from MarshaledObj
int msh_typechoice
 
char * msh_buffer
 
char * msh_field_begin
 
size_t msh_size
 
char * msh_cursor
 
size_t msh_extent
 
bool msh_isUnmarshalDone
 

Detailed Description

Definition at line 23 of file ParN02/AnnotatedFiles/MarshaledG4String.h.

Constructor & Destructor Documentation

MarshaledG4String::MarshaledG4String ( G4String objptr)
inline
MarshaledG4String::MarshaledG4String ( void buf,
char  isUnmarshaling = 'u' 
)
inline
MarshaledG4String::~MarshaledG4String ( )
inline

Definition at line 47 of file ParN02/AnnotatedFiles/MarshaledG4String.h.

47  {
48  //if(msh_isUnmarshalDone && this->param != NULL) {
49  //delete this->param;
50  //}
51 }
MarshaledG4String::MarshaledG4String ( G4String objptr)
inline
MarshaledG4String::MarshaledG4String ( void buf,
char  chIsUnmarshaling = 'u' 
)
inline

Definition at line 40 of file ParN02/include/MarshaledG4String.h.

References MarshaledObj::msh_isUnmarshalDone.

41 : MarshaledObj(buf, chIsUnmarshaling) {
42  msh_isUnmarshalDone = false;
43 }
MarshaledG4String::~MarshaledG4String ( )
inline

Definition at line 45 of file ParN02/include/MarshaledG4String.h.

45  {
46  //if(msh_isUnmarshalDone && this->param != NULL) {
47  //delete this->param;
48  //}
49 }
MarshaledG4String::MarshaledG4String ( G4String objptr)
inline
MarshaledG4String::MarshaledG4String ( void buf,
char  isUnmarshaling = 'u' 
)
inline
MarshaledG4String::~MarshaledG4String ( )
inline

Definition at line 47 of file ParN04/AnnotatedFiles/MarshaledG4String.h.

47  {
48  //if(msh_isUnmarshalDone && this->param != NULL) {
49  //delete this->param;
50  //}
51 }
MarshaledG4String::MarshaledG4String ( G4String objptr)
inline
MarshaledG4String::MarshaledG4String ( void buf,
char  chIsUnmarshaling = 'u' 
)
inline

Definition at line 39 of file ParN04/include/MarshaledG4String.h.

References MarshaledObj::msh_isUnmarshalDone.

40 : MarshaledObj(buf, chIsUnmarshaling) {
41  msh_isUnmarshalDone = false;
42 }
MarshaledG4String::~MarshaledG4String ( )
inline

Definition at line 44 of file ParN04/include/MarshaledG4String.h.

44  {
45  //if(msh_isUnmarshalDone && this->param != NULL) {
46  //delete this->param;
47  //}
48 }

Member Function Documentation

void MarshaledG4String::marshal1 ( )
inline

Definition at line 81 of file ParN04/include/MarshaledG4String.h.

References MarshaledObj::EXTEND_BUFFER(), int(), MarshaledObj::isUnmarshaling(), MarshaledObj::msh_buffer, MarshaledObj::msh_cursor, MarshaledObj::msh_field_begin, MSH_SET_TOTALSIZE, MSH_SET_TYPECHOICE, MarshaledObj::msh_size, MarshaledObj::msh_typechoice, and param.

81  {
82  //declare field_size to be the size of this field
83  int msh_currentSize = 0;
84  if (isUnmarshaling())
85  throw "Tried to marshal in obj marked isUnmarshaling == true";
86 
87  //Copy the sizespec into msh_currentSize here:
88  {
89  int size = param->size()+1;
90  while(size%8) size++;
91  msh_currentSize = size;
92  }
93 
94  //Increase the size of buffer if needed
95  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int));
96  // 4 bytes for the total size of field, 4 bytes for the number of
97  // elements in the array (in the case of array marshaling)
98  //Mark the beginning position for this field, will write the total size
99  //of this field here later
101 
102  //Advance cursor of distance = sizeof(int)
103  msh_cursor += sizeof(int);
104 
105  //Now just copy "get" functions here
106  {
107  memcpy(msh_cursor, param->c_str(), param->size());
108  *(msh_cursor+param->size()) = '\0';
109 
110  }
111  //Now advance the cursor
112  msh_cursor += msh_currentSize;
113  //Now set the size of this field
114  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
115  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
116  memcpy(msh_field_begin, &tmp, sizeof(int));
117 
118  //Now set msh_size
121 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
#define MSH_SET_TYPECHOICE(X)
void EXTEND_BUFFER(int size)
#define MSH_SET_TOTALSIZE(X)
void MarshaledG4String::marshal1 ( )
inline

Definition at line 82 of file ParN02/include/MarshaledG4String.h.

References MarshaledObj::EXTEND_BUFFER(), int(), MarshaledObj::isUnmarshaling(), MarshaledObj::msh_buffer, MarshaledObj::msh_cursor, MarshaledObj::msh_field_begin, MSH_SET_TOTALSIZE, MSH_SET_TYPECHOICE, MarshaledObj::msh_size, MarshaledObj::msh_typechoice, and param.

82  {
83  //declare field_size to be the size of this field
84  int msh_currentSize = 0;
85  if (isUnmarshaling())
86  throw "Tried to marshal in obj marked isUnmarshaling == true";
87 
88  //Copy the sizespec into msh_currentSize here:
89  {
90  int size = param->size()+1;
91  while(size%8) size++;
92  msh_currentSize = size;
93  }
94 
95  //Increase the size of buffer if needed
96  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int));
97  // 4 bytes for the total size of field, 4 bytes for the number
98  // of elements in the array (in the case of array marshaling)
99  //Mark the beginning position for this field, will write the total
100  //size of this field here later
102 
103  //Advance cursor of distance = sizeof(int)
104  msh_cursor += sizeof(int);
105 
106  //Now just copy "get" functions here
107  {
108  memcpy(msh_cursor, param->c_str(), param->size());
109  *(msh_cursor+param->size()) = '\0';
110 
111  }
112  //Now advance the cursor
113  msh_cursor += msh_currentSize;
114  //Now set the size of this field
115  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
116  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
117  memcpy(msh_field_begin, &tmp, sizeof(int));
118 
119  //Now set msh_size
122 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
#define MSH_SET_TYPECHOICE(X)
void EXTEND_BUFFER(int size)
#define MSH_SET_TOTALSIZE(X)
void MarshaledG4String::marshal1 ( )
inline

Definition at line 84 of file ParN04/AnnotatedFiles/MarshaledG4String.h.

References MarshaledObj::EXTEND_BUFFER(), int(), MarshaledObj::isUnmarshaling(), MarshaledObj::msh_buffer, MarshaledObj::msh_cursor, MarshaledObj::msh_field_begin, MSH_SET_TOTALSIZE, MSH_SET_TYPECHOICE, MarshaledObj::msh_size, MarshaledObj::msh_typechoice, and param.

84  {
85  //declare field_size to be the size of this field
86  int msh_currentSize = 0;
87  if (isUnmarshaling())
88  throw "Tried to marshal in obj marked isUnmarshaling == true";
89 
90  //Copy the sizespec into msh_currentSize here:
91  {
92  int size = param->size()+1;
93  while(size%8) size++;
94  msh_currentSize = size;
95  }
96 
97  //Increase the size of buffer if needed
98  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int)); // 4 bytes for the total size of field, 4 bytes for the number of elements in the array (in the case of array marshaling)
99  //Mark the beginning position for this field, will write the total size of this field here later
101 
102  //Advance cursor of distance = sizeof(int)
103  msh_cursor += sizeof(int);
104 
105  //Now just copy "get" functions here
106  {
107  memcpy(msh_cursor, param->c_str(), param->size());
108  *(msh_cursor+param->size()) = '\0';
109 
110  }
111  //Now advance the cursor
112  msh_cursor += msh_currentSize;
113  //Now set the size of this field
114  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
115  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
116  memcpy(msh_field_begin, &tmp, sizeof(int));
117 
118  //Now set msh_size
121 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
#define MSH_SET_TYPECHOICE(X)
void EXTEND_BUFFER(int size)
#define MSH_SET_TOTALSIZE(X)
void MarshaledG4String::marshal1 ( )
inline

Definition at line 84 of file ParN02/AnnotatedFiles/MarshaledG4String.h.

References MarshaledObj::EXTEND_BUFFER(), int(), MarshaledObj::isUnmarshaling(), MarshaledObj::msh_buffer, MarshaledObj::msh_cursor, MarshaledObj::msh_field_begin, MSH_SET_TOTALSIZE, MSH_SET_TYPECHOICE, MarshaledObj::msh_size, MarshaledObj::msh_typechoice, and param.

Referenced by MarshaledG4String().

84  {
85  //declare field_size to be the size of this field
86  int msh_currentSize = 0;
87  if (isUnmarshaling())
88  throw "Tried to marshal in obj marked isUnmarshaling == true";
89 
90  //Copy the sizespec into msh_currentSize here:
91  {
92  int size = param->size()+1;
93  while(size%8) size++;
94  msh_currentSize = size;
95  }
96 
97  //Increase the size of buffer if needed
98  EXTEND_BUFFER(msh_currentSize + sizeof(int) + sizeof(int)); // 4 bytes for the total size of field, 4 bytes for the number of elements in the array (in the case of array marshaling)
99  //Mark the beginning position for this field, will write the total size of this field here later
101 
102  //Advance cursor of distance = sizeof(int)
103  msh_cursor += sizeof(int);
104 
105  //Now just copy "get" functions here
106  {
107  memcpy(msh_cursor, param->c_str(), param->size());
108  *(msh_cursor+param->size()) = '\0';
109 
110  }
111  //Now advance the cursor
112  msh_cursor += msh_currentSize;
113  //Now set the size of this field
114  int tmp; //use memcpy instead of *(int*)... =... to prevent bus error
115  tmp = (msh_cursor-msh_field_begin) - sizeof(int);
116  memcpy(msh_field_begin, &tmp, sizeof(int));
117 
118  //Now set msh_size
121 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
#define MSH_SET_TYPECHOICE(X)
void EXTEND_BUFFER(int size)
#define MSH_SET_TOTALSIZE(X)
G4String* MarshaledG4String::unmarshal ( )
inline

Definition at line 50 of file ParN04/include/MarshaledG4String.h.

References MSH_HEADER_SIZE, MarshaledObj::msh_isUnmarshalDone, MarshaledObj::msh_size, param, Shadowed_param, and unmarshal1().

50  {
51  //We don't want to unmarshal the buffer is empty.
52  if(msh_size <= MSH_HEADER_SIZE) {
53  //This is buggy, we can't always assume that
54  //obj == NULL <==> List is empty.
55  return NULL;
56  } else {
57  {
58  param = new G4String();
59  }
61  this->msh_isUnmarshalDone = true;
62  unmarshal1();
63  return this->param;
64  }
65 }
ShadowedMarshaledG4String * Shadowed_param
#define MSH_HEADER_SIZE
G4String* MarshaledG4String::unmarshal ( )
inline

Definition at line 51 of file ParN02/include/MarshaledG4String.h.

References MSH_HEADER_SIZE, MarshaledObj::msh_isUnmarshalDone, MarshaledObj::msh_size, param, Shadowed_param, and unmarshal1().

51  {
52  //We don't want to unmarshal the buffer is empty.
53  if(msh_size <= MSH_HEADER_SIZE) {
54  //This is buggy, we can't always assume that
55  //obj == NULL <==> List is empty.
56  return NULL;
57  } else {
58  {
59  param = new G4String();
60  }
62  this->msh_isUnmarshalDone = true;
63  unmarshal1();
64  return this->param;
65  }
66 }
ShadowedMarshaledG4String * Shadowed_param
#define MSH_HEADER_SIZE
G4String* MarshaledG4String::unmarshal ( )
inline

Definition at line 53 of file ParN04/AnnotatedFiles/MarshaledG4String.h.

References MSH_HEADER_SIZE, MarshaledObj::msh_isUnmarshalDone, MarshaledObj::msh_size, param, Shadowed_param, and unmarshal1().

53  {
54  //We don't want to unmarshal the buffer is empty.
55  if(msh_size <= MSH_HEADER_SIZE) {
56  //This is buggy, we can't always assume that
57  //obj == NULL <==> List is empty.
58  return NULL;
59  } else {
60  {
61  param = new G4String();
62  }
64  this->msh_isUnmarshalDone = true;
65  unmarshal1();
66  return this->param;
67  }
68 }
ShadowedMarshaledG4String * Shadowed_param
#define MSH_HEADER_SIZE
G4String* MarshaledG4String::unmarshal ( )
inline

Definition at line 53 of file ParN02/AnnotatedFiles/MarshaledG4String.h.

References MSH_HEADER_SIZE, MarshaledObj::msh_isUnmarshalDone, MarshaledObj::msh_size, param, Shadowed_param, and unmarshal1().

53  {
54  //We don't want to unmarshal the buffer is empty.
55  if(msh_size <= MSH_HEADER_SIZE) {
56  //This is buggy, we can't always assume that
57  //obj == NULL <==> List is empty.
58  return NULL;
59  } else {
60  {
61  param = new G4String();
62  }
64  this->msh_isUnmarshalDone = true;
65  unmarshal1();
66  return this->param;
67  }
68 }
ShadowedMarshaledG4String * Shadowed_param
#define MSH_HEADER_SIZE
void MarshaledG4String::unmarshal1 ( )
inline

Definition at line 123 of file ParN04/include/MarshaledG4String.h.

References int(), MarshaledObj::msh_cursor, and param.

123  {
124  //declare currentSize to be the size of this field
125  int msh_currentSize = 0;
126  //copy the size of the current field into currentSize
127  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
128  msh_cursor += sizeof(int);
129  //Now copy the setspec here
130  {
131  G4String* sc = new G4String(msh_cursor);
132  memcpy(param, sc, sizeof(G4String));
133 
134  }
135  msh_cursor += msh_currentSize;
136 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
void MarshaledG4String::unmarshal1 ( )
inline

Definition at line 123 of file ParN02/AnnotatedFiles/MarshaledG4String.h.

References int(), MarshaledObj::msh_cursor, and param.

Referenced by unmarshal(), and unmarshalTo().

123  {
124  //declare currentSize to be the size of this field
125  int msh_currentSize = 0;
126  //copy the size of the current field into currentSize
127  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
128  msh_cursor += sizeof(int);
129  //Now copy the setspec here
130  {
131  G4String* s = new G4String(msh_cursor);
132  memcpy(param, s, sizeof(G4String));
133 
134  }
135  msh_cursor += msh_currentSize;
136 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
const XML_Char * s
void MarshaledG4String::unmarshal1 ( )
inline

Definition at line 123 of file ParN04/AnnotatedFiles/MarshaledG4String.h.

References int(), MarshaledObj::msh_cursor, and param.

123  {
124  //declare currentSize to be the size of this field
125  int msh_currentSize = 0;
126  //copy the size of the current field into currentSize
127  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
128  msh_cursor += sizeof(int);
129  //Now copy the setspec here
130  {
131  G4String* s = new G4String(msh_cursor);
132  memcpy(param, s, sizeof(G4String));
133 
134  }
135  msh_cursor += msh_currentSize;
136 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
const XML_Char * s
void MarshaledG4String::unmarshal1 ( )
inline

Definition at line 124 of file ParN02/include/MarshaledG4String.h.

References int(), MarshaledObj::msh_cursor, and param.

124  {
125  //declare currentSize to be the size of this field
126  int msh_currentSize = 0;
127  //copy the size of the current field into currentSize
128  memcpy(&msh_currentSize, msh_cursor, sizeof(int));
129  msh_cursor += sizeof(int);
130  //Now copy the setspec here
131  {
132  G4String* s = new G4String(msh_cursor);
133  memcpy(param, s, sizeof(G4String));
134 
135  }
136  msh_cursor += msh_currentSize;
137 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
const XML_Char * s
void MarshaledG4String::unmarshalTo ( G4String obj)
inline

Definition at line 67 of file ParN04/include/MarshaledG4String.h.

References MSH_HEADER_SIZE, MarshaledObj::msh_isUnmarshalDone, MarshaledObj::msh_size, param, Shadowed_param, and unmarshal1().

67  {
68  //We don't want to unmarshal the buffer is empty.
69  if(msh_size <= MSH_HEADER_SIZE) {
70  //This is buggy, we can't always assume that
71  //obj == NULL <==> List is empty.
72  return;
73  } else {
74  this->param = obj;
76  this->msh_isUnmarshalDone = true;
77  unmarshal1();
78  }
79 }
ShadowedMarshaledG4String * Shadowed_param
#define MSH_HEADER_SIZE
void MarshaledG4String::unmarshalTo ( G4String obj)
inline

Definition at line 68 of file ParN02/include/MarshaledG4String.h.

References MSH_HEADER_SIZE, MarshaledObj::msh_isUnmarshalDone, MarshaledObj::msh_size, param, Shadowed_param, and unmarshal1().

68  {
69  //We don't want to unmarshal the buffer is empty.
70  if(msh_size <= MSH_HEADER_SIZE) {
71  //This is buggy, we can't always assume that
72  //obj == NULL <==> List is empty.
73  return;
74  } else {
75  this->param = obj;
77  this->msh_isUnmarshalDone = true;
78  unmarshal1();
79  }
80 }
ShadowedMarshaledG4String * Shadowed_param
#define MSH_HEADER_SIZE
void MarshaledG4String::unmarshalTo ( G4String obj)
inline

Definition at line 70 of file ParN02/AnnotatedFiles/MarshaledG4String.h.

References MSH_HEADER_SIZE, MarshaledObj::msh_isUnmarshalDone, MarshaledObj::msh_size, param, Shadowed_param, and unmarshal1().

Referenced by MarshaledG4VHitsCollection::unmarshal1(), and MarshaledG4VHitsCollection::unmarshal2().

70  {
71  //We don't want to unmarshal the buffer is empty.
72  if(msh_size <= MSH_HEADER_SIZE) {
73  //This is buggy, we can't always assume that
74  //obj == NULL <==> List is empty.
75  return;
76  } else {
77  this->param = obj;
79  this->msh_isUnmarshalDone = true;
80  unmarshal1();
81  }
82 }
ShadowedMarshaledG4String * Shadowed_param
#define MSH_HEADER_SIZE
void MarshaledG4String::unmarshalTo ( G4String obj)
inline

Definition at line 70 of file ParN04/AnnotatedFiles/MarshaledG4String.h.

References MSH_HEADER_SIZE, MarshaledObj::msh_isUnmarshalDone, MarshaledObj::msh_size, param, Shadowed_param, and unmarshal1().

70  {
71  //We don't want to unmarshal the buffer is empty.
72  if(msh_size <= MSH_HEADER_SIZE) {
73  //This is buggy, we can't always assume that
74  //obj == NULL <==> List is empty.
75  return;
76  } else {
77  this->param = obj;
79  this->msh_isUnmarshalDone = true;
80  unmarshal1();
81  }
82 }
ShadowedMarshaledG4String * Shadowed_param
#define MSH_HEADER_SIZE

Field Documentation

G4String * MarshaledG4String::param
ShadowedMarshaledG4String * MarshaledG4String::Shadowed_param

The documentation for this class was generated from the following file: