Primary template class
for XBuilder's specializations.
More...
#include "keyvalue/mngt/XBuilder.h"
Public Member Functions | |
shared_ptr< ObjectType > | getObject (const value::Variant &data) const |
Gets the result of processing a value::Variant. | |
const char * | getName () const |
Gets Builder's name. | |
value::Result | getResult (const DataSet &data) const |
Gets result of processing a DataSet. | |
value::Result | getResult (const value::Variant &data) const |
Gets result of processing a value::Variant. | |
virtual shared_ptr< ObjectType > | getObject (const DataSet &data) const |
Gets the result of processing a DataSet. | |
Static Public Member Functions | |
static Builder & | getInstance () |
Gets the unique instance of a XBuilder specialization. | |
Static Protected Member Functions | |
static void | setGetter (Builder &(*getter)()) |
Sets the point of acess to the unique instance of a Builder specialization. | |
Static Private Member Functions | |
static Builder & | getSingleton () |
Gets the unique instance of an XBuilder specialization. |
Primary template class
for XBuilder's specializations.
This template class<> extends Builder through
public
inheritance. While a regular Builder specialization needs a DataSet to store the data needed to construct an object, the XBuilder can construct from a single value::Variant input.
Builder< ObjectType > & getInstance | ( | ) | [inline, static] |
Gets the unique instance of a XBuilder specialization.
This method calls Builder::setGetter() to set method getSingleton() below as the point of access to the unique instance of the corresponding Builder specialization. Then it returns this instance.
return A reference to the unique instance of an XBuilder specialization.
Reimplemented from Builder< ObjectType >.
shared_ptr<ObjectType> getObject | ( | const value::Variant & | data | ) | const [virtual] |
Gets the result of processing a value::Variant.
The implementation must be provided by specializations.
data | : Input value::Variant. |
Reimplemented from Builder< ObjectType >.
Builder< ObjectType > & getSingleton | ( | ) | [inline, static, private] |
Gets the unique instance of an XBuilder specialization.
return A reference to the unique instance of an XBuilder specialization.
Reimplemented from Builder< ObjectType >.
const char* getName | ( | ) | const [virtual, inherited] |
value::Result getResult | ( | const DataSet & | data | ) | const [inline, virtual, inherited] |
value::Result getResult | ( | const value::Variant & | data | ) | const [inline, virtual, inherited] |
Gets result of processing a value::Variant.
A redirection to getObject(const value::Variant& data).
data | : value::Variant to be processed. |
Implements Processor.
virtual shared_ptr<ObjectType> getObject | ( | const DataSet & | data | ) | const [virtual, inherited] |
void setGetter | ( | Builder< ObjectType > &(*)() | getter | ) | [inline, static, protected, inherited] |
Sets the point of acess to the unique instance of a Builder specialization.
Each specialization of this template class
must be a singleton and the getInstance() method above gives acess to this unique instance.
However, trough public
inheritance, a Buider specialization can be extended to an XBuilder one. In this case, the unique accesible instance of a Builder specialization must be an instance of an XBuilder specialization. Therefore, each XBuilder specialization must register itself as the provider of the unique instance of the Builder specialization which is returned by getInstance().
The registration is done by calling this method and providing a global point of access to the unique instance of the Builder specialization.
: | A pointer to a funtion which returns a reference to the unique instance of a Builder specialization. |