GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4Parameter.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 TGO4PARAMETER_H
15 #define TGO4PARAMETER_H
16 
17 #include "TNamed.h"
18 
19 class TObjArray;
20 class TDataMember;
22 
28 class TGo4Parameter : public TNamed {
29  public:
30 
31  TGo4Parameter();
32 
33  TGo4Parameter(const char *name, const char *title = "This is a Go4 Parameter Object");
34 
35  virtual ~TGo4Parameter();
36 
40  virtual Int_t PrintParameter(Text_t *buffer = nullptr, Int_t buflen = 0);
41 
42  void Print(Option_t *opt = "") const override;
43 
46  virtual Bool_t UpdateFrom(TGo4Parameter *rhs);
47 
49  Bool_t UpdateFromUrl(const char *rest_url_opt);
50 
54  virtual Bool_t CustomUpdateFrom() const { return kTRUE; }
55 
56  /* We overwrite the default TNamed::Clear that would
57  * erase our name and title!
58  * Implement this method in your parameter class
59  * if you would like to reset any values with the
60  * eraser button in the gui remote browser*/
61  void Clear(Option_t *opt = "") override;
62 
63  void GetMemberValues(TObjArray *fItems);
64  Bool_t SetMemberValues(TObjArray *fItems);
65 
69  void SavePrimitive(std::ostream &fs, Option_t *opt= "") override;
70 
73 
75  Bool_t SetStatus(TGo4ParameterStatus *status);
76 
77  protected:
78 
79  void GetMemberValues(TObjArray *fItems, TClass *cl, char *ptr, unsigned long int cloffset);
80 
81  Bool_t SetMemberValues(TObjArray *items, Int_t &itemsindx, TClass *cl, char *ptr, unsigned long int cloffset);
82 
83  Int_t FindArrayLength(TObjArray *items, Int_t &itemsindx, TDataMember *member);
84 
85  ClassDefOverride(TGo4Parameter,1)
86 };
87 
88 #endif //TGO4PARAMETER_H
TGo4ParameterStatus * CreateStatus()
virtual ~TGo4Parameter()
virtual Int_t PrintParameter(Text_t *buffer=nullptr, Int_t buflen=0)
Int_t FindArrayLength(TObjArray *items, Int_t &itemsindx, TDataMember *member)
void SavePrimitive(std::ostream &fs, Option_t *opt="") override
virtual Bool_t CustomUpdateFrom() const
Definition: TGo4Parameter.h:54
void Clear(Option_t *opt="") override
void Print(Option_t *opt="") const override
Bool_t UpdateFromUrl(const char *rest_url_opt)
Bool_t SetMemberValues(TObjArray *fItems)
virtual Bool_t UpdateFrom(TGo4Parameter *rhs)
Bool_t SetStatus(TGo4ParameterStatus *status)
void GetMemberValues(TObjArray *fItems)