// $Id$
// $MpId: AliMpExMap.h,v 1.4 2006/05/24 13:58:07 ivana Exp $
-/// \ingroup basic
+/// \ingroup core
/// \class AliMpExMap
/// \brief Helper class making Root persistent TExMap
///
#include <TArrayL.h>
#include <TExMap.h>
-class AliMpIntPair;
+class AliMpExMapIterator;
class TString;
class AliMpExMap : public TObject
{
+ friend class AliMpExMapIterator;
+
public:
- AliMpExMap(Bool_t standardConstructor);
AliMpExMap();
+ AliMpExMap(TRootIOCtor* /*ioCtor*/);
+ AliMpExMap(const AliMpExMap& rhs);
+ AliMpExMap& operator=(const AliMpExMap& rhs);
virtual ~AliMpExMap();
+
// static methods
- // conversion between varius keys and Long_t
- //
- static Long_t GetIndex(const AliMpIntPair& pair);
+ // conversion between String and Long_t
static Long_t GetIndex(const TString& s);
- static AliMpIntPair GetPair(Long_t index);
- static TString GetString(Long_t index);
+ static TString GetString(Long_t index);
+
+ // methods from base class
+ virtual void Clear(Option_t* opt="");
+ virtual void Print(Option_t* opt="") const;
// set methods
- void Add(const AliMpIntPair& key, TObject* object);
+ void Add(Int_t keyFirst, Int_t keySecond, TObject* object);
void Add(const TString& key, TObject* object);
void Add(Int_t key, TObject* object);
void SetOwner(Bool_t owner);
// get methods
- Int_t GetSize() const;
- TExMapIter GetIterator() const;
-
- TObject* GetValue(const AliMpIntPair& key) const;
+ Int_t GetSize() const;
+ Int_t GetCapacity() const;
+
+ TObject* GetValue(Int_t keyFirst, Int_t keySecond) const;
TObject* GetValue(const TString& key) const;
TObject* GetValue(Int_t key) const;
+
+ AliMpExMapIterator* CreateIterator() const;
private:
// methods
+
+ // conversion between Int_t pair key and Long_t
+ static Long_t GetIndex(Int_t first, Int_t second);
+ static Int_t GetPairFirst(Long_t index);
+ static Int_t GetPairSecond(Long_t index);
+
void FillMap();
void AddKey(Long_t key);
+ void Copy(TObject& dest) const;
// static data members
static const Int_t fgkDefaultSize; ///< Default initial size
static const Bool_t fgkDefaultOwnership; ///< Default ownership
static const Int_t fgkSeparator1; ///< \brief the separator used for conversion
- /// of AliMpIntPair to Int_t
+ /// of Int_t pair to Int_t
static const Int_t fgkSeparator2; ///< \brief the separator used for conversion
/// of TString to Int_t
static const TString fgkCharacterMap; ///< \brief the string mapping characters