// @(#)root/cont
// Author: Bianca-Cristina Cristescu February 2014

/*************************************************************************
 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TListOfEnumsWithLock
#define ROOT_TListOfEnumsWithLock

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TListOfEnumsWithLock                                                         //
//                                                                      //
// A collection of TEnum objects designed for fast access given a       //
// DeclId_t and for keep track of TEnum that were described             //
// unloaded enum.                                                       //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TListOfEnums
#include "TListOfEnums.h"
#endif

class TExMap;
class TEnum;

class TListOfEnumsWithLock : public TListOfEnums
{
private:
   typedef TDictionary::DeclId_t DeclId_t;

   TListOfEnumsWithLock(const TListOfEnumsWithLock&) = delete;
   TListOfEnumsWithLock& operator=(const TListOfEnumsWithLock&) = delete;

public:

   TListOfEnumsWithLock(TClass *cl = 0);
   ~TListOfEnumsWithLock() override;

   TEnum *GetObject(const char*) const override;

   void Clear(Option_t *option) override;
   void Delete(Option_t *option="") override;

   TObject   *FindObject(const TObject* obj) const override;
   TObject   *FindObject(const char *name) const override;
   TIterator *MakeIterator(Bool_t dir = kIterForward) const override;

   TObject   *At(Int_t idx) const override;
   TObject   *After(const TObject *obj) const override;
   TObject   *Before(const TObject *obj) const override;
   TObject   *First() const override;
   TObjLink  *FirstLink() const override;
   TObject  **GetObjectRef(const TObject *obj) const override;
   TObject   *Last() const override;
   TObjLink  *LastLink() const override;

   Int_t      GetLast() const override;
   Int_t      IndexOf(const TObject *obj) const override;

   Int_t      GetSize() const override;

   void       AddFirst(TObject *obj) override;
   void       AddFirst(TObject *obj, Option_t *opt) override;
   void       AddLast(TObject *obj) override;
   void       AddLast(TObject *obj, Option_t *opt) override;
   void       AddAt(TObject *obj, Int_t idx) override;
   void       AddAfter(const TObject *after, TObject *obj) override;
   void       AddAfter(TObjLink *after, TObject *obj) override;
   void       AddBefore(const TObject *before, TObject *obj) override;
   void       AddBefore(TObjLink *before, TObject *obj) override;

   void       RecursiveRemove(TObject *obj) override;
   TObject   *Remove(TObject *obj) override;
   TObject   *Remove(TObjLink *lnk) override;

   ClassDefOverride(TListOfEnumsWithLock,2);  // List of TDataMembers for a class
};


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TListOfEnumsWithLockIter                                             //
//                                                                      //
// Iterator of TListOfEnumsWithLock.                                    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
class TListOfEnumsWithLockIter : public TListIter
{
 public:
   TListOfEnumsWithLockIter(const TListOfEnumsWithLock *l, Bool_t dir = kIterForward);

   using TListIter::operator=;

   TObject *Next();

   ClassDef(TListOfEnumsWithLockIter,0)
};

#endif // ROOT_TListOfEnumsWithLock
 TListOfEnumsWithLock.h:1
 TListOfEnumsWithLock.h:2
 TListOfEnumsWithLock.h:3
 TListOfEnumsWithLock.h:4
 TListOfEnumsWithLock.h:5
 TListOfEnumsWithLock.h:6
 TListOfEnumsWithLock.h:7
 TListOfEnumsWithLock.h:8
 TListOfEnumsWithLock.h:9
 TListOfEnumsWithLock.h:10
 TListOfEnumsWithLock.h:11
 TListOfEnumsWithLock.h:12
 TListOfEnumsWithLock.h:13
 TListOfEnumsWithLock.h:14
 TListOfEnumsWithLock.h:15
 TListOfEnumsWithLock.h:16
 TListOfEnumsWithLock.h:17
 TListOfEnumsWithLock.h:18
 TListOfEnumsWithLock.h:19
 TListOfEnumsWithLock.h:20
 TListOfEnumsWithLock.h:21
 TListOfEnumsWithLock.h:22
 TListOfEnumsWithLock.h:23
 TListOfEnumsWithLock.h:24
 TListOfEnumsWithLock.h:25
 TListOfEnumsWithLock.h:26
 TListOfEnumsWithLock.h:27
 TListOfEnumsWithLock.h:28
 TListOfEnumsWithLock.h:29
 TListOfEnumsWithLock.h:30
 TListOfEnumsWithLock.h:31
 TListOfEnumsWithLock.h:32
 TListOfEnumsWithLock.h:33
 TListOfEnumsWithLock.h:34
 TListOfEnumsWithLock.h:35
 TListOfEnumsWithLock.h:36
 TListOfEnumsWithLock.h:37
 TListOfEnumsWithLock.h:38
 TListOfEnumsWithLock.h:39
 TListOfEnumsWithLock.h:40
 TListOfEnumsWithLock.h:41
 TListOfEnumsWithLock.h:42
 TListOfEnumsWithLock.h:43
 TListOfEnumsWithLock.h:44
 TListOfEnumsWithLock.h:45
 TListOfEnumsWithLock.h:46
 TListOfEnumsWithLock.h:47
 TListOfEnumsWithLock.h:48
 TListOfEnumsWithLock.h:49
 TListOfEnumsWithLock.h:50
 TListOfEnumsWithLock.h:51
 TListOfEnumsWithLock.h:52
 TListOfEnumsWithLock.h:53
 TListOfEnumsWithLock.h:54
 TListOfEnumsWithLock.h:55
 TListOfEnumsWithLock.h:56
 TListOfEnumsWithLock.h:57
 TListOfEnumsWithLock.h:58
 TListOfEnumsWithLock.h:59
 TListOfEnumsWithLock.h:60
 TListOfEnumsWithLock.h:61
 TListOfEnumsWithLock.h:62
 TListOfEnumsWithLock.h:63
 TListOfEnumsWithLock.h:64
 TListOfEnumsWithLock.h:65
 TListOfEnumsWithLock.h:66
 TListOfEnumsWithLock.h:67
 TListOfEnumsWithLock.h:68
 TListOfEnumsWithLock.h:69
 TListOfEnumsWithLock.h:70
 TListOfEnumsWithLock.h:71
 TListOfEnumsWithLock.h:72
 TListOfEnumsWithLock.h:73
 TListOfEnumsWithLock.h:74
 TListOfEnumsWithLock.h:75
 TListOfEnumsWithLock.h:76
 TListOfEnumsWithLock.h:77
 TListOfEnumsWithLock.h:78
 TListOfEnumsWithLock.h:79
 TListOfEnumsWithLock.h:80
 TListOfEnumsWithLock.h:81
 TListOfEnumsWithLock.h:82
 TListOfEnumsWithLock.h:83
 TListOfEnumsWithLock.h:84
 TListOfEnumsWithLock.h:85
 TListOfEnumsWithLock.h:86
 TListOfEnumsWithLock.h:87
 TListOfEnumsWithLock.h:88
 TListOfEnumsWithLock.h:89
 TListOfEnumsWithLock.h:90
 TListOfEnumsWithLock.h:91
 TListOfEnumsWithLock.h:92
 TListOfEnumsWithLock.h:93
 TListOfEnumsWithLock.h:94
 TListOfEnumsWithLock.h:95
 TListOfEnumsWithLock.h:96
 TListOfEnumsWithLock.h:97
 TListOfEnumsWithLock.h:98
 TListOfEnumsWithLock.h:99
 TListOfEnumsWithLock.h:100
 TListOfEnumsWithLock.h:101
 TListOfEnumsWithLock.h:102
 TListOfEnumsWithLock.h:103
 TListOfEnumsWithLock.h:104
 TListOfEnumsWithLock.h:105