Abstract base class
of all Builders.
More...
#include <keyvalue/mngt/AbstractBuilder.h>
Public Member Functions | |
template<typename ObjectType > | |
bool | canBuild () const |
Checks if the Builder can build objects of a given type. | |
virtual const ::std::type_info & | getObjectType () const =0 |
Gets Builder's ObjectType. | |
virtual const char * | getName () const =0 |
Gets Processor's name. | |
Private Member Functions | |
virtual void | thrower () const =0 |
Throws a pointer defining the object built by the concrete Builder. |
Abstract base class
of all Builders.
bool canBuild | ( | ) | const |
virtual const ::std::type_info& getObjectType | ( | ) | const [pure virtual] |
Gets Builder's ObjectType.
std::type_info
of Builder<span>'s ObjectType. Implemented in Builder< Tag >.
virtual void thrower | ( | ) | const [private, pure virtual] |
Throws a pointer defining the object built by the concrete Builder.
This method is a helper to canBuild(). Recall that each concrete Builder builds a different type of object. Therefore, concrete Builders must implement this method which just throws a (null) pointer of type ObjectType* where ObjectType is the type of object that the Builder can build.
The idea is the same used in util::AnyPtr to cast its internal pointer as explained in
Neri, C, "Twisting the RTTI System for Safe Dynamic Casts of void* in C++", Dr.Dobb's Journal, April 05, 2011. http://drdobbs.com/cpp/229401004
\e | ObjectType* : Always throws. |
virtual const char* getName | ( | ) | const [pure virtual, inherited] |