Logo ROOT  
Reference Guide
TSchemaRuleSet.cxx
Go to the documentation of this file.
1 // @(#)root/core:$Id$
2 // author: Lukasz Janyst <ljanyst@cern.ch>
3 
4 #include "TSchemaRuleSet.h"
5 #include "TSchemaRule.h"
6 #include "TObjArray.h"
7 #include "TObjString.h"
8 #include "TClass.h"
9 #include "TROOT.h"
10 #include "TBuffer.h"
11 #include <iostream>
12 
14 #include "TVirtualStreamerInfo.h"
15 #include "TVirtualMutex.h"
16 #include "TInterpreter.h" // For gInterpreterMutex
17 #include "TStreamerElement.h"
18 #include "TClassEdit.h"
19 
21 
22 using namespace ROOT;
23 using namespace ROOT::Detail;
24 
25 ////////////////////////////////////////////////////////////////////////////////
26 /// Default constructor.
27 
28 TSchemaRuleSet::TSchemaRuleSet(): fPersistentRules( 0 ), fRemainingRules( 0 ),
29  fAllRules( 0 ), fVersion(-3), fCheckSum( 0 )
30 {
32  fRemainingRules = new TObjArray();
33  fAllRules = new TObjArray();
35 }
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 /// Destructor.
39 
41 {
42  delete fPersistentRules;
43  delete fRemainingRules;
44  delete fAllRules;
45 }
46 
47 ////////////////////////////////////////////////////////////////////////////////
48 /// The ls function lists the contents of a class on stdout. Ls output
49 /// is typically much less verbose then Dump().
50 
52 {
54  std::cout << "TSchemaRuleSet for " << fClassName << ":\n";
56  TObject *object = 0;
57  TIter next(fPersistentRules);
58  while ((object = next())) {
59  object->ls(fClassName);
60  }
62 }
63 
64 ////////////////////////////////////////////////////////////////////////////////
65 
66 Bool_t TSchemaRuleSet::AddRules( TSchemaRuleSet* /* rules */, EConsistencyCheck /* checkConsistency */, TString * /* errmsg */ )
67 {
68  return kFALSE;
69 }
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// The consistency check always fails if the TClass object was not set!
73 /// if checkConsistency is:
74 /// kNoCheck: no check is done, register the rule as is
75 /// kCheckConflict: check only for conflicting rules
76 /// kCheckAll: check for conflict and check for rule about members that are not in the current class layout.
77 /// return kTRUE if the layout is accepted, in which case we take ownership of
78 /// the rule object.
79 /// return kFALSE if the rule failed one of the test, the rule now needs to be deleted by the caller.
80 
82 {
83  //---------------------------------------------------------------------------
84  // Cannot verify the consistency if the TClass object is not present
85  /////////////////////////////////////////////////////////////////////////////
86 
87  if( (checkConsistency != kNoCheck) && !fClass )
88  return kFALSE;
89 
90  if( !rule->IsValid() )
91  return kFALSE;
92 
93  //---------------------------------------------------------------------------
94  // If we don't check the consistency then we should just add the object
95  /////////////////////////////////////////////////////////////////////////////
96 
97  if( checkConsistency == kNoCheck ) {
98  if( rule->GetEmbed() )
99  fPersistentRules->Add( rule );
100  else
101  fRemainingRules->Add( rule );
102  fAllRules->Add( rule );
103  return kTRUE;
104  }
105 
106  //---------------------------------------------------------------------------
107  // Check if all of the target data members specified in the rule are
108  // present int the target class
109  /////////////////////////////////////////////////////////////////////////////
110 
111  // Check only if we have some information about the class, otherwise we have
112  // nothing to check against
113  bool streamerInfosTest;
114  {
116  streamerInfosTest = (fClass->GetStreamerInfos()==0 || fClass->GetStreamerInfos()->GetEntries()==0);
117  }
118  if( rule->GetTarget() && !(fClass->TestBit(TClass::kIsEmulation) && streamerInfosTest) ) {
119  TObjArrayIter titer( rule->GetTarget() );
120  TObject* obj;
121  while( (obj = titer.Next()) ) {
122  TObjString* str = (TObjString*)obj;
123  if( !fClass->GetDataMember( str->GetString() ) && !fClass->GetBaseClass( str->GetString() ) ) {
124  if (checkConsistency == kCheckAll) {
125  if (errmsg) {
126  errmsg->Form("the target member (%s) is unknown",str->GetString().Data());
127  }
128  return kFALSE;
129  } else {
130  // We ignore the rules that do not apply ...
131  delete rule;
132  return kTRUE;
133  }
134  }
135  }
136  }
137 
138  //---------------------------------------------------------------------------
139  // Check if there is a rule conflicting with this one
140  /////////////////////////////////////////////////////////////////////////////
141 
142  std::vector<const TSchemaRule*> rules = FindRules( rule->GetSourceClass() );
143  //TObjArrayIter it( rules );
144  //TSchemaRule *r;
145 
146  for(auto r : rules) { // while( (obj = it.Next()) ) {
147  if( rule->Conflicts( r ) ) {
148  //delete rules;
149  if ( *r == *rule) {
150  // The rules are duplicate from each other,
151  // just ignore the new ones.
152  if (errmsg) {
153  *errmsg = "it conflicts with one of the other rules";
154  }
155  delete rule;
156  return kTRUE;
157  }
158  if (errmsg) {
159  *errmsg = "The existing rule is:\n ";
160  r->AsString(*errmsg,"s");
161  *errmsg += "\nand the ignored rule is:\n ";
162  rule->AsString(*errmsg);
163  *errmsg += ".\n";
164  }
165  return kFALSE;
166  }
167  }
168 
169  //---------------------------------------------------------------------------
170  // No conflicts - insert the rules
171  /////////////////////////////////////////////////////////////////////////////
172 
173  if( rule->GetEmbed() )
174  fPersistentRules->Add( rule );
175  else
176  fRemainingRules->Add( rule );
177  fAllRules->Add( rule );
178 
179  return kTRUE;
180 }
181 
182 ////////////////////////////////////////////////////////////////////////////////
183 /// Fill the string 'out' with the string representation of the rule.
184 
186 {
187  TObjArrayIter it( fAllRules );
188  TSchemaRule *rule;
189  while( (rule = (TSchemaRule*)it.Next()) ) {
190  rule->AsString(out);
191  out += "\n";
192  }
193 }
194 
195 ////////////////////////////////////////////////////////////////////////////////
196 /// Return True if we have any rule whose source class is 'source'.
197 
199 {
200  TObjArrayIter it( fAllRules );
201  TObject *obj;
202  while( (obj = it.Next()) ) {
203  TSchemaRule* rule = (TSchemaRule*)obj;
204  if( rule->GetSourceClass() == source )
205  return kTRUE;
206  }
207  // There was no explicit rule, let's see we have implicit rules.
208  if (fClass->GetCollectionProxy()) {
209  if (fClass->GetCollectionProxy()->GetValueClass() == 0) {
210  // We have a numeric collection, let see if the target is
211  // also a numeric collection.
212  TClass *src = TClass::GetClass(source);
213  if (src && src->GetCollectionProxy() &&
216  if (proxy->GetValueClass() == 0) {
217  return kTRUE;
218  }
219  }
220  } else {
221  TClass *vTargetClass = fClass->GetCollectionProxy()->GetValueClass();
222  TClass *src = TClass::GetClass(source);
223  if (vTargetClass->GetSchemaRules()) {
224  if (src && src->GetCollectionProxy() &&
226  TClass *vSourceClass = src->GetCollectionProxy()->GetValueClass();
227  if (vSourceClass) {
228  return vTargetClass->GetSchemaRules()->HasRuleWithSourceClass( vSourceClass->GetName() );
229  }
230  }
231  }
232  }
233  } else if (!strncmp(fClass->GetName(),"std::pair<",10) || !strncmp(fClass->GetName(),"pair<",5)) {
234  if (!strncmp(source,"std::pair<",10) || !strncmp(source,"pair<",5)) {
235  // std::pair can be converted into each other if both its parameter can be converted into
236  // each other.
237  TClass *src = TClass::GetClass(source);
238  if (!src) {
239  Error("HasRuleWithSourceClass","Can not find the TClass for %s when matching with %s\n",source.Data(),fClass->GetName());
240  return kFALSE;
241  }
242  TVirtualStreamerInfo *sourceInfo = src->GetStreamerInfo();
244  if (!sourceInfo) {
245  Error("HasRuleWithSourceClass","Can not find the StreamerInfo for %s when matching with %s\n",source.Data(),fClass->GetName());
246  return kFALSE;
247  }
248  if (!targetInfo) {
249  Error("HasRuleWithSourceClass","Can not find the StreamerInfo for target class %s\n",fClass->GetName());
250  return kFALSE;
251  }
252  for(int i = 0 ; i<2 ; ++i) {
253  TStreamerElement *sourceElement = (TStreamerElement*)sourceInfo->GetElements()->At(i);
254  TStreamerElement *targetElement = (TStreamerElement*)targetInfo->GetElements()->At(i);
255  if (sourceElement->GetClass()) {
256  if (!targetElement->GetClass()) {
257  return kFALSE;
258  }
259  if (sourceElement->GetClass() == targetElement->GetClass()) {
260  continue;
261  }
262  TSchemaRuleSet *rules = sourceElement->GetClass()->GetSchemaRules();
263  if (!rules || !rules->HasRuleWithSourceClass( targetElement->GetClass()->GetName() ) ) {
264  return kFALSE;
265  }
266  } else if (targetElement->GetClass()) {
267  return kFALSE;
268  } else {
269  // both side are numeric element we can deal with it.
270  }
271  }
272  // Both side are pairs and have convertible types, let records this as a renaming rule
273  ROOT::TSchemaRule *ruleobj = new ROOT::TSchemaRule();
274  ruleobj->SetSourceClass(source);
275  ruleobj->SetTargetClass(fClass->GetName());
276  ruleobj->SetVersion("[1-]");
277  const_cast<TSchemaRuleSet*>(this)->AddRule(ruleobj);
278  return kTRUE;
279  }
280  }
281  return kFALSE;
282 }
283 
284 ////////////////////////////////////////////////////////////////////////////////
285 /// Return all the rules that are about the given 'source' class.
286 /// User has to delete the returned array
287 
289 {
290  TObject* obj;
291  TObjArrayIter it( fAllRules );
292  TMatches arr;
293  // arr->SetOwner( kFALSE );
294 
295  while( (obj = it.Next()) ) {
296  TSchemaRule* rule = (TSchemaRule*)obj;
297  if( rule->GetSourceClass() == source )
298  arr.push_back( rule );
299  }
300 
301 #if 0
302  // Le't's see we have implicit rules.
303  if (fClass->GetCollectionProxy()) {
307  // We have a numeric collection, let see if the target is
308  // also a numeric collection (humm just a vector for now)
309  TClass *src = TClass::GetClass(source);
310  if (src && src->GetCollectionProxy()) {
312  if (proxy->GetValueClass() == 0) {
313  // ... would need to check if we already have
314  // the rule (or any rule?)
315  }
316  }
317  }
318  }
319 #endif
320  return arr;
321 }
322 
323 ////////////////////////////////////////////////////////////////////////////////
324 /// Return all the rules that applies to the specified version of the given 'source' class.
325 /// User has to delete the returned array
326 
328 {
329  TObject* obj;
330  TObjArrayIter it( fAllRules );
331  TMatches arr;
332  // arr->SetOwner( kFALSE );
333 
334  while( (obj = it.Next()) ) {
335  TSchemaRule* rule = (TSchemaRule*)obj;
336  if( rule->GetSourceClass() == source && rule->TestVersion( version ) )
337  arr.push_back( rule );
338  }
339 
340  return arr;
341 }
342 
343 ////////////////////////////////////////////////////////////////////////////////
344 /// Return all the rules that applies to the specified checksum of the given 'source' class.
345 /// User has to delete the returned array
346 
347 const TSchemaRuleSet::TMatches TSchemaRuleSet::FindRules( const TString &source, UInt_t checksum ) const
348 {
349  TObject* obj;
350  TObjArrayIter it( fAllRules );
351  TMatches arr;
352  // arr->SetOwner( kFALSE );
353 
354  while( (obj = it.Next()) ) {
355  TSchemaRule* rule = (TSchemaRule*)obj;
356  if( rule->GetSourceClass() == source && rule->TestChecksum( checksum ) )
357  arr.push_back( rule );
358  }
359 
360  return arr;
361 }
362 
363 ////////////////////////////////////////////////////////////////////////////////
364 /// Return all the rules that applies to the specified version OR checksum of the given 'source' class.
365 /// User has to delete the returned array
366 
367 const TSchemaRuleSet::TMatches TSchemaRuleSet::FindRules( const TString &source, Int_t version, UInt_t checksum ) const
368 {
369  TObject* obj;
370  TObjArrayIter it( fAllRules );
371  TMatches arr;
372  // arr->SetOwner( kFALSE );
373 
374  while( (obj = it.Next()) ) {
375  TSchemaRule* rule = (TSchemaRule*)obj;
376  if( rule->GetSourceClass() == source && ( rule->TestVersion( version ) || rule->TestChecksum( checksum ) ) )
377  arr.push_back( rule );
378  }
379 
380  return arr;
381 }
382 
383 ////////////////////////////////////////////////////////////////////////////////
384 
386 {
387  return fClass;
388 }
389 
390 ////////////////////////////////////////////////////////////////////////////////
391 
393 {
394  if (fCheckSum == 0 && fClass) {
395  const_cast<TSchemaRuleSet*>(this)->fCheckSum = fClass->GetCheckSum();
396  }
397  return fCheckSum;
398 }
399 
400 ////////////////////////////////////////////////////////////////////////////////
401 
403 {
404  return fClassName;
405 }
406 
407 ////////////////////////////////////////////////////////////////////////////////
408 
410 {
411  return fVersion;
412 }
413 
414 ////////////////////////////////////////////////////////////////////////////////
415 
417 {
418  return fAllRules;
419 }
420 
421 ////////////////////////////////////////////////////////////////////////////////
422 
424 {
425  return fPersistentRules;
426 }
427 
428 ////////////////////////////////////////////////////////////////////////////////
429 /// Remove given rule from the set - the rule is not being deleted!
430 
432 {
433  fPersistentRules->Remove( rule );
434  fRemainingRules->Remove( rule );
435  fAllRules->Remove( rule );
436 }
437 
438 ////////////////////////////////////////////////////////////////////////////////
439 /// remove given array of rules from the set - the rules are not being deleted!
440 
442 {
443  TObject* obj;
444  TObjArrayIter it( rules );
445 
446  while( (obj = it.Next()) ) {
447  fPersistentRules->Remove( obj );
448  fRemainingRules->Remove( obj );
449  fAllRules->Remove( obj );
450  }
451 }
452 
453 ////////////////////////////////////////////////////////////////////////////////
454 /// Set the TClass associated with this rule set.
455 
457 {
458  fClass = cls;
459  fClassName = cls->GetName();
460  fVersion = cls->GetClassVersion();
461 }
462 
463 
464 ////////////////////////////////////////////////////////////////////////////////
465 /// Return the rule that has 'name' as a source.
466 
468 {
469  for( auto rule : *this ) {
470  if( rule->HasSource( name ) ) return rule;
471  }
472  return 0;
473 }
474 
475 ////////////////////////////////////////////////////////////////////////////////
476 /// Return the rule that has 'name' as a target.
477 
479 {
480  for( auto rule : *this ) {
481  if( rule->HasTarget( name ) ) return rule;
482  }
483  return 0;
484 }
485 
486 ////////////////////////////////////////////////////////////////////////////////
487 /// Return true if the set of rules has at least one rule that has the data
488 /// member named 'name' as a source.
489 /// If needingAlloc is true, only the rule that requires the data member to
490 /// be cached will be taken in consideration.
491 
493 {
494  for( auto rule : *this ) {
495  if( rule->HasSource( name ) ) {
496  if (needingAlloc) {
497  const TObjArray *targets = rule->GetTarget();
498  if (targets && (targets->GetEntries() > 1 || targets->GetEntries()==0) ) {
499  return kTRUE;
500  }
501  if (targets && name != targets->UncheckedAt(0)->GetName() ) {
502  return kTRUE;
503  }
504  // If the rule has the same source and target and does not
505  // have any actions, then it does not need allocation.
506  if (rule->GetReadFunctionPointer() || rule->GetReadRawFunctionPointer()) {
507  return kTRUE;
508  }
509  } else {
510  return kTRUE;
511  }
512  }
513  }
514  return kFALSE;
515 }
516 
517 ////////////////////////////////////////////////////////////////////////////////
518 /// Return true if the set of rules has at least one rule that has the data
519 /// member named 'name' as a target.
520 /// If willset is true, only the rule that will set the value of the data member.
521 
523 {
524  for(auto rule : *this) {
525  if( rule->HasTarget( name ) ) {
526  if (willset) {
527  const TObjArray *targets = rule->GetTarget();
528  if (targets && (targets->GetEntries() > 1 || targets->GetEntries()==0) ) {
529  return kTRUE;
530  }
531  const TObjArray *sources = rule->GetSource();
532  if (sources && (sources->GetEntries() > 1 || sources->GetEntries()==0) ) {
533  return kTRUE;
534  }
535  if (sources && name != sources->UncheckedAt(0)->GetName() ) {
536  return kTRUE;
537  }
538  // If the rule has the same source and target and does not
539  // have any actions, then it will not directly set the value.
540  if (rule->GetReadFunctionPointer() || rule->GetReadRawFunctionPointer()) {
541  return kTRUE;
542  }
543  } else {
544  return kTRUE;
545  }
546  }
547  }
548  return kFALSE;
549 }
550 
551 ////////////////////////////////////////////////////////////////////////////////
552 /// Stream an object of class ROOT::TSchemaRuleSet.
553 
554 void TSchemaRuleSet::Streamer(TBuffer &R__b)
555 {
556  if (R__b.IsReading()) {
558  fAllRules->Clear();
560  } else {
563  }
564 }
565 
TClass::GetStreamerInfo
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
Definition: TClass.cxx:4509
ROOT::Detail::TSchemaRuleSet::ls
void ls(Option_t *option="") const
The ls function lists the contents of a class on stdout.
Definition: TSchemaRuleSet.cxx:51
TVirtualCollectionProxy::GetProperties
virtual Int_t GetProperties() const
Definition: TVirtualCollectionProxy.h:87
TClass::kIsEmulation
@ kIsEmulation
Definition: TClass.h:100
TVirtualCollectionProxy.h
TClass::GetCollectionProxy
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition: TClass.cxx:2854
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
TObjArray
Definition: TObjArray.h:37
ROOT::Detail::TSchemaRuleSet::~TSchemaRuleSet
virtual ~TSchemaRuleSet()
Destructor.
Definition: TSchemaRuleSet.cxx:40
ROOT::TSchemaRule::GetTarget
const TObjArray * GetTarget() const
Get the target data members of this rule (i.e. the in memory data member).
Definition: TSchemaRule.cxx:520
TROOT::DecreaseDirLevel
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
Definition: TROOT.cxx:2696
ROOT::Detail::TSchemaRuleSet::fCheckSum
UInt_t fCheckSum
Definition: TSchemaRuleSet.h:76
TString::Data
const char * Data() const
Definition: TString.h:369
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TClassEdit::kVector
@ kVector
Definition: TClassEdit.h:94
TObjArray::Remove
virtual TObject * Remove(TObject *obj)
Remove object from array.
Definition: TObjArray.cxx:719
ROOT::Detail::TSchemaRuleSet::AddRules
Bool_t AddRules(TSchemaRuleSet *rules, EConsistencyCheck checkConsistency=kCheckAll, TString *errmsg=0)
Definition: TSchemaRuleSet.cxx:66
TObjString.h
ROOT::TSchemaRule::GetSourceClass
const char * GetSourceClass() const
Get the source class of this rule (i.e. the onfile class).
Definition: TSchemaRule.cxx:466
TStreamerElement.h
TBuffer::ReadClassBuffer
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
ROOT::Detail
Definition: impl_tuple_apply.hxx:33
r
ROOT::R::TRInterface & r
Definition: Object.C:4
ROOT::TSchemaRule::TestVersion
Bool_t TestVersion(Int_t version) const
Check if given version number is defined in this rule.
Definition: TSchemaRule.cxx:402
ROOT::TSchemaRule::SetTargetClass
void SetTargetClass(const TString &classname)
Set the target class of this rule (i.e. the in memory class).
Definition: TSchemaRule.cxx:474
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
ROOT::Detail::TSchemaRuleSet::TMatches::HasRuleWithSource
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...
Definition: TSchemaRuleSet.cxx:492
TCollection::SetOwner
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Definition: TCollection.cxx:746
ROOT::Detail::TSchemaRuleSet::fClass
TClassRef fClass
Array of all rules.
Definition: TSchemaRuleSet.h:73
TObjString::GetString
const TString & GetString() const
Definition: TObjString.h:52
TClass::GetClassVersion
Version_t GetClassVersion() const
Definition: TClass.h:377
TObjArray::GetEntries
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:523
TVirtualCollectionProxy::GetValueClass
virtual TClass * GetValueClass() const =0
TClass.h
ROOT::Detail::TSchemaRuleSet::HasRuleWithSourceClass
Bool_t HasRuleWithSourceClass(const TString &source) const
Return True if we have any rule whose source class is 'source'.
Definition: TSchemaRuleSet.cxx:198
TClass::GetBaseClass
TClass * GetBaseClass(const char *classname)
Return pointer to the base class "classname".
Definition: TClass.cxx:2612
TBuffer
Definition: TBuffer.h:43
TObjArray::UncheckedAt
TObject * UncheckedAt(Int_t i) const
Definition: TObjArray.h:90
TObjArray::At
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
TString
Definition: TString.h:136
TCollection::AddAll
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
Definition: TCollection.cxx:195
TClass::GetSchemaRules
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
Definition: TClass.cxx:1881
TClass::GetCheckSum
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Definition: TClass.cxx:6273
TObjArrayIter
Definition: TObjArray.h:123
TVirtualStreamerInfo
Definition: TVirtualStreamerInfo.h:37
ROOT::Detail::TSchemaRuleSet::fPersistentRules
TObjArray * fPersistentRules
Definition: TSchemaRuleSet.h:70
bool
ROOT::TSchemaRule::SetVersion
Bool_t SetVersion(const TString &version)
Set the version string - returns kFALSE if the format is incorrect.
Definition: TSchemaRule.cxx:381
TObjArray::Add
void Add(TObject *obj)
Definition: TObjArray.h:74
TClass::GetDataMember
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
Definition: TClass.cxx:3318
TROOT.h
ROOT::Detail::TSchemaRuleSet::FindRules
const TMatches FindRules(const TString &source) const
Return all the rules that are about the given 'source' class.
Definition: TSchemaRuleSet.cxx:288
TObjString
Definition: TObjString.h:28
ROOT::TSchemaRule
Definition: TSchemaRule.h:19
TVirtualCollectionProxy::HasPointers
virtual Bool_t HasPointers() const =0
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
TString::Form
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
ROOT::Detail::TSchemaRuleSet::kNoCheck
@ kNoCheck
Definition: TSchemaRuleSet.h:39
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TSchemaRule.h
TBuffer.h
ROOT::TSchemaRule::AsString
void AsString(TString &out, const char *options="") const
Add to the string 'out' the string representation of the rule.
Definition: TSchemaRule.cxx:218
gInterpreterMutex
R__EXTERN TVirtualMutex * gInterpreterMutex
Definition: TInterpreter.h:43
TStreamerElement::GetClass
TClass * GetClass() const
Definition: TStreamerElement.h:109
ROOT::Detail::TSchemaRuleSet::TMatches::HasRuleWithTarget
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...
Definition: TSchemaRuleSet.cxx:522
ROOT::TSchemaRule::SetSourceClass
void SetSourceClass(const TString &classname)
Set the source class of this rule (i.e. the onfile class).
Definition: TSchemaRule.cxx:456
ROOT::Detail::TSchemaRuleSet::AsString
void AsString(TString &out) const
Fill the string 'out' with the string representation of the rule.
Definition: TSchemaRuleSet.cxx:185
TBuffer::WriteClassBuffer
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
ROOT::TSchemaRule::GetEmbed
Bool_t GetEmbed() const
Return true if this rule should be saved in the ROOT File.
Definition: TSchemaRule.cxx:624
ROOT::TSchemaRule::TestChecksum
Bool_t TestChecksum(UInt_t checksum) const
Check if given checksum is defined in this rule.
Definition: TSchemaRule.cxx:437
TClass::GetStreamerInfos
const TObjArray * GetStreamerInfos() const
Definition: TClass.h:443
R__LOCKGUARD
#define R__LOCKGUARD(mutex)
Definition: TVirtualMutex.h:104
TClass::GetClass
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.
Definition: TClass.cxx:2925
TVirtualCollectionProxy::kIsEmulated
@ kIsEmulated
Definition: TVirtualCollectionProxy.h:54
ROOT::Detail::TSchemaRuleSet::GetPersistentRules
const TObjArray * GetPersistentRules() const
Definition: TSchemaRuleSet.cxx:423
ROOT::Detail::TSchemaRuleSet::GetClassVersion
Int_t GetClassVersion() const
Definition: TSchemaRuleSet.cxx:409
TVirtualMutex.h
TROOT::IncreaseDirLevel
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
Definition: TROOT.cxx:2792
ROOT::Detail::TSchemaRuleSet::SetClass
void SetClass(TClass *cls)
Set the TClass associated with this rule set.
Definition: TSchemaRuleSet.cxx:456
ROOT::Detail::TSchemaRuleSet::GetClassName
TString GetClassName() const
Definition: TSchemaRuleSet.cxx:402
TROOT::IndentLevel
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition: TROOT.cxx:2800
unsigned int
TVirtualStreamerInfo.h
ROOT::Detail::TSchemaRuleSet::TMatches::GetRuleWithTarget
const TSchemaRule * GetRuleWithTarget(const TString &name) const
Return the rule that has 'name' as a target.
Definition: TSchemaRuleSet.cxx:478
ROOT::Detail::TSchemaRuleSet::EConsistencyCheck
EConsistencyCheck
Definition: TSchemaRuleSet.h:38
ROOT::Detail::TSchemaRuleSet::TMatches::GetRuleWithSource
const TSchemaRule * GetRuleWithSource(const TString &name) const
Return the rule that has 'name' as a source.
Definition: TSchemaRuleSet.cxx:467
TObjArray::Clear
virtual void Clear(Option_t *option="")
Remove all objects from the array.
Definition: TObjArray.cxx:321
TBuffer::IsReading
Bool_t IsReading() const
Definition: TBuffer.h:86
ROOT::Detail::TSchemaRuleSet::GetClass
TClass * GetClass()
Definition: TSchemaRuleSet.cxx:385
ROOT::Detail::TSchemaRuleSet::fRemainingRules
TObjArray * fRemainingRules
Definition: TSchemaRuleSet.h:71
TObjArray.h
TClassEdit.h
ROOT::Detail::TSchemaRuleSet::kCheckAll
@ kCheckAll
Definition: TSchemaRuleSet.h:40
ROOT::Detail::TSchemaRuleSet::GetClassCheckSum
UInt_t GetClassCheckSum() const
Definition: TSchemaRuleSet.cxx:392
TInterpreter.h
TClass
Definition: TClass.h:80
ROOT::Detail::TSchemaRuleSet::RemoveRule
void RemoveRule(TSchemaRule *rule)
Remove given rule from the set - the rule is not being deleted!
Definition: TSchemaRuleSet.cxx:431
TObject
Definition: TObject.h:37
name
char name[80]
Definition: TGX11.cxx:110
TSchemaRuleSet.h
ROOT::Detail::TSchemaRuleSet::GetRules
const TObjArray * GetRules() const
Definition: TSchemaRuleSet.cxx:416
TIter
Definition: TCollection.h:233
TVirtualCollectionProxy::GetCollectionType
virtual Int_t GetCollectionType() const =0
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
ROOT::TSchemaRule::IsValid
Bool_t IsValid() const
Return kTRUE if this rule is valid.
Definition: TSchemaRule.cxx:632
ROOT::Detail::TSchemaRuleSet::fVersion
Int_t fVersion
Definition: TSchemaRuleSet.h:75
TObjArrayIter::Next
TObject * Next()
Return next object in array. Returns 0 when no more objects in array.
Definition: TObjArray.cxx:931
Class
void Class()
Definition: Class.C:29
ROOT::Detail::TSchemaRuleSet::TMatches
Definition: TSchemaRuleSet.h:28
ROOT::TSchemaRule::Conflicts
Bool_t Conflicts(const TSchemaRule *rule) const
Check if this rule conflicts with the given one.
Definition: TSchemaRule.cxx:772
ROOT::Detail::TSchemaRuleSet::AddRule
Bool_t AddRule(TSchemaRule *rule, EConsistencyCheck checkConsistency=kCheckAll, TString *errmsg=0)
The consistency check always fails if the TClass object was not set! if checkConsistency is: kNoCheck...
Definition: TSchemaRuleSet.cxx:81
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Detail::TSchemaRuleSet::RemoveRules
void RemoveRules(TObjArray *rules)
remove given array of rules from the set - the rules are not being deleted!
Definition: TSchemaRuleSet.cxx:441
TStreamerElement
Definition: TStreamerElement.h:33
ROOT::Detail::TSchemaRuleSet::fClassName
TString fClassName
Target class pointer (for consistency checking)
Definition: TSchemaRuleSet.h:74
ROOT::Detail::TSchemaRuleSet
Definition: TSchemaRuleSet.h:24
TVirtualCollectionProxy
Definition: TVirtualCollectionProxy.h:38
TVirtualStreamerInfo::GetElements
virtual TObjArray * GetElements() const =0
int
ROOT::Detail::TSchemaRuleSet::fAllRules
TObjArray * fAllRules
Array of non-persisten rules - just for cleanup purposes - owns the elements.
Definition: TSchemaRuleSet.h:72
ROOT::Detail::TSchemaRuleSet::TSchemaRuleSet
TSchemaRuleSet()
Default constructor.
Definition: TSchemaRuleSet.cxx:28