Logo ROOT  
Reference Guide
TViewPubDataMembers.h
Go to the documentation of this file.
1 // @(#)root/meta:$Id$
2 // Author: Philippe Canal October 2013
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TViewPubDataMembers
13 #define ROOT_TViewPubDataMembers
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TViewPubDataMembers //
18 // //
19 // //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include "TList.h"
24 
25 class TClass;
26 
27 
28 class TViewPubDataMembers : public TList {
29 
30 protected:
31  TList fClasses; // list of the all the (base) classes for which we list methods.
32 
33 private:
34  TViewPubDataMembers(const TViewPubDataMembers&); // not implemented
35  TViewPubDataMembers& operator=(const TViewPubDataMembers&); // not implemented
36 
37 public:
38  TViewPubDataMembers(TClass *cl = 0);
39  virtual ~TViewPubDataMembers();
40 
41  TObject *FindObject(const char *name) const;
42  TObject *FindObject(const TObject *obj) const;
43 
44  virtual TObject *At(Int_t idx) const;
45  virtual const TList *GetListOfClasses() const { return &fClasses; }
46  virtual Int_t GetSize() const;
47  virtual TIterator *MakeIterator(Bool_t dir = kIterForward) const;
48 
49  void Load();
50 
51  // All the following routines are explicitly disallow/unsupported for
52  // a view
53 protected:
54  void Clear(Option_t *option="");
55  void Delete(Option_t *option="");
56 
57  void AddFirst(TObject *obj);
58  void AddFirst(TObject *obj, Option_t *opt);
59  void AddLast(TObject *obj);
60  void AddLast(TObject *obj, Option_t *opt);
61  void AddAt(TObject *obj, Int_t idx);
62  void AddAfter(const TObject *after, TObject *obj);
63  void AddAfter(TObjLink *after, TObject *obj);
64  void AddBefore(const TObject *before, TObject *obj);
65  void AddBefore(TObjLink *before, TObject *obj);
66 
67  virtual TObject *After(const TObject *obj) const;
68  virtual TObject *Before(const TObject *obj) const;
69  virtual TObject *First() const;
70  virtual TObjLink *FirstLink() const;
71  virtual TObject **GetObjectRef(const TObject *obj) const;
72  virtual TObject *Last() const;
73  virtual TObjLink *LastLink() const;
74 
75  void RecursiveRemove(TObject *obj);
76  TObject *Remove(TObject *obj);
77  TObject *Remove(TObjLink *lnk);
78 
79 public:
81 };
82 
83 // Preventing warnings with -Weffc++ in GCC since it is a false positive for the TListIter destructor.
84 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
85 #pragma GCC diagnostic push
86 #pragma GCC diagnostic ignored "-Weffc++"
87 #endif
88 
89 //////////////////////////////////////////////////////////////////////////
90 // //
91 // TViewPubDataMembersIter //
92 // //
93 // Iterator of view of linked list. ` //
94 // //
95 //////////////////////////////////////////////////////////////////////////
97  public std::iterator<std::bidirectional_iterator_tag, TObject *, std::ptrdiff_t,
98  const TObject **, const TObject *&> {
99 protected:
100  const TList *fView; //View we are iterating over.
101  TIter fClassIter; //iterator over the classes
102  TIter fIter; //iterator over the members of the current class
103  Bool_t fStarted; //iteration started
104  Bool_t fDirection; //iteration direction
105 
107 
108 public:
112  TIterator &operator=(const TIterator &rhs);
114 
115  const TCollection *GetCollection() const { return fView; }
116  TObject *Next();
117  void Reset();
118  Bool_t operator!=(const TIterator &aIter) const;
119  Bool_t operator!=(const TViewPubDataMembersIter &aIter) const;
120  TObject *operator*() const { return *fIter; }
121 
122  // ClassDefInline does not yet support non default constructible classes
123  // ClassDefInline(TViewPubDataMembersIter,0)
124 };
125 
126 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
127 #pragma GCC diagnostic pop
128 #endif
129 
130 #endif // ROOT_TViewPubDataMembers
l
auto * l
Definition: textangle.C:4
TViewPubDataMembersIter::operator=
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator.
Definition: TViewPubDataMembers.cxx:384
TViewPubDataMembers::Clear
void Clear(Option_t *option="")
Clear is not allowed in this class.
Definition: TViewPubDataMembers.cxx:69
TViewPubDataMembersIter::fStarted
Bool_t fStarted
Definition: TViewPubDataMembers.h:103
TViewPubDataMembers::AddAfter
void AddAfter(const TObject *after, TObject *obj)
AddAfter is not allowed in this class.
Definition: TViewPubDataMembers.cxx:176
TViewPubDataMembers::GetListOfClasses
virtual const TList * GetListOfClasses() const
Definition: TViewPubDataMembers.h:45
TViewPubDataMembersIter::Next
TObject * Next()
Return next object in the list. Returns 0 when no more objects in list.
Definition: TViewPubDataMembers.cxx:415
TViewPubDataMembersIter::operator*
TObject * operator*() const
Return current object or nullptr.
Definition: TViewPubDataMembers.h:120
TViewPubDataMembers::fClasses
TList fClasses
Definition: TViewPubDataMembers.h:31
TViewPubDataMembers::GetObjectRef
virtual TObject ** GetObjectRef(const TObject *obj) const
GetObjectRef is not allowed in this class.
Definition: TViewPubDataMembers.cxx:271
TViewPubDataMembers::FirstLink
virtual TObjLink * FirstLink() const
FirstLink is not allowed in this class.
Definition: TViewPubDataMembers.cxx:261
Int_t
int Int_t
Definition: RtypesCore.h:45
TViewPubDataMembers::AddAt
void AddAt(TObject *obj, Int_t idx)
AddAt is not allowed in this class.
Definition: TViewPubDataMembers.cxx:167
TViewPubDataMembers::TViewPubDataMembers
TViewPubDataMembers(const TViewPubDataMembers &)
TViewPubDataMembers::AddLast
void AddLast(TObject *obj)
AddLast is not allowed in this class.
Definition: TViewPubDataMembers.cxx:149
TList.h
TViewPubDataMembers::AddBefore
void AddBefore(const TObject *before, TObject *obj)
AddBefore is not allowed in this class.
Definition: TViewPubDataMembers.cxx:194
TViewPubDataMembersIter::~TViewPubDataMembersIter
~TViewPubDataMembersIter()
Definition: TViewPubDataMembers.h:111
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TViewPubDataMembers::GetSize
virtual Int_t GetSize() const
Return the total number of public data members(currently loaded in the list of DataMembers) in this c...
Definition: TViewPubDataMembers.cxx:281
bool
TIterator
Definition: TIterator.h:30
TViewPubDataMembers::Load
void Load()
Load all the DataMembers known to the interpreter for the scope 'fClass' and all its bases classes.
Definition: TViewPubDataMembers.cxx:298
TViewPubDataMembers::LastLink
virtual TObjLink * LastLink() const
LastLink is not allowed in this class.
Definition: TViewPubDataMembers.cxx:320
TViewPubDataMembersIter::fDirection
Bool_t fDirection
Definition: TViewPubDataMembers.h:104
kIterForward
const Bool_t kIterForward
Definition: TCollection.h:40
TViewPubDataMembers::Last
virtual TObject * Last() const
Last is not allowed in this class.
Definition: TViewPubDataMembers.cxx:310
TViewPubDataMembers::Delete
void Delete(Option_t *option="")
Delete is not allowed in this class.
Definition: TViewPubDataMembers.cxx:78
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
ClassDefInline
#define ClassDefInline(name, id)
Definition: Rtypes.h:337
TViewPubDataMembersIter::TViewPubDataMembersIter
TViewPubDataMembersIter()
Definition: TViewPubDataMembers.h:106
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TViewPubDataMembers::~TViewPubDataMembers
virtual ~TViewPubDataMembers()
Default destructor.
Definition: TViewPubDataMembers.cxx:61
TViewPubDataMembers::RecursiveRemove
void RecursiveRemove(TObject *obj)
RecursiveRemove is not allowed in this class.
Definition: TViewPubDataMembers.cxx:330
TViewPubDataMembers::operator=
TViewPubDataMembers & operator=(const TViewPubDataMembers &)
TViewPubDataMembersIter::operator!=
Bool_t operator!=(const TIterator &aIter) const
This operator compares two TIterator objects.
Definition: TViewPubDataMembers.cxx:465
TViewPubDataMembers::Remove
TObject * Remove(TObject *obj)
Remove is not allowed in this class.
Definition: TViewPubDataMembers.cxx:339
TViewPubDataMembersIter::Reset
void Reset()
Reset list iterator.
Definition: TViewPubDataMembers.cxx:456
TViewPubDataMembers::First
virtual TObject * First() const
First is not allowed in this class.
Definition: TViewPubDataMembers.cxx:251
TViewPubDataMembersIter::GetCollection
const TCollection * GetCollection() const
Definition: TViewPubDataMembers.h:115
TViewPubDataMembersIter
Definition: TViewPubDataMembers.h:96
TViewPubDataMembersIter::fClassIter
TIter fClassIter
Definition: TViewPubDataMembers.h:101
TViewPubDataMembers::MakeIterator
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Definition: TViewPubDataMembers.cxx:122
TClass
Definition: TClass.h:80
TViewPubDataMembers::At
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TViewPubDataMembers.cxx:211
TViewPubDataMembers
Definition: TViewPubDataMembers.h:28
TViewPubDataMembers::Before
virtual TObject * Before(const TObject *obj) const
Before is not allowed in this class.
Definition: TViewPubDataMembers.cxx:241
TObject
Definition: TObject.h:37
name
char name[80]
Definition: TGX11.cxx:110
TIter
Definition: TCollection.h:233
TViewPubDataMembersIter::fIter
TIter fIter
Definition: TViewPubDataMembers.h:102
TViewPubDataMembers::FindObject
TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TViewPubDataMembers.cxx:88
TViewPubDataMembers::After
virtual TObject * After(const TObject *obj) const
After is not allowed in this class.
Definition: TViewPubDataMembers.cxx:231
TCollection
Definition: TCollection.h:63
TViewPubDataMembersIter::fView
const TList * fView
Definition: TViewPubDataMembers.h:100
TList
Definition: TList.h:44
int
TViewPubDataMembers::AddFirst
void AddFirst(TObject *obj)
AddFirst is not allowed in this class.
Definition: TViewPubDataMembers.cxx:131