Public Types | Public Member Functions | Private Member Functions

ObjectMap< ObjectType > Class Template Reference

Maps names to objects. More...

#include <keyvalue/key/map/ObjectMap.h>

List of all members.

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.

Detailed Description

template<typename ObjectType>
class keyvalue::key::ObjectMap< ObjectType >

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.

Parameters:
ObjectType : (template parameter) The type of output object.
Return values:
OutputType_ : Same as shared_ptr<ObjectType>.

Member Function Documentation

ObjectMap< ObjectType >::OutputType_ map ( const value::Variant variant  )  const

Performs the mapping.

Parameters:
variant : A value::Variant containing the object's name.
Returns:
The mapping result.
virtual string getName (  )  const [private, pure virtual]

Gets Key's name.

Returns:
The Key's name.