EDM FAQ: The class_name and class_version methods


Class name and version information is made available by the class_name and class_version methods. These can best be implemented by using the ROOT generated methods Class_Name() and Class_Version(), which unfortunately violate CDF's class method style conventions (hence these lower-cased method names). For example, for ToyMuon, these are declared and implemented by:

class ToyMuon
{
  public:

    virtual std::string class_name(void) const ;
    virtual Version_t   class_version(void) const ;
}


std::string ToyMuon::class_name(void) const
{ return(ToyMuon::Class_Name()) ;
}

Version_t ToyMuon::class_version(void) const
{ return(ToyMuon::Class_Version()) ;
}
Note again that the class name is used to specify exactly which virtual method is to be called in case base class pointers are used to trigger the class name or version call.


Comments on this page may be sent to Rob Kennedy