/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/io/include/RAT/ObjInt.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/io/include/RAT/ObjInt.hh Source File
Ratpac-two
ObjInt.hh
1 #ifndef __RAT_ObjInt__
2 #define __RAT_ObjInt__
3 
4 #include <TObject.h>
5 
6 namespace RAT {
7 
8 // TObject wrapper for an integer so you can write it to a file
9 class ObjInt : public TObject {
10  public:
11  ObjInt() : TObject() { fVal = 0; };
12  ObjInt(int val) : TObject() { fVal = val; };
13  ObjInt(const ObjInt &other) : TObject() { fVal = other.fVal; };
14  ObjInt &operator=(const ObjInt &rhs) {
15  fVal = rhs.fVal;
16  return *this;
17  };
18 
19  int GetInt() const { return fVal; };
20  void SetInt(int val) { fVal = val; };
21 
22  ObjInt &operator=(const int &val) {
23  fVal = val;
24  return *this;
25  };
26  operator int() const { return fVal; };
27 
28  ClassDef(ObjInt, 1);
29 
30  protected:
31  int fVal;
32 };
33 
34 } // namespace RAT
35 
36 #endif
Definition: ObjInt.hh:9
Definition: CCCrossSecMessenger.hh:29