GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4ParameterMember.h
Go to the documentation of this file.
1// $Id$
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 fuer 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
19class 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) const;
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
58 void Clear(Option_t *opt = "") override;
59
60 void Print(Option_t *opt = "") const override;
61
62 protected:
63
64 TString fTypeName;
65 Int_t fTypeId{0};
66 Int_t fMemberId{0};
67 TString fValue;
68 Int_t fIndex1{-1};
69 Int_t fIndex2{-1};
70 TObject *fObject{nullptr};
71 Bool_t fObjectOwner{kTRUE};
72 Bool_t fVisible{kTRUE};
73
75};
76
77#endif
const char * GetTypeName() const
const char * GetFullName(TString &buf) const
Int_t fIndex2
second array index
Bool_t CheckArrayIndexes(Int_t ndim, Int_t indx1, Int_t indx2)
ClassDefOverride(TGo4ParameterMember, 1)
void SetObject(TObject *obj, Bool_t owner)
Bool_t fVisible
is visible, used by GUI
Int_t fIndex1
first array index
void Print(Option_t *opt="") const override
const char * GetStrValue() const
Bool_t fObjectOwner
! flag indicating ownership of object
void SetIntValue(Int_t value)
void SetArrayIndexes(Int_t ndim=0, Int_t indx1=-1, Int_t indx2=-1)
void SetVisible(Bool_t on=kTRUE)
void SetType(const char *name, Int_t id)
TObject * fObject
place for objects like fitter
TObject * GetObject() const
void SetStrValue(const char *value)
Bool_t IsFitterItem() const
TString fTypeName
type name of data member
Int_t fMemberId
data member id (sequence number)
void Clear(Option_t *opt="") override
Int_t fTypeId
type id of data member
TString fValue
value of data member