Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TListOfFunctions.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/cont
0002 // Author: Philippe Canal Aug 2013
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TListOfFunctions
0013 #define ROOT_TListOfFunctions
0014 
0015 //////////////////////////////////////////////////////////////////////////
0016 //                                                                      //
0017 // TListOfFunctions                                                     //
0018 //                                                                      //
0019 // A collection of TFunction objects designed for fast access given a   //
0020 // DeclId_t and for keep track of TFunction that were described         //
0021 // unloaded function.                                                   //
0022 //                                                                      //
0023 //////////////////////////////////////////////////////////////////////////
0024 
0025 #include "THashList.h"
0026 
0027 #include "THashTable.h"
0028 
0029 #include "TDictionary.h"
0030 
0031 class TExMap;
0032 class TFunction;
0033 
0034 class TListOfFunctions : public THashList
0035 {
0036 private:
0037    friend class TClass;
0038    TClass    *fClass; // Context of this list.  Not owned.
0039 
0040    TExMap    *fIds;      // Map from DeclId_t to TFunction*
0041    THashList *fUnloaded; // Holder of TFunction for unloaded functions.
0042    THashTable fOverloads; // TLists of overloads.
0043    ULong64_t  fLastLoadMarker; // Represent interpreter state when we last did a full load.
0044 
0045    TListOfFunctions(const TListOfFunctions&) = delete;
0046    TListOfFunctions& operator=(const TListOfFunctions&) = delete;
0047    TList     *GetListForObjectNonConst(const char* name);
0048 
0049    void       MapObject(TObject *obj);
0050    void       UnmapObject(TObject *obj);
0051 
0052 public:
0053    typedef TDictionary::DeclId_t DeclId_t;
0054 
0055    TListOfFunctions(TClass *cl);
0056    ~TListOfFunctions();
0057 
0058    void       Clear(Option_t *option="") override;
0059    void       Delete(Option_t *option="") override;
0060 
0061    TObject   *FindObject(const TObject* obj) const override;
0062    TObject   *FindObject(const char *name) const override;
0063    virtual TList     *GetListForObject(const char* name) const;
0064    virtual TList     *GetListForObject(const TObject* obj) const;
0065    TIterator *MakeIterator(Bool_t dir = kIterForward) const override;
0066 
0067    TObject   *At(Int_t idx) const override;
0068    TObject   *After(const TObject *obj) const override;
0069    TObject   *Before(const TObject *obj) const override;
0070    TObject   *First() const override;
0071    TObjLink  *FirstLink() const override;
0072    TObject  **GetObjectRef(const TObject *obj) const override;
0073    TObject   *Last() const override;
0074    TObjLink  *LastLink() const override;
0075 
0076    Int_t      GetLast() const override;
0077    Int_t      IndexOf(const TObject *obj) const override;
0078 
0079    Int_t      GetSize() const override;
0080 
0081    TFunction *Find(DeclId_t id) const;
0082    TFunction *Get(DeclId_t id);
0083 
0084    void       AddFirst(TObject *obj) override;
0085    void       AddFirst(TObject *obj, Option_t *opt) override;
0086    void       AddLast(TObject *obj) override;
0087    void       AddLast(TObject *obj, Option_t *opt) override;
0088    void       AddAt(TObject *obj, Int_t idx) override;
0089    void       AddAfter(const TObject *after, TObject *obj) override;
0090    void       AddAfter(TObjLink *after, TObject *obj) override;
0091    void       AddBefore(const TObject *before, TObject *obj) override;
0092    void       AddBefore(TObjLink *before, TObject *obj) override;
0093 
0094    void       RecursiveRemove(TObject *obj) override;
0095    TObject   *Remove(TObject *obj) override;
0096    TObject   *Remove(TObjLink *lnk) override;
0097 
0098    void Load();
0099    void Unload();
0100    void Unload(TFunction *func);
0101 
0102    ClassDefOverride(TListOfFunctions,0);  // List of TFunctions for a class
0103 };
0104 
0105 //////////////////////////////////////////////////////////////////////////
0106 //                                                                      //
0107 // TListOfFunctionsIter                                                 //
0108 //                                                                      //
0109 // Iterator of TListOfFunctions.                                        //
0110 //                                                                      //
0111 //////////////////////////////////////////////////////////////////////////
0112 class TListOfFunctionsIter : public TListIter
0113 {
0114 public:
0115    TListOfFunctionsIter(const TListOfFunctions *l, Bool_t dir = kIterForward);
0116 
0117    using TListIter::operator=;
0118 
0119    TObject           *Next() override;
0120 
0121    ClassDefOverride(TListOfFunctionsIter,0)
0122 };
0123 
0124 
0125 #endif // ROOT_TListOfFunctions