GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4ObjectStatus.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 "TGo4ObjectStatus.h"
15
16#include "TDatime.h"
17#include "TClass.h"
18
19#include "TGo4Log.h"
20#include "TGo4Picture.h"
21
26
27TGo4ObjectStatus::TGo4ObjectStatus(TObject *object, Bool_t withtime) :
28 TGo4Status("Initname","InitTitle")
29{
30 GO4TRACE((15,"TGo4ObjectStatus::TGo4ObjectStatus(TNamed*)",__LINE__, __FILE__));
31 if(object) {
32 SetName(object->GetName());
33 SetTitle(object->GetTitle());
34 fxObjectClass = object->ClassName();
35 fiObjectSize = object->IsA()->Size();
36 if (object->InheritsFrom(TGo4Picture::Class()))
37 fiObjectSize = ((TGo4Picture *) object)->GetTotalSize();
39 fbResetProtect = object->TestBit(TGo4Status::kGo4NoReset);
40 } else {
41 SetName("Unknown Name");
42 SetTitle("Unknown Title");
43 fxObjectClass = "Unknown Class";
44 }
45
46 if (withtime) {
47 TDatime now;
48 fxStatusTime = now.AsSQLString();
49 }
50 // we might suppress time information for substatus objects
51 // for performance reason
52}
53
55{
56 GO4TRACE((15,"TGo4ObjectStatus::~TGo4ObjectStatus()",__LINE__, __FILE__));
57
58}
59
60void TGo4ObjectStatus::Print(Option_t *) const
61{
62 PrintLine("G-OOOO-> Object Status Class Printout <-OOOO-G");
63 PrintLine("G-OOOO-> ---------------------------------------------- <-OOOO-G");
64 PrintLine(" Object name: \t\t%s", GetName());
65 PrintLine(" Object title: \t\t%s", GetTitle());
66 PrintLine(" Object class: \t\t%s", GetObjectClass());
67 PrintLine(" Object size: \t\t%d byte", GetObjectSize());
68 PrintLine(" Clear protection: \t\t%d", IsResetProtect());
69 PrintLine(" Delete protection: \t\t%d", IsDeleteProtect());
70 PrintLine(" Status creation time: \t%s", GetTimeString());
71 PrintLine("G-OOOO-> ---------------------------------------------- <-OOOO-G");
72}
#define GO4TRACE(X)
Definition TGo4Log.h:25
const char * GetTimeString() const
Creation time string; sql format.
TString fxStatusTime
creation time of status object
const char * GetObjectClass() const
ClassName of the described object.
Int_t GetObjectSize() const
Size of described object in byte.
UInt_t fiObjectSize
Size of the described object in byte.
Bool_t IsResetProtect() const
Object's reset protection state.
TString fxObjectClass
Classname of the described object.
TGo4ObjectStatus()
default ctor for streamer.
Bool_t fbDeleteProtect
If true, described object is protected against deletion from gui.
Bool_t IsDeleteProtect() const
Object's delete protection state.
Bool_t fbResetProtect
If true, described object is protected against reset (Clear()) from gui.
void Print(Option_t *opt="") const override
Picture cconfiguration in Go4.
Definition TGo4Picture.h:40
static void PrintLine(const char *text,...)
Print single line of debug output with appropriate indent.