RAIDA  1.9.0
Public Member Functions | List of all members
AIDA::IManagedObject Class Referenceabstract

An object which can be stored in a tree. More...

#include <IManagedObject.h>

Inheritance diagram for AIDA::IManagedObject:
AIDA::IManagedObjectROOT

Public Member Functions

virtual ~IManagedObject ()
 Destructor.
 
virtual std::string name () const =0
 Get the name of an IManagedObject. More...
 
virtual void * cast (const std::string &className) const =0
 A simple introspection method. More...
 

Detailed Description

An object which can be stored in a tree.

See Also
ITree
Author
The AIDA team (http://aida.freehep.org/)

Member Function Documentation

virtual void* AIDA::IManagedObject::cast ( const std::string &  className) const
pure virtual

A simple introspection method.

It offers to implementations the possibility to avoid the usage of the dynamic_cast. It appears that this C++ feature is not yet reliable (May 2003) in complex environments that intensivly use the dynamic loading. The signature of this method follows the qt_cast method found in Qt (see the Q_OBJECT macro). Example of usage is : AIDA::IManagedObject* object = tree->find("myData"); if(object) { AIDA::IHistogram* histo = object->cast("AIDA::IHistogram"); if(histo) { // the object is an histo. } }

Parameters
classNameThe name of the class to cast on.
Returns
The right pointer. Return 0 if className is not in the inheritance tree.

Implemented in AIDA::IManagedObjectROOT.

virtual std::string AIDA::IManagedObject::name ( ) const
pure virtual

Get the name of an IManagedObject.

Names can only be changed using the ITree.mv().

Returns
The name of the IManagedObject.

Implemented in AIDA::IManagedObjectROOT.


The documentation for this class was generated from the following file: