latest version v1.9 - last update 10 Apr 2010 |
Provides methods for getting the class names of lti::objects. More...
#include <ltiClassName.h>
Public Member Functions | |
className () | |
~className () | |
const char * | get (const object *o) const |
const char * | get (const object &o) const |
void | get (const object &o, std::string &result) const |
void | get (const object *o, std::string &result) const |
std::string | decode (const std::string &name) const |
Protected Member Functions | |
void | decode (char *dest, int &dpos, const char *src, int &spos) const |
Provides methods for getting the class names of lti::objects.
lti::className::className | ( | ) |
default constructor
lti::className::~className | ( | ) |
destructor
void lti::className::decode | ( | char * | dest, | |
int & | dpos, | |||
const char * | src, | |||
int & | spos | |||
) | const [protected] |
implementation of the native-to-readable decoding of class names.
std::string lti::className::decode | ( | const std::string & | name | ) | const |
decodes a typename returned by typeid().
You can use this to get decoded names for objects that are not derived from lti::object
void lti::className::get | ( | const object * | o, | |
std::string & | result | |||
) | const [inline] |
returns the name of this type (obtained by using the std::typeinfo functions).
The returned string considers the template arguments and is usually fully qualified.
void lti::className::get | ( | const object & | o, | |
std::string & | result | |||
) | const [inline] |
returns the name of this type (obtained by using the std::typeinfo functions).
The returned string considers the template arguments and is usually fully qualified.
const char* lti::className::get | ( | const object & | o | ) | const [inline] |
const char* lti::className::get | ( | const object * | o | ) | const |
returns the name of this type (obtained by using the std::typeinfo functions).
The returned string considers the template arguments and is usually fully qualified. The implementation should ensure that the returned name has the following format: <namespace>::<classname>::<innerclassname>::... Example:
lti::boundingBox<double>::parameters
WARNING: The function returns a pointer to an internal class member. So, the pointer is only valid for the lifetime of this object or until the next time get is called, whatever occurs first.