Ignore:
Timestamp:
04/26/02 12:54:38 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mdata
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mdata/MData.cc

    r1287 r1304  
    2727//   MData
    2828//
     29//   This base class defines an interface to a generalized value.
     30//   This value can be a simple number, it can also be a data member
     31//   of a class or some kind of concatenation of MData objects.
     32//
     33//   A class inheriting from MData must implement:
     34//
     35//    - Double_t GetValue() const
     36//      which return the value corresponding to the object
     37//
     38//    - Bool_t IsValid() const
     39//      should tell whether the object is valid (eg if the object parses
     40//      a string the result might be invalid)
     41//
     42//    - Bool_t PreProcess(const MParList *plist)
     43//      which can be used to get some necessary data (befor processing)
     44//      from the parlist.
     45//
    2946/////////////////////////////////////////////////////////////////////////////
    3047
  • trunk/MagicSoft/Mars/mdata/MData.h

    r1287 r1304  
    44/////////////////////////////////////////////////////////////////////////////
    55//                                                                         //
    6 //  MDataList                                                              //
     6//  MData                                                                  //
    77//                                                                         //
    88/////////////////////////////////////////////////////////////////////////////
     
    1818public:
    1919    virtual Double_t GetValue() const = 0;
     20    virtual Bool_t IsValid() const = 0;
    2021    virtual Bool_t PreProcess(const MParList *plist) = 0;
    2122
    22     ClassDef(MData, 0) // A Filter for cuts in any data member
     23    ClassDef(MData, 0) // A Base class for a generalized value
    2324};
    2425
  • trunk/MagicSoft/Mars/mdata/MDataChain.cc

    r1299 r1304  
    4848    fTitle = title ? title : rule;
    4949
    50     *fLog << inf << "Trying to resolve rule..." << endl;
     50    *fLog << inf << "Trying to resolve rule... " << flush;
    5151    if (!(fMember=ParseString(rule, 1)))
    5252    {
     
    5454        return;
    5555    }
    56 
    57     *fLog << inf << endl;
    58     *fLog << "Using Filter rule " << fMember->GetName();
    59     *fLog << " for " << fName << ":" << endl;
     56    *fLog << inf << "found: " << flush;
    6057    fMember->Print();
    61     *fLog << endl << endl;
     58    *fLog << endl;
    6259
    6360}
     
    267264    return fMember ? fMember->GetValue() : 0;
    268265}
     266
     267void MDataChain::Print(Option_t *opt = "") const
     268{
     269    fMember->Print();
     270}
  • trunk/MagicSoft/Mars/mdata/MDataChain.h

    r1287 r1304  
    3232    Bool_t IsValid() const { return fMember ? kTRUE : kFALSE; }
    3333
     34    void Print(Option_t *opt = "") const;
     35
    3436    ClassDef(MDataChain, 0) // A Filter for cuts in any data member
    3537};
  • trunk/MagicSoft/Mars/mdata/MDataList.cc

    r1287 r1304  
    158158    fMembers.Add(member);
    159159
    160     *fLog << "Done." << endl;
    161 
    162160    return kTRUE;
    163161}
  • trunk/MagicSoft/Mars/mdata/MDataList.h

    r1287 r1304  
    4040    void SetOwner(Bool_t enable=kTRUE) { enable ? SetBit(kIsOwner) : ResetBit(kIsOwner); }
    4141
     42    Bool_t IsValid() const { return fMembers.GetSize() ? kTRUE : kFALSE; }
     43
    4244    Double_t GetValue() const;
    4345    Bool_t PreProcess(const MParList *plist);
  • trunk/MagicSoft/Mars/mdata/MDataMember.cc

    r1287 r1304  
    2525/////////////////////////////////////////////////////////////////////////////
    2626//
    27 //   MDataList
    28 //   Chain, catenation ?
     27//   MDataMember
     28//
     29//   This objects corresponds to the data member of another object.
     30//   You can either specify the object as a string, eg "MHillas.fWidth"
     31//   where MHillas is the name of the container in the parameterlist
     32//   and fWidth is it's data member, or you can specify it by giving
     33//   the pointer corresponding to the instance of your object and
     34//   a TMethodCall pointer corresponding to the Member function returning
     35//   the requested value.
    2936//
    3037/////////////////////////////////////////////////////////////////////////////
     
    4148ClassImp(MDataMember);
    4249
     50// --------------------------------------------------------------------------
     51//
     52//  obj is a pointer to the instance of your class from which the data
     53//  should be requested. TMethodCall (s. root dox) is a pointer
     54//  to a TMethodCall object which should be the getter function for
     55//  the data you want to get.
     56//
    4357MDataMember::MDataMember(MParContainer *obj, TMethodCall *call)
    4458{
     
    4761}
    4862
     63// --------------------------------------------------------------------------
     64//
     65// returns the value you requested
     66//
    4967Double_t MDataMember::GetValue() const
    5068{
     
    7189}
    7290
     91// --------------------------------------------------------------------------
     92//
     93// If a string was given PreProcess try to resolv the object name and
     94// tries to get it from the parlist. And also tries to resolve
     95// the data member (variable) name you requested and tries to get a
     96// corresponding TMethodCall from the root Dictionary.
     97// Remark: If your Data Member is called fDataMember the corresponding
     98//         getter Method in your class must be calles fDataMember
     99//
    73100Bool_t MDataMember::PreProcess(const MParList *plist)
    74101{
     102    if (fCall)
     103        return kTRUE;
     104
    75105    TString cname(fName);
    76106    TString mname(fName);
     
    98128}
    99129
     130// --------------------------------------------------------------------------
     131//
     132// Print the name of the data member without an CR.
     133//
    100134void MDataMember::Print(Option_t *opt = "") const
    101135{
  • trunk/MagicSoft/Mars/mdata/MDataMember.h

    r1287 r1304  
    2828    Bool_t PreProcess(const MParList *plist);
    2929
     30    Bool_t IsValid() const { return fCall ? kTRUE : kFALSE; }
     31
    3032    void Print(Option_t *opt = "") const;
    3133
  • trunk/MagicSoft/Mars/mdata/MDataValue.cc

    r1287 r1304  
    2626//
    2727//   MDataValue
    28 //   Chain, catenation ?
     28//
     29//   An MData object which corresponds to a simple value like 5.5, or 7.9
    2930//
    3031/////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/mdata/MDataValue.h

    r1287 r1304  
    2525    Bool_t PreProcess(const MParList *plist) { return kTRUE; }
    2626
     27    Bool_t IsValid() const { return kTRUE; }
     28
    2729    void Print(Option_t *opt = "") const;
    2830
Note: See TracChangeset for help on using the changeset viewer.