Maps names to objects. More...
#include <keyvalue/key/map/ObjectMap.h>
Public Types | |
typedef value::PtrTraits < ObjectType >::Type_ | OutputType_ |
Public Member Functions | |
OutputType_ | map (const value::Variant &variant) const |
Performs the mapping. | |
Private Member Functions | |
virtual string | getName () const =0 |
Gets Key's name. |
Maps names to objects.
A name (string
) is mapped to (a pointer to) an object having that name. The mapping is performed by the Repository.
When the object's name is not found in the Repository, an attempt to build one from the given input (a value::Variant object) is done.
This map policy is automatically chosen by Traits when OutputType is not considered a basic type (see Default documentation). Hence, most users can ignore this map.
ObjectType | : (template parameter) The type of output object. |
OutputType_ | : Same as shared_ptr<ObjectType> . |
ObjectMap< ObjectType >::OutputType_ map | ( | const value::Variant & | variant | ) | const |
Performs the mapping.
variant | : A value::Variant containing the object's name. |