29 fAllRules( nullptr ), fVersion(-3), fCheckSum( 0 )
54 std::cout <<
"TSchemaRuleSet for " <<
fClassName <<
":\n";
58 while ((
object = next())) {
113 bool streamerInfosTest;
122 while( (obj = titer.
Next()) ) {
147 for(
auto r : rules) {
154 *errmsg =
"it conflicts with one of the other rules";
160 *errmsg =
"The existing rule is:\n ";
161 r->AsString(*errmsg,
"s");
162 *errmsg +=
"\nand the ignored rule is:\n ";
203 while( (obj = it.
Next()) ) {
214 if (
src &&
src->GetCollectionProxy() &&
225 if (
src &&
src->GetCollectionProxy() &&
227 TClass *vSourceClass =
src->GetCollectionProxy()->GetValueClass();
240 Error(
"HasRuleWithSourceClass",
"Can not find the TClass for %s when matching with %s\n",source.
Data(),
fClass->
GetName());
246 Error(
"HasRuleWithSourceClass",
"Can not find the StreamerInfo for %s when matching with %s\n",source.
Data(),
fClass->
GetName());
250 Error(
"HasRuleWithSourceClass",
"Can not find the StreamerInfo for target class %s\n",
fClass->
GetName());
253 for(
int i = 0 ; i<2 ; ++i) {
267 }
else if (targetElement->
GetClass()) {
296 while( (obj = it.
Next()) ) {
299 arr.push_back( rule );
311 if (
src &&
src->GetCollectionProxy()) {
335 while( (obj = it.
Next()) ) {
338 arr.push_back( rule );
355 while( (obj = it.
Next()) ) {
358 arr.push_back( rule );
375 while( (obj = it.
Next()) ) {
378 arr.push_back( rule );
447 while( (obj = it.
Next()) ) {
470 for(
auto rule : *this ) {
471 if( rule->HasSource(
name ) )
return rule;
481 for(
auto rule : *this ) {
482 if( rule->HasTarget(
name ) )
return rule;
495 for(
auto rule : *this ) {
496 if( rule->HasSource(
name ) ) {
498 const TObjArray *targets = rule->GetTarget();
507 if (rule->GetReadFunctionPointer() || rule->GetReadRawFunctionPointer()) {
525 for(
auto rule : *
this) {
526 if( rule->HasTarget(
name ) ) {
528 const TObjArray *targets = rule->GetTarget();
532 const TObjArray *sources = rule->GetSource();
541 if (rule->GetReadFunctionPointer() || rule->GetReadRawFunctionPointer()) {
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
R__EXTERN TVirtualMutex * gInterpreterMutex
#define R__LOCKGUARD(mutex)
const TSchemaRule * GetRuleWithSource(const TString &name) const
Return the rule that has 'name' as a source.
Bool_t HasRuleWithSource(const TString &name, Bool_t needingAlloc) const
Return true if the set of rules has at least one rule that has the data member named 'name' as a sour...
Bool_t HasRuleWithTarget(const TString &name, Bool_t willset) const
Return true if the set of rules has at least one rule that has the data member named 'name' as a targ...
const TSchemaRule * GetRuleWithTarget(const TString &name) const
Return the rule that has 'name' as a target.
void Streamer(TBuffer &) override
Stream an object of class ROOT::TSchemaRuleSet.
TObjArray * fRemainingRules
TClassRef fClass
Array of all rules.
TString fClassName
Target class pointer (for consistency checking)
void RemoveRule(TSchemaRule *rule)
Remove given rule from the set - the rule is not being deleted!
const TMatches FindRules(const TString &source) const
Return all the rules that are about the given 'source' class.
const TObjArray * GetPersistentRules() const
Bool_t AddRule(TSchemaRule *rule, EConsistencyCheck checkConsistency=kCheckAll, TString *errmsg=nullptr)
The consistency check always fails if the TClass object was not set! if checkConsistency is: kNoCheck...
void AsString(TString &out) const
Fill the string 'out' with the string representation of the rule.
UInt_t GetClassCheckSum() const
Bool_t AddRules(TSchemaRuleSet *rules, EConsistencyCheck checkConsistency=kCheckAll, TString *errmsg=nullptr)
void ls(Option_t *option="") const override
The ls function lists the contents of a class on stdout.
Int_t GetClassVersion() const
TString GetClassName() const
TObjArray * fAllRules
Array of non-persistent rules - just for cleanup purposes - owns the elements.
void SetClass(TClass *cls)
Set the TClass associated with this rule set.
void RemoveRules(TObjArray *rules)
remove given array of rules from the set - the rules are not being deleted!
TObjArray * fPersistentRules
const TObjArray * GetRules() const
Bool_t HasRuleWithSourceClass(const TString &source) const
Return True if we have any rule whose source class is 'source'.
virtual ~TSchemaRuleSet()
Destructor.
TSchemaRuleSet()
Default constructor.
void AsString(TString &out, const char *options="") const
Add to the string 'out' the string representation of the rule.
Bool_t TestVersion(Int_t version) const
Check if given version number is defined in this rule.
const TObjArray * GetTarget() const
Get the target data members of this rule (i.e. the in memory data member).
Bool_t Conflicts(const TSchemaRule *rule) const
Check if this rule conflicts with the given one.
void SetTargetClass(const TString &classname)
Set the target class of this rule (i.e. the in memory class).
const char * GetSourceClass() const
Get the source class of this rule (i.e. the onfile class).
Bool_t TestChecksum(UInt_t checksum) const
Check if given checksum is defined in this rule.
Bool_t SetVersion(const TString &version)
Set the version string - returns kFALSE if the format is incorrect.
Bool_t IsValid() const
Return kTRUE if this rule is valid.
Bool_t GetEmbed() const
Return true if this rule should be saved in the ROOT File.
void SetSourceClass(const TString &classname)
Set the source class of this rule (i.e. the onfile class).
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TClass instances represent classes, structs and namespaces in the ROOT type system.
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
TClass * GetBaseClass(const char *classname)
Return pointer to the base class "classname".
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
const TObjArray * GetStreamerInfos() const
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Version_t GetClassVersion() const
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
const char * GetName() const override
Returns name of object.
Iterator of object array.
TObject * Next() override
Return next object in array. Returns 0 when no more objects in array.
Int_t GetEntriesFast() const
void Clear(Option_t *option="") override
Remove all objects from the array.
TObject * At(Int_t idx) const override
TObject * UncheckedAt(Int_t i) const
Bool_t IsEmpty() const override
TObject * Remove(TObject *obj) override
Remove object from array.
void Add(TObject *obj) override
Collectable string class.
const TString & GetString() const
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
TClass * GetClass() const
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Defines a common interface to inspect/change the contents of an object that represents a collection.
virtual Int_t GetProperties() const
Return miscallenous properties of the proxy (see TVirtualCollectionProxy::EProperty)
virtual TClass * GetValueClass() const =0
If the value type is a user-defined class, return a pointer to the TClass representing the value type...
virtual Int_t GetCollectionType() const =0
Return the type of the proxied collection (see enumeration TClassEdit::ESTLType)
virtual Bool_t HasPointers() const =0
Return true if the content is of type 'pointer to'.
Abstract Interface class describing Streamer information for one class.
virtual TObjArray * GetElements() const =0
Special implementation of ROOT::RRangeCast for TCollection, including a check that the cast target ty...
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
bool IsStdPair(std::string_view name)