| 1 | %{
|
|---|
| 2 | #include <G4THitsCollection.hh>
|
|---|
| 3 | //MSH_include_begin
|
|---|
| 4 | #include "ExN04CalorimeterHit.hh"
|
|---|
| 5 | #include "ExN04MuonHit.hh"
|
|---|
| 6 | #include "ExN04TrackerHit.hh"
|
|---|
| 7 | #include "MarshaledExN04CalorimeterHit.h"
|
|---|
| 8 | #include "MarshaledExN04MuonHit.h"
|
|---|
| 9 | #include "MarshaledExN04TrackerHit.h"
|
|---|
| 10 | //MSH_include_end
|
|---|
| 11 | %}
|
|---|
| 12 |
|
|---|
| 13 | // This file is generated automatically from G4THitsCollection.hh . It is an
|
|---|
| 14 | // intermediate file useful for debugging, but otherwise may be deleted.
|
|---|
| 15 |
|
|---|
| 16 | marshaling class MarshaledG4HitsCollection (G4HitsCollection* param) {
|
|---|
| 17 |
|
|---|
| 18 | void* theCollection;
|
|---|
| 19 | //FIELDMARSHAL:
|
|---|
| 20 | {
|
|---|
| 21 | int copy_off = 0;
|
|---|
| 22 | int $ELE_COUNT;
|
|---|
| 23 |
|
|---|
| 24 | if(dynamic_cast<G4THitsCollection<ExN04CalorimeterHit>*>($THIS)!=NULL)
|
|---|
| 25 | $ELE_COUNT = ((G4THitsCollection<ExN04CalorimeterHit>*)$THIS)->entries();
|
|---|
| 26 | else if(dynamic_cast<G4THitsCollection<ExN04MuonHit>*>($THIS)!=NULL)
|
|---|
| 27 | $ELE_COUNT = ((G4THitsCollection<ExN04MuonHit>*)$THIS)->entries();
|
|---|
| 28 | else
|
|---|
| 29 | $ELE_COUNT = ((G4THitsCollection<ExN04TrackerHit>*)$THIS)->entries();
|
|---|
| 30 |
|
|---|
| 31 | memcpy( $$+copy_off, &$ELE_COUNT,sizeof(int));
|
|---|
| 32 | copy_off += sizeof(int);
|
|---|
| 33 | for(int $ELE_INDEX=0;$ELE_INDEX<$ELE_COUNT;$ELE_INDEX++){
|
|---|
| 34 | if(0){}
|
|---|
| 35 | else if((dynamic_cast<G4THitsCollection<ExN04CalorimeterHit>*>($THIS)!=NULL) ){
|
|---|
| 36 | void* $ELEMENT;
|
|---|
| 37 |
|
|---|
| 38 | if(dynamic_cast<G4THitsCollection<ExN04CalorimeterHit>*>($THIS)!=NULL)
|
|---|
| 39 | $ELEMENT = (*((G4THitsCollection<ExN04CalorimeterHit>*)$THIS))[$ELE_INDEX];
|
|---|
| 40 | else if(dynamic_cast<G4THitsCollection<ExN04MuonHit>*>($THIS)!=NULL)
|
|---|
| 41 | $ELEMENT = (*((G4THitsCollection<ExN04MuonHit>*)$THIS))[$ELE_INDEX];
|
|---|
| 42 | else
|
|---|
| 43 | $ELEMENT = (*((G4THitsCollection<ExN04TrackerHit>*)$THIS))[$ELE_INDEX];
|
|---|
| 44 |
|
|---|
| 45 | MarshaledExN04CalorimeterHit marEle((ExN04CalorimeterHit* )$ELEMENT);
|
|---|
| 46 | EXTEND_BUFFER(marEle.getBufferSize());
|
|---|
| 47 | memcpy($$+copy_off, marEle.getBuffer(), marEle.getBufferSize());
|
|---|
| 48 | copy_off += marEle.getBufferSize();
|
|---|
| 49 | }
|
|---|
| 50 | else if( (dynamic_cast<G4THitsCollection<ExN04MuonHit>*>($THIS)!=NULL) ){
|
|---|
| 51 | void* $ELEMENT;
|
|---|
| 52 |
|
|---|
| 53 | if(dynamic_cast<G4THitsCollection<ExN04CalorimeterHit>*>($THIS)!=NULL)
|
|---|
| 54 | $ELEMENT = (*((G4THitsCollection<ExN04CalorimeterHit>*)$THIS))[$ELE_INDEX];
|
|---|
| 55 | else if(dynamic_cast<G4THitsCollection<ExN04MuonHit>*>($THIS)!=NULL)
|
|---|
| 56 | $ELEMENT = (*((G4THitsCollection<ExN04MuonHit>*)$THIS))[$ELE_INDEX];
|
|---|
| 57 | else
|
|---|
| 58 | $ELEMENT = (*((G4THitsCollection<ExN04TrackerHit>*)$THIS))[$ELE_INDEX];
|
|---|
| 59 |
|
|---|
| 60 | MarshaledExN04MuonHit marEle((ExN04MuonHit* )$ELEMENT);
|
|---|
| 61 | EXTEND_BUFFER(marEle.getBufferSize());
|
|---|
| 62 | memcpy($$+copy_off, marEle.getBuffer(), marEle.getBufferSize());
|
|---|
| 63 | copy_off += marEle.getBufferSize();
|
|---|
| 64 | }
|
|---|
| 65 | else if( true ){
|
|---|
| 66 | void* $ELEMENT;
|
|---|
| 67 |
|
|---|
| 68 | if(dynamic_cast<G4THitsCollection<ExN04CalorimeterHit>*>($THIS)!=NULL)
|
|---|
| 69 | $ELEMENT = (*((G4THitsCollection<ExN04CalorimeterHit>*)$THIS))[$ELE_INDEX];
|
|---|
| 70 | else if(dynamic_cast<G4THitsCollection<ExN04MuonHit>*>($THIS)!=NULL)
|
|---|
| 71 | $ELEMENT = (*((G4THitsCollection<ExN04MuonHit>*)$THIS))[$ELE_INDEX];
|
|---|
| 72 | else
|
|---|
| 73 | $ELEMENT = (*((G4THitsCollection<ExN04TrackerHit>*)$THIS))[$ELE_INDEX];
|
|---|
| 74 |
|
|---|
| 75 | MarshaledExN04TrackerHit marEle((ExN04TrackerHit*)$ELEMENT);
|
|---|
| 76 | EXTEND_BUFFER(marEle.getBufferSize());
|
|---|
| 77 | memcpy($$+copy_off, marEle.getBuffer(), marEle.getBufferSize());
|
|---|
| 78 | copy_off += marEle.getBufferSize();
|
|---|
| 79 | }
|
|---|
| 80 | }
|
|---|
| 81 | $SIZE = copy_off;
|
|---|
| 82 |
|
|---|
| 83 | }
|
|---|
| 84 | //FIELDUNMARSHAL:
|
|---|
| 85 | {
|
|---|
| 86 | if(0){}
|
|---|
| 87 | else if((dynamic_cast<G4THitsCollection<ExN04CalorimeterHit>*>($THIS)!=NULL) ){
|
|---|
| 88 | int copy_off = 0;
|
|---|
| 89 | int $ELE_COUNT;
|
|---|
| 90 | memcpy(&$ELE_COUNT, $$+copy_off, sizeof(int));
|
|---|
| 91 | copy_off += sizeof(int);
|
|---|
| 92 | for(int $ELE_INDEX=0;$ELE_INDEX<$ELE_COUNT;$ELE_INDEX++){
|
|---|
| 93 | MarshaledExN04CalorimeterHit marEle($$+copy_off);
|
|---|
| 94 | ExN04CalorimeterHit* $ELEMENT = (ExN04CalorimeterHit* )marEle.unmarshal();
|
|---|
| 95 | copy_off += marEle.getBufferSize();
|
|---|
| 96 |
|
|---|
| 97 | if(dynamic_cast<G4THitsCollection<ExN04CalorimeterHit>*>($THIS)!=NULL)
|
|---|
| 98 | ((G4THitsCollection<ExN04CalorimeterHit>*)$THIS)->insert((ExN04CalorimeterHit*)$ELEMENT);
|
|---|
| 99 | else if(dynamic_cast<G4THitsCollection<ExN04MuonHit>*>($THIS)!=NULL)
|
|---|
| 100 | ((G4THitsCollection<ExN04MuonHit>*)$THIS)->insert((ExN04MuonHit*)$ELEMENT);
|
|---|
| 101 | else
|
|---|
| 102 | ((G4THitsCollection<ExN04TrackerHit>*)$THIS)->insert((ExN04TrackerHit*)$ELEMENT);
|
|---|
| 103 |
|
|---|
| 104 | }
|
|---|
| 105 | }
|
|---|
| 106 | else if( (dynamic_cast<G4THitsCollection<ExN04MuonHit>*>($THIS)!=NULL) ){
|
|---|
| 107 | int copy_off = 0;
|
|---|
| 108 | int $ELE_COUNT;
|
|---|
| 109 | memcpy(&$ELE_COUNT, $$+copy_off, sizeof(int));
|
|---|
| 110 | copy_off += sizeof(int);
|
|---|
| 111 | for(int $ELE_INDEX=0;$ELE_INDEX<$ELE_COUNT;$ELE_INDEX++){
|
|---|
| 112 | MarshaledExN04MuonHit marEle($$+copy_off);
|
|---|
| 113 | ExN04MuonHit* $ELEMENT = (ExN04MuonHit* )marEle.unmarshal();
|
|---|
| 114 | copy_off += marEle.getBufferSize();
|
|---|
| 115 |
|
|---|
| 116 | if(dynamic_cast<G4THitsCollection<ExN04CalorimeterHit>*>($THIS)!=NULL)
|
|---|
| 117 | ((G4THitsCollection<ExN04CalorimeterHit>*)$THIS)->insert((ExN04CalorimeterHit*)$ELEMENT);
|
|---|
| 118 | else if(dynamic_cast<G4THitsCollection<ExN04MuonHit>*>($THIS)!=NULL)
|
|---|
| 119 | ((G4THitsCollection<ExN04MuonHit>*)$THIS)->insert((ExN04MuonHit*)$ELEMENT);
|
|---|
| 120 | else
|
|---|
| 121 | ((G4THitsCollection<ExN04TrackerHit>*)$THIS)->insert((ExN04TrackerHit*)$ELEMENT);
|
|---|
| 122 |
|
|---|
| 123 | }
|
|---|
| 124 | }
|
|---|
| 125 | else if( true ){
|
|---|
| 126 | int copy_off = 0;
|
|---|
| 127 | int $ELE_COUNT;
|
|---|
| 128 | memcpy(&$ELE_COUNT, $$+copy_off, sizeof(int));
|
|---|
| 129 | copy_off += sizeof(int);
|
|---|
| 130 | for(int $ELE_INDEX=0;$ELE_INDEX<$ELE_COUNT;$ELE_INDEX++){
|
|---|
| 131 | MarshaledExN04TrackerHit marEle($$+copy_off);
|
|---|
| 132 | ExN04TrackerHit* $ELEMENT = (ExN04TrackerHit*)marEle.unmarshal();
|
|---|
| 133 | copy_off += marEle.getBufferSize();
|
|---|
| 134 |
|
|---|
| 135 | if(dynamic_cast<G4THitsCollection<ExN04CalorimeterHit>*>($THIS)!=NULL)
|
|---|
| 136 | ((G4THitsCollection<ExN04CalorimeterHit>*)$THIS)->insert((ExN04CalorimeterHit*)$ELEMENT);
|
|---|
| 137 | else if(dynamic_cast<G4THitsCollection<ExN04MuonHit>*>($THIS)!=NULL)
|
|---|
| 138 | ((G4THitsCollection<ExN04MuonHit>*)$THIS)->insert((ExN04MuonHit*)$ELEMENT);
|
|---|
| 139 | else
|
|---|
| 140 | ((G4THitsCollection<ExN04TrackerHit>*)$THIS)->insert((ExN04TrackerHit*)$ELEMENT);
|
|---|
| 141 |
|
|---|
| 142 | }
|
|---|
| 143 | }
|
|---|
| 144 |
|
|---|
| 145 | }
|
|---|
| 146 | //FIELDSIZE:
|
|---|
| 147 | {
|
|---|
| 148 |
|
|---|
| 149 | }
|
|---|
| 150 | unmarshaling constructor {
|
|---|
| 151 | $THIS = new G4HitsCollection();
|
|---|
| 152 | }
|
|---|
| 153 | }
|
|---|
| 154 |
|
|---|
| 155 | template <class T> marshaling class MarshaledG4THitsCollection<T> (G4THitsCollection<T>* param) : public G4HitsCollection {
|
|---|
| 156 | int __dummy812; // marshaling code for MSH_superclass
|
|---|
| 157 | //FIELDMARSHAL:
|
|---|
| 158 | {
|
|---|
| 159 | MarshaledG4HitsCollection marParent($THIS);
|
|---|
| 160 | EXTEND_BUFFER(marParent.getBufferSize());
|
|---|
| 161 | memcpy($$,marParent.getBuffer(), marParent.getBufferSize());
|
|---|
| 162 | $SIZE = marParent.getBufferSize();
|
|---|
| 163 |
|
|---|
| 164 | }
|
|---|
| 165 | //FIELD UNMARSHAL:
|
|---|
| 166 | {
|
|---|
| 167 | MarshaledG4HitsCollection marObj($$);
|
|---|
| 168 | marObj.unmarshalTo($THIS);
|
|---|
| 169 |
|
|---|
| 170 | }
|
|---|
| 171 | //FIELD SIZE :
|
|---|
| 172 | {
|
|---|
| 173 | //code for size, just dummy code because the size will be set correctly at the end of marshaling code
|
|---|
| 174 |
|
|---|
| 175 | }
|
|---|
| 176 | unmarshaling constructor {
|
|---|
| 177 | $THIS = new G4THitsCollection<T>();
|
|---|
| 178 | }
|
|---|
| 179 | }
|
|---|
| 180 |
|
|---|