CVR-Lib last update 20 Sep 2009

cvr::className Class Reference

Provides methods for getting the class names of cvr::objects. More...

#include <cvrClassName.h>

List of all members.

Public Member Functions

 className ()
 ~className ()

Static Public Member Functions

static std::string get (const object *o)
static std::string get (const object &o)
static void get (const object &o, std::string &result)
static void get (const object *o, std::string &result)
static std::string demangle (const std::string &mangled)


Detailed Description

Provides methods for getting the class names of cvr::objects.

This class uses the std::string container to avoid possible memory leaks.


Constructor & Destructor Documentation

cvr::className::className (  ) 

Default constructor.

cvr::className::~className (  ) 

Destructor.


Member Function Documentation

static std::string cvr::className::demangle ( const std::string &  mangled  )  [static]

Demangle.

You can use this methods to gain the name of a class that is not inherited from cvr::object.

The input is the one given by typeid().name()

Example:

 cvr::point<float> p;
 std::string typeOfP = className::demangle(typeid(p).name());

Warning:
Remember that the pointer returned by typeid belongs to the system. You should never delete that pointer.

static void cvr::className::get ( const object o,
std::string &  result 
) [static]

Return the name of the given type.

This class uses the std::typeinfo functions, but it "demangles" the output to produce a valid C++ type name, i.e. the returned string considers the template arguments and is usually fully qualified.

The implementations should ensure that the returned name has the following format:

<namespace>::<classname>::<innerclassname>::...

Example:

 cvr::boundingBox<double>::parameters

The name is returned in the result parameter. This is a much safer method than the method returning a pointer.

static void cvr::className::get ( const object o,
std::string &  result 
) [static]

Return the name of the given type.

This class uses the std::typeinfo functions, but it "demangles" the output to produce a valid C++ type name, i.e. the returned string considers the template arguments and is usually fully qualified.

The implementations should ensure that the returned name has the following format:

<namespace>::<classname>::<innerclassname>::...

Example:

 cvr::boundingBox<double>::parameters

The name is returned in the result parameter. This is a much safer method than the method returning a pointer.

static std::string cvr::className::get ( const object o  )  [static]

Return the name of the given object.

See also:
get(const object*)

static std::string cvr::className::get ( const object o  )  [static]

Return the name of the given type.

This class uses the std::typeinfo functions, but it "demangles" the output to produce a valid C++ type name, i.e. the returned string considers the template arguments and is usually fully qualified.

The implementations should ensure that the returned name has the following format:

<namespace>::<classname>::<innerclassname>::...

Example:

 cvr::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.


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

Generated on Sun Sep 20 22:08:39 2009 for CVR-Lib by Doxygen 1.5.8