GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Bool_t GObject::AddItem ( ANamedItem item)
virtual

Add a named item to this. The item belongs to GObject and will be thus deleted.

If a item with the same name and type has already been added, the passed item is not added and the method returns false.

To add an item:

GObject ob1;
// add items "Crys" of type unsigned short to ob1
ob1.AddItem( new NamedItem<UShort_t>("Crys",0u) );

the following is forbidden !

GObject ob1; NamedItem<UShort_t> cry("Crys",0u);
// add items "Crys" of type unsigned short to ob1
ob1.AddItem( &crys );

Definition at line 69 of file GObject.cpp.