ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
MarshaledG4VHitsCollection.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file MarshaledG4VHitsCollection.h
1
// This file was generated automatically by marshalgen.
2
3
#ifndef MarshaledG4VHitsCollection_H
4
#define MarshaledG4VHitsCollection_H
5
6
7
#include <G4VHitsCollection.hh>
8
9
10
#include <stdio.h>
11
#include <string.h>
12
#include "
MarshaledObj.h
"
13
14
class
MarshaledG4VHitsCollection
;
15
16
class
ShadowedMarshaledG4VHitsCollection
:
public
G4VHitsCollection
{
17
friend
class
MarshaledG4VHitsCollection
;
18
};
19
20
class
MarshaledG4VHitsCollection
:
public
MarshaledObj
{
21
public
:
22
G4VHitsCollection
*
param
;
23
ShadowedMarshaledG4VHitsCollection
*
Shadowed_param
;
24
public
:
25
26
27
// Function implementations
28
29
MarshaledG4VHitsCollection
(
G4VHitsCollection
* objptr) :
MarshaledObj
() {
30
msh_isUnmarshalDone
=
false
;
31
this->
param
= objptr;
32
this->
Shadowed_param
= (
ShadowedMarshaledG4VHitsCollection
*)this->
param
;
33
if
(objptr == NULL)
34
return
;
35
36
marshal1
();
37
marshal2
();
38
marshal3
();
39
}
40
41
MarshaledG4VHitsCollection
(
void
*buf,
char
chIsUnmarshaling =
'u'
)
42
:
MarshaledObj
(buf, chIsUnmarshaling) {
43
msh_isUnmarshalDone
=
false
;
44
}
45
46
~MarshaledG4VHitsCollection
() {
47
//if(msh_isUnmarshalDone && this->param != NULL) {
48
//delete this->param;
49
//}
50
}
51
52
G4VHitsCollection
*
unmarshal
() {
53
//We don't want to unmarshal the buffer is empty.
54
if
(
msh_size
<=
MSH_HEADER_SIZE
) {
55
//This is buggy, we can't always assume that
56
//obj == NULL <==> List is empty.
57
return
NULL;
58
}
else
{
59
{
60
param
=
new
G4THitsCollection<ExN02TrackerHit>
(
""
,
""
);
61
}
62
this->
Shadowed_param
= (
ShadowedMarshaledG4VHitsCollection
*)this->
param
;
63
this->
msh_isUnmarshalDone
=
true
;
64
unmarshal1
();
65
unmarshal2
();
66
unmarshal3
();
67
return
this->
param
;
68
}
69
}
70
71
void
unmarshalTo
(
G4VHitsCollection
* obj) {
72
//We don't want to unmarshal the buffer is empty.
73
if
(
msh_size
<=
MSH_HEADER_SIZE
) {
74
//This is buggy, we can't always assume that
75
//obj == NULL <==> List is empty.
76
return
;
77
}
else
{
78
this->
param
= obj;
79
this->
Shadowed_param
= (
ShadowedMarshaledG4VHitsCollection
*)this->
param
;
80
this->
msh_isUnmarshalDone
=
true
;
81
unmarshal1
();
82
unmarshal2
();
83
unmarshal3
();
84
}
85
}
86
87
void
marshal1
() {
88
//declare field_size to be the size of this field
89
int
msh_currentSize = 0;
90
if
(
isUnmarshaling
())
91
throw
"Tried to marshal in obj marked isUnmarshaling == true"
;
92
93
//Copy the sizespec into msh_currentSize here:
94
{
95
// no need to declare size since msh_currentSize is already assigned
96
//in the MARSHAL field
97
98
}
99
100
//Increase the size of buffer if needed
101
EXTEND_BUFFER
(msh_currentSize +
sizeof
(
int
) +
sizeof
(
int
));
102
// 4 bytes for the total size of field, 4 bytes for the number
103
// of elements in the array (in the case of array marshaling)
104
//Mark the beginning position for this field, will write the total
105
//size of this field here later
106
msh_field_begin
=
msh_cursor
;
107
108
//Advance cursor of distance = sizeof(int)
109
msh_cursor
+=
sizeof
(
int
);
110
111
//Now just copy "get" functions here
112
{
113
G4String
anElement;
114
anElement =
param
->
GetName
();
115
MarshaledG4String
var(&anElement);
116
EXTEND_BUFFER
(var.
getBufferSize
());
117
msh_currentSize = var.
getBufferSize
();
118
memcpy(
msh_cursor
, var.
getBuffer
(), var.
getBufferSize
());
119
}
120
//Now advance the cursor
121
msh_cursor
+= msh_currentSize;
122
//Now set the size of this field
123
int
tmp
;
//use memcpy instead of *(int*)... =... to prevent bus error
124
tmp = (
msh_cursor
-
msh_field_begin
) -
sizeof
(
int
);
125
memcpy(
msh_field_begin
, &tmp,
sizeof
(
int
));
126
127
//Now set msh_size
128
msh_size
=
msh_cursor
-
msh_buffer
;
129
MSH_SET_TOTALSIZE
(
msh_size
);
MSH_SET_TYPECHOICE
(
msh_typechoice
);
130
}
131
132
void
unmarshal1
() {
133
//declare currentSize to be the size of this field
134
int
msh_currentSize = 0;
135
//copy the size of the current field into currentSize
136
memcpy(&msh_currentSize,
msh_cursor
,
sizeof
(
int
));
137
msh_cursor
+=
sizeof
(
int
);
138
//Now copy the setspec here
139
{
140
MarshaledG4String
var(
msh_cursor
,
'u'
);
141
G4String
anElement;
142
var.
unmarshalTo
(&anElement);
143
Shadowed_param
->
collectionName
=anElement;
144
145
}
146
msh_cursor
+= msh_currentSize;
147
}
148
149
void
marshal2
() {
150
//declare field_size to be the size of this field
151
int
msh_currentSize = 0;
152
if
(
isUnmarshaling
())
153
throw
"Tried to marshal in obj marked isUnmarshaling == true"
;
154
155
//Copy the sizespec into msh_currentSize here:
156
{
157
// no need to declare size since msh_currentSize is already assigned
158
// in the MARSHAL field
159
160
}
161
162
//Increase the size of buffer if needed
163
EXTEND_BUFFER
(msh_currentSize +
sizeof
(
int
) +
sizeof
(
int
));
164
// 4 bytes for the total size of field, 4 bytes for the number
165
// of elements in the array (in the case of array marshaling)
166
//Mark the beginning position for this field, will write the total
167
// size of this field here later
168
msh_field_begin
=
msh_cursor
;
169
170
//Advance cursor of distance = sizeof(int)
171
msh_cursor
+=
sizeof
(
int
);
172
173
//Now just copy "get" functions here
174
{
175
G4String
anElement;
176
anElement =
param
->
GetSDname
();
177
MarshaledG4String
var(&anElement);
178
EXTEND_BUFFER
(var.
getBufferSize
());
179
msh_currentSize = var.
getBufferSize
();
180
memcpy(
msh_cursor
, var.
getBuffer
(), var.
getBufferSize
());
181
}
182
//Now advance the cursor
183
msh_cursor
+= msh_currentSize;
184
//Now set the size of this field
185
int
tmp
;
//use memcpy instead of *(int*)... =... to prevent bus error
186
tmp = (
msh_cursor
-
msh_field_begin
) -
sizeof
(
int
);
187
memcpy(
msh_field_begin
, &tmp,
sizeof
(
int
));
188
189
//Now set msh_size
190
msh_size
=
msh_cursor
-
msh_buffer
;
191
MSH_SET_TOTALSIZE
(
msh_size
);
MSH_SET_TYPECHOICE
(
msh_typechoice
);
192
}
193
194
void
unmarshal2
() {
195
//declare currentSize to be the size of this field
196
int
msh_currentSize = 0;
197
//copy the size of the current field into currentSize
198
memcpy(&msh_currentSize,
msh_cursor
,
sizeof
(
int
));
199
msh_cursor
+=
sizeof
(
int
);
200
//Now copy the setspec here
201
{
202
MarshaledG4String
var(
msh_cursor
,
'u'
);
203
G4String
anElement;
204
var.
unmarshalTo
(&anElement);
205
Shadowed_param
->
SDname
=anElement;
206
207
}
208
msh_cursor
+= msh_currentSize;
209
}
210
211
void
marshal3
() {
212
//declare field_size to be the size of this field
213
int
msh_currentSize = 0;
214
if
(
isUnmarshaling
())
215
throw
"Tried to marshal in obj marked isUnmarshaling == true"
;
216
217
//Copy the sizespec into msh_currentSize here:
218
{
219
//code for size, just dummy code because the size will be
220
//set correctly at the end of marshaling code
221
222
}
223
224
//Increase the size of buffer if needed
225
EXTEND_BUFFER
(msh_currentSize +
sizeof
(
int
) +
sizeof
(
int
));
226
// 4 bytes for the total size of field, 4 bytes for the number of
227
// elements in the array (in the case of array marshaling)
228
//Mark the beginning position for this field, will write the total
229
//size of this field here later
230
msh_field_begin
=
msh_cursor
;
231
232
//Advance cursor of distance = sizeof(int)
233
msh_cursor
+=
sizeof
(
int
);
234
235
//Now just copy "get" functions here
236
{
237
G4THitsCollection<ExN02TrackerHit>
*aObj293 = (
G4THitsCollection<ExN02TrackerHit>
*)
param
;
238
MarshaledG4THitsCollection<ExN02TrackerHit>
marChild(aObj293);
239
EXTEND_BUFFER
(marChild.
getBufferSize
());
240
memcpy(
msh_cursor
,marChild.
getBuffer
(), marChild.
getBufferSize
());
241
msh_currentSize = marChild.
getBufferSize
();
242
msh_typechoice
= 0;
243
244
}
245
//Now advance the cursor
246
msh_cursor
+= msh_currentSize;
247
//Now set the size of this field
248
int
tmp
;
//use memcpy instead of *(int*)... =... to prevent bus error
249
tmp = (
msh_cursor
-
msh_field_begin
) -
sizeof
(
int
);
250
memcpy(
msh_field_begin
, &tmp,
sizeof
(
int
));
251
252
//Now set msh_size
253
msh_size
=
msh_cursor
-
msh_buffer
;
254
MSH_SET_TOTALSIZE
(
msh_size
);
MSH_SET_TYPECHOICE
(
msh_typechoice
);
255
}
256
257
void
unmarshal3
() {
258
//declare currentSize to be the size of this field
259
int
msh_currentSize = 0;
260
//copy the size of the current field into currentSize
261
memcpy(&msh_currentSize,
msh_cursor
,
sizeof
(
int
));
262
msh_cursor
+=
sizeof
(
int
);
263
//Now copy the setspec here
264
{
265
MarshaledG4THitsCollection<ExN02TrackerHit>
marObj(
msh_cursor
);
266
marObj.
unmarshalTo
((
G4THitsCollection<ExN02TrackerHit>
*)
param
);
267
268
}
269
msh_cursor
+= msh_currentSize;
270
}
271
272
};
273
#endif
274
geant4
tree
geant4-10.6-release
examples
extended
parallel
TopC
ParN02
include
MarshaledG4VHitsCollection.h
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:09
using
1.8.2 with
ECCE GitHub integration