Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TListOfEnumsWithLock.cxx
Go to the documentation of this file.
1// @(#)root/cont
2// Author: Bianca-Cristina Cristescu February 2014
3
4/*************************************************************************
5 * Copyright (C) 1995-2013, 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/** \class TListOfEnumsWithLock
13A collection of TEnum objects designed for fast access given a
14DeclId_t and for keep track of TEnum that were described
15unloaded enum.
16*/
17
18#include <forward_list>
19
21#include "TClass.h"
22#include "TExMap.h"
23#include "TEnum.h"
24#include "TGlobal.h"
25#include "TInterpreter.h"
26#include "TVirtualMutex.h"
27
28
29////////////////////////////////////////////////////////////////////////////////
30
35
36////////////////////////////////////////////////////////////////////////////////
37/// Destructor.
38
42
43////////////////////////////////////////////////////////////////////////////////
44/// Add object at the beginning of the list.
45
51
52////////////////////////////////////////////////////////////////////////////////
53/// Add object at the beginning of the list and also store option.
54/// Storing an option is useful when one wants to change the behaviour
55/// of an object a little without having to create a complete new
56/// copy of the object. This feature is used, for example, by the Draw()
57/// method. It allows the same object to be drawn in different ways.
58
64
65////////////////////////////////////////////////////////////////////////////////
66/// Add object at the end of the list.
67
73
74////////////////////////////////////////////////////////////////////////////////
75/// Add object at the end of the list and also store option.
76/// Storing an option is useful when one wants to change the behaviour
77/// of an object a little without having to create a complete new
78/// copy of the object. This feature is used, for example, by the Draw()
79/// method. It allows the same object to be drawn in different ways.
80
86
87////////////////////////////////////////////////////////////////////////////////
88/// Insert object at location idx in the list.
89
95
96////////////////////////////////////////////////////////////////////////////////
97/// Insert object at location idx in the list, with options.
98
104
105////////////////////////////////////////////////////////////////////////////////
106/// Insert object after object after in the list.
107
113
114////////////////////////////////////////////////////////////////////////////////
115/// Insert object after object after in the list.
116
122
123////////////////////////////////////////////////////////////////////////////////
124/// Insert object after object after in the list, with options.
125
131
132////////////////////////////////////////////////////////////////////////////////
133/// Insert object after object after in the list, with options.
134
140
141////////////////////////////////////////////////////////////////////////////////
142/// Insert object before object before in the list.
143
149
150////////////////////////////////////////////////////////////////////////////////
151/// Insert object before object before in the list.
152
158
159////////////////////////////////////////////////////////////////////////////////
160/// Insert object before object before in the list, with options.
161
167
168////////////////////////////////////////////////////////////////////////////////
169/// Insert object before object before in the list, with options.
170
176
177////////////////////////////////////////////////////////////////////////////////
178/// Remove all objects from the list. Does not delete the objects unless
179/// the THashList is the owner (set via SetOwner()).
180
186
187////////////////////////////////////////////////////////////////////////////////
188/// Delete all TDataMember object files.
189
195
196////////////////////////////////////////////////////////////////////////////////
197/// Specialize FindObject to do search for the
198/// a enum just by name or create it if its not already in the list
199
205
206
207////////////////////////////////////////////////////////////////////////////////
208
214
215////////////////////////////////////////////////////////////////////////////////
216/// Return an object from the list of enums *if and only if* is has already
217/// been loaded in the list. This is an internal routine.
218
224
225////////////////////////////////////////////////////////////////////////////////
226/// Remove object from this collection and recursively remove the object
227/// from all other objects (and collections).
228/// This function overrides TCollection::RecursiveRemove that calls
229/// the Remove function. THashList::Remove cannot be called because
230/// it uses the hash value of the hash table. This hash value
231/// is not available anymore when RecursiveRemove is called from
232/// the TObject destructor.
233
241
242////////////////////////////////////////////////////////////////////////////////
243/// Remove object from the list.
244
250
251////////////////////////////////////////////////////////////////////////////////
252/// Remove object via its objlink from the list.
253
255{
256 if (!lnk) return nullptr;
257
260}
261
262////////////////////////////////////////////////////////////////////////////////
263
269
270////////////////////////////////////////////////////////////////////////////////
271
277
278////////////////////////////////////////////////////////////////////////////////
279
285
286////////////////////////////////////////////////////////////////////////////////
287
293
294////////////////////////////////////////////////////////////////////////////////
295
301
302////////////////////////////////////////////////////////////////////////////////
303
309
310////////////////////////////////////////////////////////////////////////////////
311
317
318////////////////////////////////////////////////////////////////////////////////
319
325
326////////////////////////////////////////////////////////////////////////////////
327
333
334
335////////////////////////////////////////////////////////////////////////////////
336
342
343////////////////////////////////////////////////////////////////////////////////
344
350
351
352////////////////////////////////////////////////////////////////////////////////
353
359
360/** \class TListOfEnumsWithLockIter
361Iterator for TListOfEnumsWithLock.
362*/
363
364
365////////////////////////////////////////////////////////////////////////////////
366
369
370////////////////////////////////////////////////////////////////////////////////
371
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
R__EXTERN TVirtualMutex * gInterpreterMutex
#define R__LOCKGUARD(mutex)
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
virtual TObject ** GetObjectRef(const TObject *obj) const =0
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
The TEnum class implements the enum type.
Definition TEnum.h:33
TObject * FindObject(const char *name) const override
Find object using its name.
Iterator abstract base class.
Definition TIterator.h:30
Iterator of linked list.
Definition TList.h:196
TObject * Next() override
Return next object in the list. Returns 0 when no more objects in list.
Definition TList.cxx:1243
Iterator for TListOfEnumsWithLock.
TListOfEnumsWithLockIter(const TListOfEnumsWithLock *l, Bool_t dir=kIterForward)
TObject * Next() override
Return next object in the list. Returns 0 when no more objects in list.
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
TIterator * MakeIterator(Bool_t dir=kIterForward) const override
Return a list iterator.
TEnum * GetObject(const char *) const override
Return an object from the list of enums if and only if is has already been loaded in the list.
void AddBefore(const TObject *before, TObject *obj) override
Insert object before object before in the list.
TObject * FindObject(const TObject *obj) const override
Find object using its hash value (returned by its Hash() member).
TObjLink * LastLink() const override
Int_t GetSize() const override
Return the capacity of the collection, i.e.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
void Delete(Option_t *option="") override
Delete all TDataMember object files.
TObject * Before(const TObject *obj) const override
Returns the object before object obj.
void AddFirst(TObject *obj) override
Add object at the beginning of the list.
TObject * Remove(TObject *obj) override
Remove object from the list.
void AddAfter(const TObject *after, TObject *obj) override
Insert object after object after in the list.
Int_t GetLast() const override
Returns index of last object in collection.
void AddAt(TObject *obj, Int_t idx) override
Insert object at location idx in the list.
~TListOfEnumsWithLock() override
Destructor.
void AddLast(TObject *obj) override
Add object at the end of the list.
void Clear(Option_t *option) override
Remove all objects from the list.
TObject ** GetObjectRef(const TObject *obj) const override
Return address of pointer to obj.
TObjLink * FirstLink() const override
TListOfEnumsWithLock(const TListOfEnumsWithLock &)=delete
Int_t IndexOf(const TObject *obj) const override
Return index of object in collection.
void RecursiveRemove(TObject *obj) override
Remove object from this collection and recursively remove the object from all other objects (and coll...
TObject * After(const TObject *obj) const override
Returns the object after object obj.
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
void AddBefore(const TObject *before, TObject *obj) override
Insert object before object before in the list.
void Delete(Option_t *option="") override
Delete all TDataMember object files.
void AddAt(TObject *obj, Int_t idx) override
Insert object at location idx in the list.
TObject * FindObject(const char *) const override
Specialize FindObject to do search for the a enum just by name or create it if its not already in the...
void AddAfter(const TObject *after, TObject *obj) override
Insert object after object after in the list.
TObject * Remove(TObject *obj) override
Remove object from the list.
void AddLast(TObject *obj) override
Add object at the end of the list.
void RecursiveRemove(TObject *obj) override
Remove object from this collection and recursively remove the object from all other objects (and coll...
void AddFirst(TObject *obj) override
Add object at the beginning of the list.
void Clear(Option_t *option) override
Remove all objects from the list.
TObject * After(const TObject *obj) const override
Returns the object after object obj.
Definition TList.cxx:460
virtual TObjLink * LastLink() const
Definition TList.h:110
TObject * Before(const TObject *obj) const override
Returns the object before object obj.
Definition TList.cxx:501
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:823
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:789
virtual TObjLink * FirstLink() const
Definition TList.h:107
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
Definition TList.cxx:487
Mother of all ROOT objects.
Definition TObject.h:41
virtual Int_t IndexOf(const TObject *obj) const
Return index of object in collection.
virtual Int_t GetLast() const
Returns index of last object in collection.
TLine l
Definition textangle.C:4