#include <NamedO.h>
Inheritance diagram for NamedO:
Classes derived from NamedO should implement a getName() method. under the name returned by getName each new object is registered, and can be looked up by name using the NamedO::getObject function.
Changelog:
Definition at line 28 of file NamedO.h.
Public Member Functions | |
NamedO (const char *name_="?") | |
Constructor from a C style string, serves as default constructor. | |
NamedO (const std::string &name_) | |
Constructor from a C++ string. | |
NamedO (const std::string &name_, const std::string &definition_) | |
Constructor from two C++ strings. | |
virtual const char * | getName () const |
Returns pointer to name (pointer must NOT be deleted!). | |
virtual const char * | getDefinition () const |
Returns pointer to definition (pointer must NOT be deleted!). | |
virtual NamedO & | setName (const std::string &newname) |
Method to be called when the name is changed. | |
virtual NamedO & | setName (const char *newname) |
virtual NamedO & | setDefinition (const std::string &newdef) |
Method to change the definition. | |
virtual std::ostream & | print (std::ostream &os) const |
Method for printing. | |
virtual void | destroy () |
Replaces delete, which cannot be called because of protected destructor. | |
Static Public Member Functions | |
NamedO * | getObject (const std::string &name) |
Access function that returns a pointer to an NamedO object with this name. | |
NamedO * | getObject (const char *name) |
Access function that returns a pointer to an NamedO object with this name. | |
template<class T> T * | getObject (const std::string &name) |
template<class T> T * | getObject (const char *name) |
std::ostream & | listObjects (std::ostream &os) |
Outputs a list of all objects registered so far. | |
std::string | str (char c) |
Converts a char into a string. | |
std::string | str (const char *s) |
Converts a C style string into a string. | |
std::string | str (int i) |
Converts an int into a string. | |
std::string | str (int i, int wide) |
Converts an int into a string, with a minimum number of digits (leading zeroes). | |
std::string | str (float f) |
Converts an float into a string. | |
std::string | str (double d) |
Converts a double into a string. | |
std::string | str (bool b) |
Converts a bool into a string. | |
Protected Member Functions | |
virtual | ~NamedO () |
Protected destructor ensures creation on the heap. | |
Private Member Functions | |
void | reg () |
Register an object. | |
void | unreg () |
Unregister an object. | |
NamedO (const NamedO &source) | |
Private copy constructor, left unimplemented: No copying! | |
NamedO & | operator= (const NamedO &source) |
Private assignment operator, left unimplemented: No assignment! | |
Static Private Member Functions | |
void | initMap () |
Internal function to initialize the maps. | |
Private Attributes | |
std::string | name |
The object's name. | |
std::string | definition |
The object's name. | |
Friends | |
class | NamedO::Init |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &os, const NamedO &rhs) |
Output operator. |
|
Constructor from a C style string, serves as default constructor.
Definition at line 65 of file NamedO.C. References reg(). |
|
Constructor from a C++ string.
Definition at line 72 of file NamedO.C. References reg(). |
|
Constructor from two C++ strings.
Definition at line 79 of file NamedO.C. References reg(). |
|
Method to be called when the name is changed.
Definition at line 147 of file NamedO.C. Referenced by JBLH1SomeArrayIterator< H1SomeArrayPtr, ArrayRow >::JBLH1SomeArrayIterator(), JBLH1SomeBankIterator< H1SomeBankPtr, H1SomeRow >::JBLH1SomeBankIterator(), and setName(). |
|
Definition at line 156 of file NamedO.C. References setName(). |
|
Method to change the definition.
Definition at line 160 of file NamedO.C. References definition. Referenced by CutBinning::genDefinition(). |
|
Access function that returns a pointer to an NamedO object with this name. This access function must never be called within the constructor of any class that is derived from NamedO!
Reimplemented in BaseCut, FloatFun, IntFun, and NamedBinning. Definition at line 171 of file NamedO.C. References getName(). Referenced by getObject(). |
|
Access function that returns a pointer to an NamedO object with this name. This access function must never be called within the constructor of any class that is derived from NamedO!
Reimplemented in BaseCut, FloatFun, IntFun, and NamedBinning. Definition at line 183 of file NamedO.C. References getObject(). |
|
Reimplemented in BaseCut, FloatFun, IntFun, and NamedBinning. Definition at line 76 of file NamedO.h. References getObject(). |
|
Reimplemented in BaseCut, FloatFun, IntFun, and NamedBinning. Definition at line 82 of file NamedO.h. References getObject(). |
|
Converts a char into a string.
Definition at line 188 of file NamedO.C. Referenced by BinningFun::BinningFun(), ConstBaseCut::ConstBaseCut(), ConstFun::ConstFun(), ConstIntFun::ConstIntFun(), CutBinning::CutBinning(), JBLH1BankFloatFunInt::JBLH1BankFloatFunInt(), JBLH1BankIntFun::JBLH1BankIntFun(), JBLH1FloatFun< H1SomePtr >::JBLH1FloatFun(), JBLH1IntFun< H1SomePtr >::JBLH1IntFun(), NamedBinning::NamedBinning(), FloatFun::operator-(), and RangeIterator::RangeIterator(). |
|
Converts a C style string into a string.
|
|
Converts an int into a string.
|
|
Converts an int into a string, with a minimum number of digits (leading zeroes).
|
|
Converts an float into a string.
|
|
Converts a double into a string.
|
|
Converts a bool into a string.
|