Changeset 1218 for trunk/MagicSoft/Mars/mbase/MParContainer.cc
- Timestamp:
- 02/21/02 12:08:03 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r1211 r1218 214 214 // -------------------------------------------------------------------------- 215 215 // 216 // Write out a data member given as a TDataMember object to an output stream. 217 // 218 Bool_t MParContainer::WriteDataMember(ostream &out, TDataMember *member) const 219 { 220 if (!member) 221 return kFALSE; 222 223 if (!member->IsPersistent()) 224 return kFALSE; 225 226 /*const*/ TMethodCall *call = member->GetterMethod(); //FIXME: Root 227 if (!call) 228 return kFALSE; 229 230 switch (call->ReturnType()) 231 { 232 case TMethodCall::kLong: 233 Long_t l; 234 call->Execute((void*)this, l); // FIXME: const, root 235 out << l << " "; 236 return kTRUE; 237 238 case TMethodCall::kDouble: 239 Double_t d; 240 call->Execute((void*)this, d); // FIXME: const, root 241 out << d << " "; 242 return kTRUE; 243 244 case TMethodCall::kOther: 245 /* someone may want to enhance this? */ 246 return kFALSE; 247 } 248 249 return kFALSE; 250 } 251 252 // -------------------------------------------------------------------------- 253 // 254 // Write out a data member given by name to an output stream. 255 // 256 Bool_t MParContainer::WriteDataMember(ostream &out, const char *member) const 257 { 258 return WriteDataMember(out, IsA()->GetDataMember(member)); 259 } 260 261 // -------------------------------------------------------------------------- 262 // 216 263 // If you want to use Ascii-Input/-Output (eg. MWriteAsciiFile) of a 217 264 // container, you may overload this function. If you don't overload it … … 221 268 // floating point (Float_t, Double_t, ...) type are written. 222 269 // 223 void MParContainer::AsciiWrite(o fstream &fout) const270 void MParContainer::AsciiWrite(ostream &out) const 224 271 { 225 272 // *fLog << warn << "To use the the ascii output of " << GetName(); … … 230 277 TIter Next(IsA()->GetListOfDataMembers()); 231 278 while ((data=(TDataMember*)Next())) 232 { 233 if (!data->IsPersistent()) 234 continue; 235 236 /*const*/ TMethodCall *call = data->GetterMethod(); //FIXME: Root 237 if (!call) 238 continue; 239 240 switch (call->ReturnType()) 241 { 242 case TMethodCall::kLong: 243 Long_t l; 244 call->Execute((void*)this, l); // FIXME: const, root 245 fout << l << " "; 246 continue; 247 248 case TMethodCall::kDouble: 249 Double_t d; 250 call->Execute((void*)this, d); // FIXME: const, root 251 fout << d << " "; 252 continue; 253 254 case TMethodCall::kOther: 255 /* someone may want to enhance this? */ 256 continue; 257 } 258 } 259 } 279 WriteDataMember(out, data); 280 }
Note:
See TracChangeset
for help on using the changeset viewer.