Logo ROOT  
Reference Guide
TListOfFunctionTemplates.h
Go to the documentation of this file.
1 // @(#)root/cont
2 // Author: Philippe Canal Aug 2013
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 #ifndef ROOT_TListOfFunctionTemplates
13 #define ROOT_TListOfFunctionTemplates
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TListOfFunctionTemplates //
18 // //
19 // A collection of TFunctionTemplate objects designed for fast access //
20 // given a DeclId_t and for keep track of TFunctionTempalte that were //
21 // described unloaded function. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "THashList.h"
26 
27 #include "THashTable.h"
28 
29 #include "TDictionary.h"
30 
31 class TExMap;
32 class TFunctionTemplate;
33 
35 {
36 private:
37  friend class TClass;
38 
40  TClass *fClass; // Context of this list. Not owned.
41 
42  TExMap *fIds; // Map from DeclId_t to TFunction*
43  THashList *fUnloaded; // Holder of TFunction for unloaded functions.
44  THashTable fOverloads; // TLists of overloads.
45  ULong64_t fLastLoadMarker; // Represent interpreter state when we last did a full load.
46 
49  TList *GetListForObjectNonConst(const char* name);
50 
51  void MapObject(TObject *obj);
52  void UnmapObject(TObject *obj);
53 
54 public:
55 
58 
59  virtual void Clear(Option_t *option);
60  virtual void Delete(Option_t *option="");
61 
63  virtual TObject *FindObject(const char *name) const;
64  virtual TList *GetListForObject(const char* name) const;
65  virtual TList *GetListForObject(const TObject* obj) const;
66 
68 
69  void AddFirst(TObject *obj);
70  void AddFirst(TObject *obj, Option_t *opt);
71  void AddLast(TObject *obj);
72  void AddLast(TObject *obj, Option_t *opt);
73  void AddAt(TObject *obj, Int_t idx);
74  void AddAfter(const TObject *after, TObject *obj);
75  void AddAfter(TObjLink *after, TObject *obj);
76  void AddBefore(const TObject *before, TObject *obj);
77  void AddBefore(TObjLink *before, TObject *obj);
78 
79  void RecursiveRemove(TObject *obj);
80  TObject *Remove(TObject *obj);
81  TObject *Remove(TObjLink *lnk);
82 
83  void Load();
84  void Unload();
85  void Unload(TFunctionTemplate *func);
86 
87  ClassDef(TListOfFunctionTemplates,0); // List of TFunctions for a class
88 };
89 
90 #endif // ROOT_TListOfFunctionTemplates
TListOfFunctionTemplates::Remove
TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TListOfFunctionTemplates.cxx:323
TListOfFunctionTemplates::AddFirst
void AddFirst(TObject *obj)
Add object at the beginning of the list.
Definition: TListOfFunctionTemplates.cxx:64
TListOfFunctionTemplates::fOverloads
THashTable fOverloads
Definition: TListOfFunctionTemplates.h:44
TListOfFunctionTemplates
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
Definition: TListOfFunctionTemplates.h:35
TListOfFunctionTemplates::GetListForObjectNonConst
TList * GetListForObjectNonConst(const char *name)
Return the set of overloads for this name, collecting all available ones.
Definition: TListOfFunctionTemplates.cxx:194
Option_t
const char Option_t
Definition: RtypesCore.h:66
TListOfFunctionTemplates::AddLast
void AddLast(TObject *obj)
Add object at the end of the list.
Definition: TListOfFunctionTemplates.cxx:86
TListOfFunctionTemplates::fClass
TClass * fClass
Definition: TListOfFunctionTemplates.h:40
TListOfFunctionTemplates::AddAfter
void AddAfter(const TObject *after, TObject *obj)
Insert object after object after in the list.
Definition: TListOfFunctionTemplates.cxx:117
TListOfFunctionTemplates::GetListForObject
virtual TList * GetListForObject(const char *name) const
Return the set of overloads for this name, collecting all available ones.
Definition: TListOfFunctionTemplates.cxx:233
TListOfFunctionTemplates::Get
TFunctionTemplate * Get(DeclId_t id)
Return (after creating it if necessary) the TMethod or TFunction describing the function correspondin...
Definition: TListOfFunctionTemplates.cxx:253
TListOfFunctionTemplates::~TListOfFunctionTemplates
~TListOfFunctionTemplates()
Destructor.
Definition: TListOfFunctionTemplates.cxx:42
TListOfFunctionTemplates::Delete
virtual void Delete(Option_t *option="")
Delete all TFunction object files.
Definition: TListOfFunctionTemplates.cxx:164
TDictionary.h
THashTable
THashTable implements a hash table to store TObject's.
Definition: THashTable.h:35
TListOfFunctionTemplates::MapObject
void MapObject(TObject *obj)
Add pair<id, object> to the map of functions and their ids.
Definition: TListOfFunctionTemplates.cxx:53
THashList
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:34
TListOfFunctionTemplates::UnmapObject
void UnmapObject(TObject *obj)
Remove a pair<id, object> from the map of functions and their ids.
Definition: TListOfFunctionTemplates.cxx:293
TListOfFunctionTemplates::fIds
TExMap * fIds
Definition: TListOfFunctionTemplates.h:42
THashList::FindObject
TObject * FindObject(const char *name) const
Find object using its name.
Definition: THashList.cxx:262
TDictionary::DeclId_t
const void * DeclId_t
Definition: TDictionary.h:209
TListOfFunctionTemplates::RecursiveRemove
void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
Definition: TListOfFunctionTemplates.cxx:310
TListOfFunctionTemplates::Load
void Load()
Load all the functions known to the interpreter for the scope 'fClass' into this collection.
Definition: TListOfFunctionTemplates.cxx:356
TListOfFunctionTemplates::DeclId_t
TDictionary::DeclId_t DeclId_t
Definition: TListOfFunctionTemplates.h:39
TListOfFunctionTemplates::Clear
virtual void Clear(Option_t *option)
Remove all objects from the list.
Definition: TListOfFunctionTemplates.cxx:154
TListOfFunctionTemplates::AddBefore
void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.
Definition: TListOfFunctionTemplates.cxx:135
THashList.h
TListOfFunctionTemplates::TListOfFunctionTemplates
TListOfFunctionTemplates(const TListOfFunctionTemplates &)
ULong64_t
unsigned long long ULong64_t
Definition: RtypesCore.h:74
TListOfFunctionTemplates::fLastLoadMarker
ULong64_t fLastLoadMarker
Definition: TListOfFunctionTemplates.h:45
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TListOfFunctionTemplates::fUnloaded
THashList * fUnloaded
Definition: TListOfFunctionTemplates.h:43
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TListOfFunctionTemplates::AddAt
void AddAt(TObject *obj, Int_t idx)
Insert object at location idx in the list.
Definition: TListOfFunctionTemplates.cxx:108
TExMap
This class stores a (key,value) pair using an external hash.
Definition: TExMap.h:33
TListOfFunctionTemplates::operator=
TListOfFunctionTemplates & operator=(const TListOfFunctionTemplates &)
TListOfFunctionTemplates::Unload
void Unload()
Mark 'all func' as being unloaded.
Definition: TListOfFunctionTemplates.cxx:377
TListOfFunctionTemplates::FindObject
TObject * FindObject(const char *name) const
Find object using its name.
Definition: THashList.cxx:262
TList
A doubly linked list.
Definition: TList.h:44
int
TFunctionTemplate
Dictionary for function template This class describes one single function template.
Definition: TFunctionTemplate.h:26
THashTable.h