GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ParameterMember.h
Go to the documentation of this file.
1 // $Id: TGo4ParameterMember.h 826 2011-12-19 13:52:52Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4PARAMETERMEMBER_H
15 #define TGO4PARAMETERMEMBER_H
16 
17 #include "TNamed.h"
18 
19 class TGo4ParameterMember : public TNamed {
20  public:
21 
22  enum { kTString_t = 10001, kTGo4Fitter_t = 10002, kTArray_t = 10003 };
23 
25  TGo4ParameterMember(const char* name, const char* title);
26  virtual ~TGo4ParameterMember();
27 
28  void SetType(const char* name, Int_t id) { fTypeName = name; fTypeId = id; }
29  const char* GetTypeName() const { return fTypeName.Data(); }
30  Int_t GetTypeId() const { return fTypeId; }
31  Bool_t IsFitterItem() const { return GetTypeId()==kTGo4Fitter_t; }
32 
33  void SetMemberId(Int_t id) { fMemberId = id; }
34  Int_t GetMemberId() const { return fMemberId; }
35 
36  void SetStrValue(const char* value) { fValue = value; }
37  void SetIntValue(Int_t value) { fValue.Form("%d", value); }
38  const char* GetStrValue() const { return fValue.Data(); }
39  Int_t GetIntValue() const { return fValue.Atoi(); };
40  Bool_t CanStrEdit() const { return (fTypeId!=kTGo4Fitter_t) && (fTypeId!=kTArray_t); }
41 
42  void SetArrayIndexes(Int_t ndim=0, Int_t indx1 = -1, Int_t indx2 = -1);
43  Bool_t CheckArrayIndexes(Int_t ndim, Int_t indx1, Int_t indx2);
44  Bool_t IsArrayItem() const { return (fIndex1>=0); }
45  const char* GetFullName(TString& buf);
46 
47  void SetVisible(Bool_t on = kTRUE) { fVisible = on; }
48  Bool_t IsVisible() const { return fVisible; }
49 
50  TObject* GetObject() const { return fObject; }
51  void SetObject(TObject* obj, Bool_t owner);
52 
53  void SetValue(char* addr);
54  void GetValue(char* addr);
55 
56  void SetToZero();
57  Int_t PrintMember(Text_t* buffer = 0, Int_t buflen = 0) const;
58 
59  virtual void Clear(Option_t* opt="");
60 
61  virtual void Print(Option_t* dummy="") const;
62 
63  protected:
64 
65  TString fTypeName; // type name of data member
66  Int_t fTypeId; // type id of data member
67  Int_t fMemberId; // data member id (sequence number)
68  TString fValue; // value of data member
69  Int_t fIndex1; // first array index
70  Int_t fIndex2; // second array index
71  TObject* fObject; // place for objects like fitter
72  Bool_t fObjectOwner;
73  Bool_t fVisible; // is visible, used by GUI
74 
76 };
77 
78 
79 #endif
TObject * GetObject() const
Int_t GetIntValue() const
void SetType(const char *name, Int_t id)
virtual void Clear(Option_t *opt="")
const char * GetFullName(TString &buf)
Bool_t IsVisible() const
Bool_t CanStrEdit() const
void SetStrValue(const char *value)
Bool_t fVisible
flag indicating ownership of object
void SetObject(TObject *obj, Bool_t owner)
Bool_t IsArrayItem() const
Int_t PrintMember(Text_t *buffer=0, Int_t buflen=0) const
Int_t GetTypeId() const
Bool_t CheckArrayIndexes(Int_t ndim, Int_t indx1, Int_t indx2)
void SetIntValue(Int_t value)
const char * GetStrValue() const
const char * GetTypeName() const
void SetVisible(Bool_t on=kTRUE)
Int_t GetMemberId() const
virtual void Print(Option_t *dummy="") const
ClassDef(TGo4ParameterMember, 1)
void SetMemberId(Int_t id)
Bool_t IsFitterItem() const
void SetArrayIndexes(Int_t ndim=0, Int_t indx1=-1, Int_t indx2=-1)