Changeset 1483 for trunk/MagicSoft/Mars/mbase/MParContainer.cc
- Timestamp:
- 08/05/02 16:12:14 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r1477 r1483 37 37 #include "MParContainer.h" 38 38 39 #include <ctype.h> // isdigit 39 40 #include <fstream.h> // ofstream, AsciiWrite 40 41 … … 139 140 // -------------------------------------------------------------------------- 140 141 // 142 // Return a unique name for this container. It is created from 143 // the container name and the unique Id. (This is mostly used 144 // in the StreamPrimitive member functions) 145 // 146 const TString MParContainer::GetUniqueName() const 147 { 148 TString ret = ToLower(fName); 149 150 if (isdigit(ret[ret.Length()-1])) 151 ret+="_"; 152 153 ret+=GetUniqueID(); 154 155 return ret; 156 } 157 158 // -------------------------------------------------------------------------- 159 // 141 160 // List MParContainer name and title. 142 161 // … … 359 378 void MParContainer::SavePrimitive(ofstream &out, Option_t *o) 360 379 { 380 static UInt_t uid = 0; 381 361 382 if (IsSavedAsPrimitive()) 362 383 return; 363 384 385 SetUniqueID(uid++/*gRandom->Uniform(kMaxInt)*/); 364 386 StreamPrimitive(out); 365 387 SetBit(kIsSavedAsPrimitive); … … 373 395 { 374 396 out << " // Using MParContainer::StreamPrimitive" << endl; 375 out << " " << ClassName() << " " << ToLower(fName) << "(\"";397 out << " " << ClassName() << " " << GetUniqueName() << "(\""; 376 398 out << fName << "\", \"" << fTitle << "\");" << endl; 377 399 }
Note:
See TracChangeset
for help on using the changeset viewer.