Ignore:
Timestamp:
08/12/04 16:41:37 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r4081 r4601  
    569569//          all Mars classes.
    570570//
    571 Bool_t MParContainer::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     571// Return values:
     572//  kTRUE:  Environment string found
     573//  kFALSE: Environment string not found
     574//  kERROR: Error occured, eg. environment invalid
     575//
     576// Overload this if you don't want to control the level of setup-string. In
     577// this case ReadEnv gets called with the different possibilities, see TestEnv.
     578//
     579Int_t MParContainer::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
    572580{
    573581    if (!IsEnvDefined(env, prefix, "", print))
     
    609617}
    610618
     619// --------------------------------------------------------------------------
     620//
     621// Take the prefix and call ReadEnv for:
     622//   prefix.containername
     623//   prefix.classname
     624//   containername
     625//   classname
     626//
     627//  The existance of an environment variable is done in this order. If
     628//  ReadEnv return kTRUE the existance of the container setup is assumed and
     629//  the other tests are skipped. If kFALSE is assumed the sequence is
     630//  continued. In case of kERROR failing of the setup from a file is assumed.
     631//
     632// Overload this if you want to control the handling of level of setup-string
     633// mentioned above. In this case ReadEnv gets never called if you don't call
     634// it explicitly.
     635//
     636Int_t MParContainer::TestEnv(const TEnv &env, TString prefix, Bool_t print)
     637{
     638    if (print)
     639        *fLog << all << "Testing Prefix+ContName: " << prefix+GetName() << endl;
     640    Int_t rc = ReadEnv(env, prefix+GetName(), print);
     641    if (rc==kERROR || rc==kTRUE)
     642        return rc;
     643
     644    // Check For: Job4.MClassName.Varname
     645    if (print)
     646        *fLog << all << "Testing Prefix+ClasName: " << prefix+ClassName() << endl;
     647    rc = ReadEnv(env, prefix+ClassName(), print);
     648    if (rc==kERROR || rc==kTRUE)
     649        return rc;
     650
     651    // Check For: ContainerName.Varname
     652    if (print)
     653        *fLog << all << "Testing ContName: " << GetName() << endl;
     654    rc = ReadEnv(env, GetName(), print);
     655    if (rc==kERROR || rc==kTRUE)
     656        return rc;
     657
     658    // Check For: MClassName.Varname
     659    if (print)
     660        *fLog << all << "Testing ClassName: " << ClassName() << endl;
     661    rc = ReadEnv(env, ClassName(), print);
     662    if (rc==kERROR || rc==kTRUE)
     663        return rc;
     664
     665    // Not found
     666    return kFALSE;
     667}
     668
    611669Bool_t MParContainer::IsEnvDefined(const TEnv &env, TString prefix, TString postfix, Bool_t print) const
    612670{
Note: See TracChangeset for help on using the changeset viewer.