TSchemaRuleSet.h

Go to the documentation of this file.
00001 // @(#)root/core:$Id: TSchemaRuleSet.h 32644 2010-03-17 13:58:28Z pcanal $
00002 // author: Lukasz Janyst <ljanyst@cern.ch>
00003 
00004 #ifndef ROOT_TSchemaRuleSet
00005 #define ROOT_TSchemaRuleSet
00006 
00007 class TClass;
00008 
00009 #include "TObject.h"
00010 #include "TObjArray.h"
00011 #include "Rtypes.h"
00012 #include "TString.h"
00013 #include "TClassRef.h"
00014 
00015 namespace ROOT {
00016 
00017    class TSchemaRule;
00018 
00019    class TSchemaMatch: public TObjArray
00020    {
00021       public:
00022          virtual ~TSchemaMatch() {};
00023          const TSchemaRule* GetRuleWithSource( const TString& name ) const;
00024          const TSchemaRule* GetRuleWithTarget( const TString& name ) const;
00025                Bool_t       HasRuleWithSource( const TString& name, Bool_t needingAlloc ) const;
00026                Bool_t       HasRuleWithTarget( const TString& name, Bool_t willset ) const;
00027       ClassDef(TSchemaMatch,0);
00028    };
00029 
00030    class TSchemaRuleSet: public TObject
00031    {
00032       public:
00033       
00034          enum EConsistencyCheck {
00035             kNoCheck       = 0,
00036             kCheckAll      = 1, 
00037             kCheckConflict = 2
00038          };
00039 
00040          TSchemaRuleSet();
00041          virtual ~TSchemaRuleSet();
00042 
00043          Bool_t              AddRule( TSchemaRule* rule, EConsistencyCheck checkConsistency = kCheckAll );
00044          Bool_t              AddRules( TSchemaRuleSet* rules, EConsistencyCheck checkConsistency = kCheckAll );
00045          Bool_t              HasRuleWithSourceClass( const TString &source) const;
00046          const TObjArray*    FindRules( const TString &source ) const;
00047          const TSchemaMatch* FindRules( const TString &source, Int_t version ) const;
00048          const TSchemaMatch* FindRules( const TString &source, UInt_t checksum ) const;
00049          const TSchemaMatch* FindRules( const TString &source, Int_t version, UInt_t checksum ) const;
00050          TClass*             GetClass();
00051          UInt_t              GetClassCheckSum() const;
00052          TString             GetClassName() const;
00053          Int_t               GetClassVersion() const;
00054          const TObjArray*    GetRules() const;
00055          const TObjArray*    GetPersistentRules() const;
00056          void                RemoveRule( TSchemaRule* rule );
00057          void                RemoveRules( TObjArray* rules );
00058          void                SetClass( TClass* cls );
00059 
00060          void                ls(Option_t *option="") const;
00061          void                AsString(TString &out) const;
00062 
00063          ClassDef( TSchemaRuleSet, 1 )
00064 
00065       private:
00066          TObjArray*                             fPersistentRules; //  Array of the rules that will be embeded in the file
00067          TObjArray*                             fRemainingRules;  //! Array of non-persisten rules - just for cleanup purposes - owns the elements
00068          TObjArray*                             fAllRules;        //! Array of all rules
00069          TClassRef                              fClass;           //! Target class pointer (for consistency checking)
00070          TString                                fClassName;       //  Target class name
00071          Int_t                                  fVersion;         //  Target class version
00072          UInt_t                                 fCheckSum;        //  Target class checksum
00073    };
00074 
00075 } // End of Namespace ROOT 
00076 
00077 #endif // ROOT_TSchemaRuleSet

Generated on Tue Jul 5 14:11:40 2011 for ROOT_528-00b_version by  doxygen 1.5.1