ROOT  6.06/09
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 #ifndef ROOT_THastList
26 #include "THashList.h"
27 #endif
28 
29 #ifndef ROOT_THastTable
30 #include "THashTable.h"
31 #endif
32 
33 #ifndef ROOT_TDictionary
34 #include "TDictionary.h"
35 #endif
36 
37 class TExMap;
38 class TFunctionTemplate;
39 
41 {
42 private:
44  TClass *fClass; // Context of this list. Not owned.
45 
46  TExMap *fIds; // Map from DeclId_t to TFunction*
47  THashList *fUnloaded; // Holder of TFunction for unloaded functions.
48  THashTable fOverloads; // TLists of overloads.
49  ULong64_t fLastLoadMarker; // Represent interpreter state when we last did a full load.
50 
51  TListOfFunctionTemplates(const TListOfFunctionTemplates&); // not implemented
53  TList *GetListForObjectNonConst(const char* name);
54 
55  void MapObject(TObject *obj);
56  void UnmapObject(TObject *obj);
57 
58 public:
59 
62 
63  virtual void Clear(Option_t *option);
64  virtual void Delete(Option_t *option="");
65 
67  virtual TObject *FindObject(const char *name) const;
68  virtual TList *GetListForObject(const char* name) const;
69  virtual TList *GetListForObject(const TObject* obj) const;
70 
71  TFunctionTemplate *Get(DeclId_t id);
72 
73  void AddFirst(TObject *obj);
74  void AddFirst(TObject *obj, Option_t *opt);
75  void AddLast(TObject *obj);
76  void AddLast(TObject *obj, Option_t *opt);
77  void AddAt(TObject *obj, Int_t idx);
78  void AddAfter(const TObject *after, TObject *obj);
79  void AddAfter(TObjLink *after, TObject *obj);
80  void AddBefore(const TObject *before, TObject *obj);
81  void AddBefore(TObjLink *before, TObject *obj);
82 
85  TObject *Remove(TObjLink *lnk);
86 
87  void Load();
88  void Unload();
90 
91  ClassDef(TListOfFunctionTemplates,0); // List of TFunctions for a class
92 };
93 
94 #endif // ROOT_TListOfFunctionTemplates
void UnmapObject(TObject *obj)
Remove a pair from the map of functions and their ids.
const char Option_t
Definition: RtypesCore.h:62
Dictionary for function template This class describes one single function template.
TObject * FindObject(const char *name) const
Find object using its name.
Definition: THashList.cxx:212
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
virtual TObject * FindObject(const char *name) const
Specialize FindObject to do search for the a function just by name or create it if its not already in...
TObject * Remove(TObject *obj)
Remove object from the list.
int Int_t
Definition: RtypesCore.h:41
void AddAt(TObject *obj, Int_t idx)
Insert object at location idx in the list.
void MapObject(TObject *obj)
Add pair to the map of functions and their ids.
const void * DeclId_t
Definition: TDictionary.h:209
virtual TList * GetListForObject(const char *name) const
Return the set of overloads for this name, collecting all available ones.
THashTable implements a hash table to store TObject's.
Definition: THashTable.h:39
TList * GetListForObjectNonConst(const char *name)
Return the set of overloads for this name, collecting all available ones.
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:36
virtual void Clear(Option_t *option)
Remove all objects from the list.
TListOfFunctionTemplates(const TListOfFunctionTemplates &)
TListOfFunctionTemplates & operator=(const TListOfFunctionTemplates &)
A doubly linked list.
Definition: TList.h:47
virtual void Delete(Option_t *option="")
Delete all TFunction object files.
void AddLast(TObject *obj)
Add object at the end of the list.
TFunctionTemplate * Get(DeclId_t id)
Return (after creating it if necessary) the TMethod or TFunction describing the function correspondin...
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
void AddFirst(TObject *obj)
Add object at the beginning of the list.
unsigned long long ULong64_t
Definition: RtypesCore.h:70
double func(double *x, double *p)
Definition: stressTF1.cxx:213
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
void Load()
Load all the functions known to the interpreter for the scope 'fClass' into this collection.
ClassDef(TListOfFunctionTemplates, 0)
void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
TDictionary::DeclId_t DeclId_t
TObject * obj
void Unload()
Mark 'all func' as being unloaded.
void AddAfter(const TObject *after, TObject *obj)
Insert object after object after in the list.
This class stores a (key,value) pair using an external hash.
Definition: TExMap.h:35
void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.