2 #ifndef ROOTHISTCNV_RHISTOGRAMCNV_H
3 #define ROOTHISTCNV_RHISTOGRAMCNV_H 1
17 namespace RootHistCnv {
32 template <
typename CLASS>
struct TTH :
public CLASS {
33 void CopyH(TObject& o) { CLASS::Copy(o); }
38 refpObj = DataObjFactory::create(
objType());
40 Q* h =
dynamic_cast<Q*
>(refpObj);
44 std::auto_ptr<T> p(
new T());
45 S *
s =
dynamic_cast<S*
>(r->
tObj());
48 TArray* a =
dynamic_cast<TArray*
>(
s);
54 h->adoptRepresentation(p.release());
59 return error(
"Cannot create histogram - invalid address.");
67 Q* h =
dynamic_cast<Q*
>(pObj);
69 T *r =
dynamic_cast<T*
>(h->representation());
72 TArray* a =
dynamic_cast<TArray*
>(r);
83 error(
"Histogram object is invalid!");
93 #endif // ROOTHISTCNV_RHISTOGRAMCNV_H
virtual StatusCode updateObj(IOpaqueAddress *, DataObject *)
Update the transient object from the other representation.
RHistogramCnv(ISvcLocator *svc)
Standard constructor.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&refpObj)
Create the transient representation of an object.
virtual const name_type & name() const =0
Name of the directory (or key)
IRegistry * registry() const
Get pointer to Registry.
static const CLID & classID()
Inquire class type.
virtual const CLID & objType() const
Retrieve the class type of objects the converter produces.
This class is used for returning status codes from appropriate routines.
virtual TObject * tObj() const
Retrieve TObject* ptr.
Generic converter to save/read AIDA_ROOT histograms using ROOT.
unsigned int CLID
Class ID definition.
virtual TObject * createPersistent(DataObject *pObj)
Create the persistent representation of the histogram object.
StatusCode error(const std::string &msg)
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.