Warning, /include/Geant4/tools/wroot/element is written in an unsupported language. File is not indexed.
0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003
0004 #ifndef tools_wroot_element
0005 #define tools_wroot_element
0006
0007 #include "buffer"
0008 #include "named"
0009 #include "../snpf"
0010
0011 namespace tools {
0012 namespace wroot {
0013
0014 namespace streamer__info {
0015
0016 enum Type { // sizeof :
0017 BASE = 0, // x
0018 ARRAY = 20, // ?
0019 POINTER = 40, // 4
0020 POINTER_INT = 43, // 4
0021 POINTER_FLOAT = 45, // 4
0022 POINTER_DOUBLE = 48, // 4
0023 COUNTER = 6, // 4
0024 CHAR = 1, // 1
0025 SHORT = 2, // 2
0026 INT = 3, // 4
0027 FLOAT = 5, // 4
0028 DOUBLE = 8, // 8
0029 UNSIGNED_CHAR = 11, // 1
0030 UNSIGNED_SHORT = 12, // 2
0031 UNSIGNED_INT = 13, // 4
0032 BOOL = 18, // 1 ?
0033 OBJECT = 61, // ?
0034 OBJECT_ANY = 62, // ?
0035 OBJECT_ARROW = 63, // ?
0036 OBJECT_POINTER = 64, // ?
0037 _TSTRING = 65, // 8 //NOTE : TSTRING clashes with a cpp macro in cfitsio.
0038 TOBJECT = 66, // 12
0039 TNAMED = 67 // 28
0040 };
0041
0042 const int size_FLOAT = 4;
0043 const int size_DOUBLE = 8;
0044 const int size_INT = 4;
0045 const int size_UINT = 4;
0046 const int size_SHORT = 2;
0047 const int size_BOOL = 4; //(Bool_t = 1 + 3 for alignement)
0048 //uuu ? const int size_BOOL = 1;
0049
0050 const int size_TString = 8;
0051 }
0052
0053
0054 class streamer_element : public virtual ibo {
0055 static const std::string& s_class() {
0056 static const std::string s_v("tools::wroot::streamer_element");
0057 return s_v;
0058 }
0059 public: //ibo
0060 virtual const std::string& store_cls() const {
0061 static const std::string s_v("TStreamerElement");
0062 return s_v;
0063 }
0064 virtual bool stream(buffer& aBuffer) const {
0065 unsigned int c;
0066 if(!aBuffer.write_version(2,c)) return false;
0067 if(!Named_stream(aBuffer,fName,fTitle)) return false;
0068 if(!aBuffer.write(fType)) return false;
0069 if(!aBuffer.write(fSize)) return false;
0070 if(!aBuffer.write(fArrayLength)) return false;
0071 if(!aBuffer.write(fArrayDim)) return false;
0072 if(!aBuffer.write_fast_array<int>(fMaxIndex,5)) return false;
0073 if(!aBuffer.write(fTypeName)) return false;
0074 if(!aBuffer.set_byte_count(c)) return false;
0075 return true;
0076 }
0077 public:
0078 virtual streamer_element* copy() const = 0;
0079 public:
0080 virtual void out(std::ostream& aOut) const {
0081 std::string _fname;
0082 fullName(_fname);
0083 char _s[256];
0084 snpf(_s,sizeof(_s)," %-14s%-15s offset=%3d type=%2d %-20s",fTypeName.c_str(),_fname.c_str(),fOffset,fType,fTitle.c_str());
0085 aOut << _s << std::endl;
0086 }
0087 public:
0088 streamer_element(const std::string& aName,const std::string& aTitle,
0089 int aOffset,int aType,const std::string& aTypeName)
0090 :fName(aName),fTitle(aTitle),fType(aType)
0091 ,fSize(0),fArrayLength(0),fArrayDim(0),fOffset(aOffset)
0092 ,fTypeName(aTypeName){
0093 #ifdef TOOLS_MEM
0094 mem::increment(s_class().c_str());
0095 #endif
0096 for(int i=0;i<5;i++) fMaxIndex[i] = 0;
0097 }
0098 virtual ~streamer_element(){
0099 #ifdef TOOLS_MEM
0100 mem::decrement(s_class().c_str());
0101 #endif
0102 }
0103 protected:
0104 streamer_element(const streamer_element& a_from)
0105 :ibo(a_from)
0106 ,fName(a_from.fName),fTitle(a_from.fTitle)
0107 ,fType(a_from.fType),fSize(a_from.fSize)
0108 ,fArrayLength(a_from.fArrayLength)
0109 ,fArrayDim(a_from.fArrayDim),fOffset(a_from.fOffset)
0110 ,fTypeName(a_from.fTypeName){
0111 #ifdef TOOLS_MEM
0112 mem::increment(s_class().c_str());
0113 #endif
0114 for(int i=0;i<5;i++) fMaxIndex[i] = a_from.fMaxIndex[i];
0115 }
0116 streamer_element& operator=(const streamer_element& a_from){
0117 fName = a_from.fName;
0118 fTitle = a_from.fTitle;
0119 fType = a_from.fType;
0120 fSize = a_from.fSize;
0121 fArrayLength = a_from.fArrayLength;
0122 fArrayDim = a_from.fArrayDim;
0123 fOffset = a_from.fOffset;
0124 fTypeName = a_from.fTypeName;
0125 for(int i=0;i<5;i++) fMaxIndex[i] = a_from.fMaxIndex[i];
0126 return *this;
0127 }
0128 public:
0129 virtual void setArrayDimension(int aDimension){
0130 fArrayDim = aDimension;
0131 if(aDimension) fType += streamer__info::ARRAY;
0132 //fNewType = fType;
0133 }
0134 virtual void setMaxIndex(int aDimension,int aMaximum){
0135 //set maximum index for array with dimension dim
0136 if (aDimension < 0 || aDimension > 4) return;
0137 fMaxIndex[aDimension] = aMaximum;
0138 if (fArrayLength == 0) fArrayLength = aMaximum;
0139 else fArrayLength *= aMaximum;
0140 }
0141
0142 virtual void fullName(std::string& a_s) const {
0143 a_s = fName;
0144 for (int i=0;i<fArrayDim;i++) {
0145 char cdim[32];
0146 snpf(cdim,sizeof(cdim),"[%d]",fMaxIndex[i]);
0147 a_s += cdim;
0148 }
0149 }
0150 protected: //Named
0151 std::string fName;
0152 std::string fTitle;
0153 protected:
0154 int fType; //element type
0155 int fSize; //sizeof element
0156 int fArrayLength; //cumulative size of all array dims
0157 int fArrayDim; //number of array dimensions
0158 int fMaxIndex[5]; //Maximum array index for array dimension "dim"
0159 int fOffset; //!element offset in class
0160 //FIXME Int_t fNewType; //!new element type when reading
0161 std::string fTypeName; //Data type name of data member
0162 };
0163
0164 class streamer_base : public streamer_element {
0165 public: //ibo
0166 virtual const std::string& store_cls() const {
0167 static const std::string s_v("TStreamerBase");
0168 return s_v;
0169 }
0170 virtual bool stream(buffer& aBuffer) const {
0171 unsigned int c;
0172 if(!aBuffer.write_version(3,c)) return false;
0173 if(!streamer_element::stream(aBuffer)) return false;
0174 if(!aBuffer.write(fBaseVersion)) return false;
0175 if(!aBuffer.set_byte_count(c)) return false;
0176 return true;
0177 }
0178 public: //streamer_element
0179 virtual streamer_element* copy() const {return new streamer_base(*this);}
0180 public:
0181 streamer_base(const std::string& aName,const std::string& aTitle,int aOffset,int aBaseVersion)
0182 :streamer_element(aName,aTitle,aOffset,streamer__info::BASE,"BASE")
0183 ,fBaseVersion(aBaseVersion)
0184 {
0185 if (aName=="TObject") fType = streamer__info::TOBJECT;
0186 if (aName=="TNamed") fType = streamer__info::TNAMED;
0187 }
0188 virtual ~streamer_base(){}
0189 public:
0190 streamer_base(const streamer_base& a_from)
0191 :ibo(a_from)
0192 ,streamer_element(a_from)
0193 ,fBaseVersion(a_from.fBaseVersion)
0194 {}
0195 streamer_base& operator=(const streamer_base& a_from){
0196 streamer_element::operator=(a_from);
0197 fBaseVersion = a_from.fBaseVersion;
0198 return *this;
0199 }
0200 protected:
0201 int fBaseVersion; //version number of the base class
0202 };
0203
0204 class streamer_basic_type : public streamer_element {
0205 public: //ibo
0206 virtual const std::string& store_cls() const {
0207 static const std::string s_v("TStreamerBasicType");
0208 return s_v;
0209 }
0210 virtual bool stream(buffer& aBuffer) const {
0211 unsigned int c;
0212 if(!aBuffer.write_version(2,c)) return false;
0213 if(!streamer_element::stream(aBuffer)) return false;
0214 if(!aBuffer.set_byte_count(c)) return false;
0215 return true;
0216 }
0217 public: //streamer_element
0218 virtual streamer_element* copy() const {return new streamer_basic_type(*this);}
0219 public:
0220 streamer_basic_type(const std::string& aName,const std::string& aTitle,
0221 int aOffset,int aType,const std::string& aTypeName)
0222 :streamer_element(aName,aTitle,aOffset,aType,aTypeName)
0223 {}
0224 virtual ~streamer_basic_type(){}
0225 public:
0226 streamer_basic_type(const streamer_basic_type& a_from)
0227 :ibo(a_from),streamer_element(a_from)
0228 {}
0229 streamer_basic_type& operator=(const streamer_basic_type& a_from){
0230 streamer_element::operator=(a_from);
0231 return *this;
0232 }
0233 };
0234
0235 class streamer_short : public streamer_basic_type {
0236 public: //streamer_element
0237 virtual streamer_element* copy() const {return new streamer_short(*this);}
0238 public:
0239 streamer_short(const std::string& aName,const std::string& aTitle,int aOffset)
0240 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::SHORT,"Short_t")
0241 {}
0242 streamer_short(int& aOffset,const std::string& aName,const std::string& aTitle)
0243 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::SHORT,"Short_t")
0244 {
0245 aOffset += streamer__info::size_SHORT;
0246 }
0247 virtual ~streamer_short(){}
0248 public:
0249 streamer_short(const streamer_short& a_from):ibo(a_from),streamer_basic_type(a_from){}
0250 streamer_short& operator=(const streamer_short& a_from){streamer_basic_type::operator=(a_from);return *this;}
0251 };
0252
0253 class streamer_int : public streamer_basic_type {
0254 public: //streamer_element
0255 virtual streamer_element* copy() const {return new streamer_int(*this);}
0256 public:
0257 streamer_int(const std::string& aName,const std::string& aTitle,int aOffset)
0258 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::INT,"Int_t")
0259 {}
0260 streamer_int(int& aOffset,const std::string& aName,const std::string& aTitle)
0261 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::INT,"Int_t")
0262 {
0263 aOffset += streamer__info::size_INT;
0264 }
0265 virtual ~streamer_int(){}
0266 public:
0267 streamer_int(const streamer_int& a_from):ibo(a_from),streamer_basic_type(a_from){}
0268 streamer_int& operator=(const streamer_int& a_from){streamer_basic_type::operator=(a_from);return *this;}
0269 };
0270
0271 class streamer_uint : public streamer_basic_type {
0272 public: //streamer_element
0273 virtual streamer_element* copy() const {return new streamer_uint(*this);}
0274 public:
0275 streamer_uint(const std::string& aName,const std::string& aTitle,int aOffset)
0276 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::UNSIGNED_INT,"UInt_t")
0277 {}
0278 streamer_uint(int& aOffset,const std::string& aName,const std::string& aTitle)
0279 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::UNSIGNED_INT,"UInt_t")
0280 {
0281 aOffset += streamer__info::size_UINT;
0282 }
0283 virtual ~streamer_uint(){}
0284 public:
0285 streamer_uint(const streamer_uint& a_from):ibo(a_from),streamer_basic_type(a_from){}
0286 streamer_uint& operator=(const streamer_uint& a_from){streamer_basic_type::operator=(a_from);return *this;}
0287 };
0288
0289 class streamer_float : public streamer_basic_type {
0290 public: //streamer_element
0291 virtual streamer_element* copy() const {return new streamer_float(*this);}
0292 public:
0293 streamer_float(const std::string& aName,const std::string& aTitle,int aOffset)
0294 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::FLOAT,"Float_t")
0295 {}
0296 streamer_float(int& aOffset,const std::string& aName,const std::string& aTitle)
0297 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::FLOAT,"Float_t")
0298 {
0299 aOffset += streamer__info::size_FLOAT;
0300 }
0301 virtual ~streamer_float(){}
0302 public:
0303 streamer_float(const streamer_float& a_from):ibo(a_from),streamer_basic_type(a_from){}
0304 streamer_float& operator=(const streamer_float& a_from){streamer_basic_type::operator=(a_from);return *this;}
0305 };
0306
0307 class streamer_double : public streamer_basic_type {
0308 public: //streamer_element
0309 virtual streamer_element* copy() const {return new streamer_double(*this);}
0310 public:
0311 streamer_double(const std::string& aName,const std::string& aTitle,int aOffset)
0312 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::DOUBLE,"Double_t")
0313 {}
0314 streamer_double(int& aOffset,const std::string& aName,const std::string& aTitle)
0315 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::DOUBLE,"Double_t")
0316 {
0317 aOffset += streamer__info::size_DOUBLE;
0318 }
0319 virtual ~streamer_double(){}
0320 public:
0321 streamer_double(const streamer_double& a_from):ibo(a_from),streamer_basic_type(a_from){}
0322 streamer_double& operator=(const streamer_double& a_from){streamer_basic_type::operator=(a_from);return *this;}
0323 };
0324
0325 class streamer_stat_t : public streamer_basic_type {
0326 public: //streamer_element
0327 virtual streamer_element* copy() const {return new streamer_stat_t(*this);}
0328 public:
0329 streamer_stat_t(const std::string& aName,const std::string& aTitle,int aOffset)
0330 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::DOUBLE,"Stat_t")
0331 {}
0332 streamer_stat_t(int& aOffset,const std::string& aName,const std::string& aTitle)
0333 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::DOUBLE,"Stat_t")
0334 {
0335 aOffset += streamer__info::size_DOUBLE;
0336 }
0337 virtual ~streamer_stat_t(){}
0338 public:
0339 streamer_stat_t(const streamer_stat_t& a_from):ibo(a_from),streamer_basic_type(a_from){}
0340 streamer_stat_t& operator=(const streamer_stat_t& a_from){streamer_basic_type::operator=(a_from);return *this;}
0341 };
0342
0343 class streamer_bool : public streamer_basic_type {
0344 public: //streamer_element
0345 virtual streamer_element* copy() const {return new streamer_bool(*this);}
0346 public:
0347 streamer_bool(const std::string& aName,const std::string& aTitle,int aOffset)
0348 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::UNSIGNED_CHAR,"Bool_t")
0349 {}
0350 streamer_bool(int& aOffset,const std::string& aName,const std::string& aTitle)
0351 :streamer_basic_type(aName,aTitle,aOffset,streamer__info::UNSIGNED_CHAR,"Bool_t")
0352 {
0353 aOffset += streamer__info::size_BOOL;
0354 }
0355 virtual ~streamer_bool(){}
0356 public:
0357 streamer_bool(const streamer_bool& a_from):ibo(a_from),streamer_basic_type(a_from){}
0358 streamer_bool& operator=(const streamer_bool& a_from){streamer_basic_type::operator=(a_from);return *this;}
0359 };
0360
0361 class streamer_basic_pointer : public streamer_element {
0362 public: //ibo
0363 virtual const std::string& store_cls() const {
0364 static const std::string s_v("TStreamerBasicPointer");
0365 return s_v;
0366 }
0367 virtual bool stream(buffer& aBuffer) const {
0368 unsigned int c;
0369 if(!aBuffer.write_version(2,c)) return false;
0370 if(!streamer_element::stream(aBuffer)) return false;
0371 if(!aBuffer.write(fCountVersion)) return false;
0372 if(!aBuffer.write(fCountName)) return false;
0373 if(!aBuffer.write(fCountClass)) return false;
0374 if(!aBuffer.set_byte_count(c)) return false;
0375 return true;
0376 }
0377 public: //streamer_element
0378 virtual streamer_element* copy() const {return new streamer_basic_pointer(*this);}
0379 public:
0380 streamer_basic_pointer(const std::string& aName,const std::string& aTitle,
0381 int aOffset,int aType,
0382 const std::string& aCountName,
0383 const std::string& aCountClass,
0384 int aCountVersion,
0385 const std::string& aTypeName)
0386 :streamer_element(aName,aTitle,aOffset,aType+streamer__info::POINTER,aTypeName)
0387 ,fCountVersion(aCountVersion)
0388 ,fCountName(aCountName)
0389 ,fCountClass(aCountClass)
0390 {}
0391 virtual ~streamer_basic_pointer(){}
0392 public:
0393 streamer_basic_pointer(const streamer_basic_pointer& a_from)
0394 :ibo(a_from),streamer_element(a_from)
0395 ,fCountVersion(a_from.fCountVersion)
0396 ,fCountName(a_from.fCountName)
0397 ,fCountClass(a_from.fCountClass)
0398 {}
0399 streamer_basic_pointer& operator=(const streamer_basic_pointer& a_from){
0400 streamer_element::operator=(a_from);
0401 fCountVersion = a_from.fCountVersion;
0402 fCountName = a_from.fCountName;
0403 fCountClass = a_from.fCountClass;
0404 return *this;
0405 }
0406 protected:
0407 int fCountVersion; //version number of the class with the counter
0408 std::string fCountName; //name of data member holding the array count
0409 std::string fCountClass; //name of the class with the counter
0410 };
0411
0412 class streamer_string : public streamer_element {
0413 public: //ibo
0414 virtual const std::string& store_cls() const {
0415 static const std::string s_v("TStreamerString");
0416 return s_v;
0417 }
0418 virtual bool stream(buffer& aBuffer) const {
0419 unsigned int c;
0420 if(!aBuffer.write_version(2,c)) return false;
0421 if(!streamer_element::stream(aBuffer)) return false;
0422 if(!aBuffer.set_byte_count(c)) return false;
0423 return true;
0424 }
0425 public: //streamer_element
0426 virtual streamer_element* copy() const {return new streamer_string(*this);}
0427 public:
0428 streamer_string(const std::string& aName,const std::string& aTitle,int aOffset)
0429 :streamer_element(aName,aTitle,aOffset,streamer__info::_TSTRING,"TString")
0430 {}
0431 streamer_string(int& aOffset,const std::string& aName,const std::string& aTitle)
0432 :streamer_element(aName,aTitle,aOffset,streamer__info::_TSTRING,"TString")
0433 {
0434 aOffset += streamer__info::size_TString;
0435 }
0436 virtual ~streamer_string(){}
0437 public:
0438 streamer_string(const streamer_string& a_from):ibo(a_from),streamer_element(a_from){}
0439 streamer_string& operator=(const streamer_string& a_from){streamer_element::operator=(a_from);return *this;}
0440 };
0441
0442
0443 class streamer_object : public streamer_element {
0444 public: //ibo
0445 virtual const std::string& store_cls() const {
0446 static const std::string s_v("TStreamerObject");
0447 return s_v;
0448 }
0449 virtual bool stream(buffer& aBuffer) const {
0450 unsigned int c;
0451 if(!aBuffer.write_version(2,c)) return false;
0452 if(!streamer_element::stream(aBuffer)) return false;
0453 if(!aBuffer.set_byte_count(c)) return false;
0454 return true;
0455 }
0456 public: //streamer_element
0457 virtual streamer_element* copy() const {return new streamer_object(*this);}
0458 public:
0459 streamer_object(const std::string& aName,const std::string& aTitle,int aOffset,const std::string& aTypeName)
0460 :streamer_element(aName,aTitle,aOffset,0,aTypeName){
0461 fType = streamer__info::OBJECT;
0462 if (aName=="TObject") fType = streamer__info::TOBJECT;
0463 if (aName=="TNamed") fType = streamer__info::TNAMED;
0464 }
0465 virtual ~streamer_object(){}
0466 public:
0467 streamer_object(const streamer_object& a_from):ibo(a_from),streamer_element(a_from){}
0468 streamer_object& operator=(const streamer_object& a_from){
0469 streamer_element::operator=(a_from);
0470 return *this;
0471 }
0472 };
0473
0474 class streamer_object_pointer : public streamer_element {
0475 public: //ibo
0476 virtual const std::string& store_cls() const {
0477 static const std::string s_v("TStreamerObjectPointer");
0478 return s_v;
0479 }
0480 virtual bool stream(buffer& aBuffer) const {
0481 unsigned int c;
0482 if(!aBuffer.write_version(2,c)) return false;
0483 if(!streamer_element::stream(aBuffer)) return false;
0484 if(!aBuffer.set_byte_count(c)) return false;
0485 return true;
0486 }
0487 public: //streamer_element
0488 virtual streamer_element* copy() const {return new streamer_object_pointer(*this);}
0489 public:
0490 streamer_object_pointer(const std::string& aName,const std::string& aTitle,
0491 int aOffset,const std::string& aTypeName)
0492 :streamer_element(aName,aTitle,aOffset,streamer__info::OBJECT_POINTER,aTypeName){
0493 if(aTitle.substr(0,2)=="->") fType = streamer__info::OBJECT_ARROW;
0494 }
0495 virtual ~streamer_object_pointer(){}
0496 public:
0497 streamer_object_pointer(const streamer_object_pointer& a_from):ibo(a_from),streamer_element(a_from){}
0498 streamer_object_pointer& operator=(const streamer_object_pointer& a_from){
0499 streamer_element::operator=(a_from);
0500 return *this;
0501 }
0502 };
0503
0504 class streamer_object_any : public streamer_element {
0505 public: //ibo
0506 virtual const std::string& store_cls() const {
0507 static const std::string s_v("TStreamerObjectAny");
0508 return s_v;
0509 }
0510 virtual bool stream(buffer& aBuffer) const {
0511 unsigned int c;
0512 if(!aBuffer.write_version(2,c)) return false;
0513 if(!streamer_element::stream(aBuffer)) return false;
0514 if(!aBuffer.set_byte_count(c)) return false;
0515 return true;
0516 }
0517 public: //streamer_element
0518 virtual streamer_element* copy() const {return new streamer_object_any(*this);}
0519 public:
0520 streamer_object_any(const std::string& aName,const std::string& aTitle,
0521 int aOffset,const std::string& aTypeName)
0522 :streamer_element(aName,aTitle,aOffset,streamer__info::OBJECT_ANY,aTypeName)
0523 {}
0524 virtual ~streamer_object_any(){}
0525 public:
0526 streamer_object_any(const streamer_object_any& a_from):ibo(a_from),streamer_element(a_from){}
0527 streamer_object_any& operator=(const streamer_object_any& a_from){
0528 streamer_element::operator=(a_from);
0529 return *this;
0530 }
0531 };
0532
0533
0534 class streamer_STL : public streamer_element {
0535 public: //ibo
0536 virtual const std::string& store_cls() const {
0537 static const std::string s_v("TStreamerSTL");
0538 return s_v;
0539 }
0540 virtual bool stream(buffer& aBuffer) const {
0541 unsigned int c;
0542 if(!aBuffer.write_version(2,c)) return false;
0543 if(!streamer_element::stream(aBuffer)) return false;
0544 if(!aBuffer.write(fSTLtype)) return false;
0545 if(!aBuffer.write(fCtype)) return false;
0546 if(!aBuffer.set_byte_count(c)) return false;
0547 return true;
0548 }
0549 public: //streamer_element
0550 virtual streamer_element* copy() const {return new streamer_STL(*this);}
0551 protected:
0552 enum ESTLtype { kSTL = 300, kSTLstring =365, kSTLvector = 1,
0553 kSTLlist = 2, kSTLdeque = 3, kSTLmap = 4,
0554 kSTLset = 5, kSTLmultimap=6, kSTLmultiset=7};
0555
0556 // Instead of EDataType, we use the streamer__info::Type.
0557 //enum EDataType {
0558 // kChar_t = 1, kUChar_t = 11, kShort_t = 2, kUShort_t = 12,
0559 // kInt_t = 3, kUInt_t = 13, kLong_t = 4, kULong_t = 14,
0560 // kFloat_t = 5, kDouble_t = 8, kchar = 10, kOther_t = -1
0561 //};
0562 public:
0563 streamer_STL(const std::string& aName,const std::string& aTitle,
0564 int aOffset,
0565 streamer__info::Type aType, //Must match TDataType/EDataType
0566 const std::string& aTypeName)
0567 :streamer_element(aName,aTitle,aOffset,kSTL,aTypeName){
0568 fSTLtype = kSTLvector;
0569 fCtype = aType;
0570 }
0571 virtual ~streamer_STL(){}
0572 public:
0573 streamer_STL(const streamer_STL& a_from)
0574 :ibo(a_from),streamer_element(a_from)
0575 ,fSTLtype(a_from.fSTLtype)
0576 ,fCtype(a_from.fCtype)
0577 {}
0578 streamer_STL& operator=(const streamer_STL& a_from){
0579 streamer_element::operator=(a_from);
0580 fSTLtype = a_from.fSTLtype;
0581 fCtype = a_from.fCtype;
0582 return *this;
0583 }
0584 protected:
0585 int fSTLtype; //type of STL vector
0586 int fCtype; //STL contained type
0587 };
0588
0589 }}
0590
0591 #endif