GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4ParameterStatus.cxx
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#include "TGo4ParameterStatus.h"
15
16#include "TROOT.h"
17#include "TClass.h"
18#include "TObjArray.h"
19
20#include "TGo4Log.h"
21#include "TGo4Parameter.h"
22
27
30{
31 if (par && membervalues) {
32 fxMemberValues = new TObjArray();
33 fxMemberValues->SetOwner(kTRUE);
35 }
36}
37
38TGo4ParameterStatus::TGo4ParameterStatus(const char *parname, const char *parclass, TObjArray *items) :
40{
41 fxMemberValues = items;
42 SetName(parname);
43 SetTitle("TGo4ParameterStatus title");
44 fxObjectClass = parclass;
45}
46
47
55
56TObjArray *TGo4ParameterStatus::GetMemberValues(Bool_t takeit)
57{
58 TObjArray *res = fxMemberValues;
59 if (takeit) fxMemberValues = nullptr;
60 return res;
61}
62
64{
65 if (!par || !fxMemberValues) return kFALSE;
66 if (strcmp(GetObjectClass(), par->ClassName()) != 0) return kFALSE;
67
68 if (par->CustomUpdateFrom()) {
69 TGo4Parameter *copypar = CreateParameter();
70 par->UpdateFrom(copypar);
71 delete copypar;
72 } else {
74 }
75
76 return kTRUE;
77
78}
79
81{
82 auto parclass = gROOT->GetClass(GetObjectClass());
83 if (!parclass || !fxMemberValues) return nullptr;
84
85 TGo4Parameter *par = (TGo4Parameter*) parclass->New();
86
87 if (!par) return nullptr;
88
89 par->SetName(GetName());
91
92 return par;
93}
94
95void TGo4ParameterStatus::Print(Option_t *) const
96{
98 PrintLine("G-OOOO-> Parameter Status Class Printout <-OOOO-G");
99 PrintLine("G-OOOO-> ---------------------------------------------- <-OOOO-G");
100}
const char * GetObjectClass() const
ClassName of the described object.
TString fxObjectClass
Classname of the described object.
TGo4ObjectStatus()
default ctor for streamer.
void Print(Option_t *opt="") const override
TGo4Parameter * CreateParameter()
Bool_t UpdateParameterValues(TGo4Parameter *par)
TObjArray * GetMemberValues(Bool_t takeit=kFALSE)
void Print(Option_t *opt="") const override
Base class for all parameter aggregations, e.g.
virtual Bool_t UpdateFrom(TGo4Parameter *rhs)
Update contents of parameter class with external object.
void GetMemberValues(TObjArray *fItems)
Bool_t SetMemberValues(TObjArray *fItems)
virtual Bool_t CustomUpdateFrom() const
Specifies, if user implement UpdateFrom() method and it should be used when parameter updated from ot...
static void PrintLine(const char *text,...)
Print single line of debug output with appropriate indent.