#include <abstract_creator.hpp>
Public Types | |
typedef T * | value_type |
Same as (T *). | |
typedef T | base_value_type |
Same as (T). | |
Static Public Member Functions | |
static bool | create (value_type &v, const std::string &implclass=std::string()) throw () |
Tries to create a value_type object, using classload<base_value_type>( key ) to create it. |
Definition at line 90 of file abstract_creator.hpp.
typedef T* s11n::Private::abstract_creator< T * >::value_type |
typedef T s11n::Private::abstract_creator< T * >::base_value_type |
static bool s11n::Private::abstract_creator< T * >::create | ( | value_type & | v, | |
const std::string & | implclass = std::string() | |||
) | throw () [inline, static] |
Tries to create a value_type object, using classload<base_value_type>( key ) to create it.
v is assigned to it's value, which may be 0. Returns true if an object is created, else false.
If the call succeeds, the caller owns the memory pointed to by v.
If implclass is NOT passed then it must guess and for polymorphic types it is likely to guess incorrectly. It relies on s11n_traits<base_value_type>::class_name(v) returning a valid value, which is normally only useful for monomorphic types and base-most Serializables in a registered hierarchy (which are, for s11n purposes, the same thing).
Maintenance note: new classloader registrations may need to be installed as new types show up, especially for streamables/PODs (because those aren't normally registered as classes), or this function won't handle them. In s11n this registration is handled by most of the various proxy installation macros. See the headers under s11n.net/s11n/proxy/pod_*.hpp for examples.
Definition at line 126 of file abstract_creator.hpp.