Base class for a Global Object. More...
#include <GObject.h>
Public Types | |
typedef std::pair< ANamedItem *, std::pair< ANamedItem *, DataLink * > > | FullItem |
a full item is composed of a pointer to an item, an pointer to a proxy and a pointer to a datalink More... | |
Public Member Functions | |
virtual Bool_t | AddItem (ANamedItem *item) |
Add a named item to this. The item belongs to GObject and will be thus deleted. More... | |
template<typename Data_t > | |
const NamedItem< Data_t > * | Get (const char *name) |
to get a given item (reading mode only !!) More... | |
virtual void | GetItems (const BufferIO &) |
read the value of all item from the buffer More... | |
virtual void | GetItems () const |
Copy local variables into externals. More... | |
GObject () | |
Constructor. More... | |
virtual Bool_t | IsFullyLinked () const |
to check if all the items are linked with external variables More... | |
template<typename Data_t > | |
Bool_t | Link (const char *name, Data_t *external_address) |
General method to Link one item with an external address. More... | |
Bool_t | LinkItem (const Char_t *, const Char_t *, void *) |
Only for basic type ... otherwise better to use the most general Link method. More... | |
Bool_t | LinkItem (const Char_t *name, Short_t *address) |
Bool_t | LinkItem (const Char_t *name, UShort_t *address) |
Bool_t | LinkItem (const Char_t *name, Int_t *address) |
Bool_t | LinkItem (const Char_t *name, UInt_t *address) |
Bool_t | LinkItem (const Char_t *name, Float_t *address) |
Bool_t | LinkItem (const Char_t *name, Double_t *address) |
Bool_t | LinkItem (const Char_t *name, Long64_t *address) |
Bool_t | LinkItem (const Char_t *name, ULong64_t *address) |
virtual void | Print (std::ostream &out=std::cout) const |
print some informations about this object More... | |
virtual void | Reset () |
Set local to default. More... | |
virtual void | SetItems (BufferIO &) const |
write the value of all items into the buffer More... | |
virtual void | SetItems () |
Copy external variables into locals. More... | |
void | TransferLinkAndProxy (GObject &to) |
transfert proxy and link for one GObject to another one More... | |
virtual | ~GObject () |
Destructor. More... | |
Base class for a Global Object.
Data Frame are composed of structures that are related to the algorithm which produces them. For intance a PSAFrame is composed of a list of Hits, whatever is the real data members stored in the Frame (ex: with or without errors).
Data cannot be always organized into specific structures, but could be just a list of data identified by a unique name and a given basic type. This object is used to help the user to read/modify such data item.
- S : a 16 bit signed integer (Short_t) - US : a 16 bit unsigned integer (UShort_t) - I : a 32 bit signed integer (Int_t) - UI : a 32 bit unsigned integer (UInt_t) - F : a 32 bit floating point (Float_t) - D : a 64 bit floating point (Double_t) - L : a 64 bit signed integer (Long64_t) - UL : a 64 bit unsigned integer (ULong64_t) - B : a boolean (Bool_t)
A GObject is then a list of NamedItem that represents the current definition of that Object. To add a item to the list:
Items are owned by ob1 and are thus deleted by it ... so the user should not care about that. As a consequence, the following is forbidden:
NamedItem are known by their name and type ... as a consequence, you cannot add twice an item with the same name and type.
In your program, you can establish a link between a NamedItem and a local variable (of the same type !) so that changing the value of your local variable will changed the item's one. As well you can get back the value of the itemin you program To do that:
You can only link once a NamedItem ... otherwise it would be a mess !
You can however consult (reading mode) a NamedItem using proxy This is done like this :
see ADFObject.C for concrete exemples