]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/Reve/Reve.h
Merge from EVE-dev to HEAD.
[u/mrichter/AliRoot.git] / EVE / Reve / Reve.h
CommitLineData
5a5a1232 1// $Header$
2
3#ifndef REVE_Reve_H
4#define REVE_Reve_H
5
a8600b56 6// #include <string>
7#include <exception>
5a5a1232 8#include <TString.h>
3cc71cfc 9#include <TError.h>
915dabe1 10#include <Gtypes.h>
5a5a1232 11
5a5a1232 12class TVirtualPad;
13class TGeoManager;
14
15namespace Reve {
16
a8600b56 17bool operator==(const TString& t, const std::string& s);
18bool operator==(const std::string& s, const TString& t);
19
20class Exc_t : public std::exception, public TString
5a5a1232 21{
22 public:
23 Exc_t() {}
a8600b56 24 Exc_t(const TString& s) : TString(s) {}
25 Exc_t(const char* s) : TString(s) {}
26 Exc_t(const std::string& s);
5a5a1232 27
a8600b56 28 virtual ~Exc_t() throw () {}
5a5a1232 29
a8600b56 30 virtual const char* what() const throw () { return Data(); }
5a5a1232 31
a8600b56 32 ClassDef(Exc_t, 1);
5a5a1232 33};
34
35Exc_t operator+(const Exc_t &s1, const std::string &s2);
36Exc_t operator+(const Exc_t &s1, const TString &s2);
37Exc_t operator+(const Exc_t &s1, const char *s2);
38
39void WarnCaller(const TString& warning);
40
092578a7 41void ColorFromIdx(Color_t ci, UChar_t* col);
42Color_t* FindColorVar(TObject* obj, const Text_t* varname);
915dabe1 43
5a5a1232 44/**************************************************************************/
45/**************************************************************************/
46
47void SetupEnvironment();
48
f8fae956 49Bool_t CheckMacro(const Text_t* mac);
50void AssertMacro(const Text_t* mac);
51void Macro(const Text_t* mac);
52void LoadMacro(const Text_t* mac);
5a5a1232 53
54/**************************************************************************/
55/**************************************************************************/
56
57TVirtualPad* PushPad(TVirtualPad* new_gpad=0, Int_t subpad=0);
58TVirtualPad* PopPad(Bool_t modify_update_p=false);
59
60class PadHolder
61{
62private:
63 Bool_t fModifyUpdateP;
64public:
65 PadHolder(Bool_t modify_update_p, TVirtualPad* new_gpad=0, Int_t subpad=0) :
66 fModifyUpdateP(modify_update_p)
67 { PushPad(new_gpad, subpad); }
68
69 virtual ~PadHolder() { PopPad(fModifyUpdateP); }
70
71 ClassDef(PadHolder, 0);
72};
73
74class GeoManagerHolder
75{
76private:
77 TGeoManager* fManager;
265ecb21 78
79 GeoManagerHolder(const GeoManagerHolder&); // Not implemented
80 GeoManagerHolder& operator=(const GeoManagerHolder&); // Not implemented
81
5a5a1232 82public:
83 GeoManagerHolder(TGeoManager* new_gmgr=0);
84 virtual ~GeoManagerHolder();
85
86 ClassDef(GeoManagerHolder, 0);
87};
88
915dabe1 89/**************************************************************************/
90
91class ReferenceCount
92{
93protected:
94 Int_t fRefCount;
95
96public:
97 ReferenceCount() : fRefCount(0) {}
98 virtual ~ReferenceCount() {}
99
100 void IncRefCount() { ++fRefCount; }
101 void DecRefCount() { if(--fRefCount <= 0) OnZeroRefCount(); }
102
103 virtual void OnZeroRefCount() { delete this; }
104
105 ClassDef(ReferenceCount, 0);
106};
107
5a5a1232 108}
109
110#endif