s11n::Private::abstract_creator< T * > Struct Template Reference

A specialization of abstract_creator to create objects on the heap, using the s11n::cl API. More...

#include <abstract_creator.hpp>

List of all members.

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.


Detailed Description

template<typename T>
struct s11n::Private::abstract_creator< T * >

A specialization of abstract_creator to create objects on the heap, using the s11n::cl API.

Definition at line 90 of file abstract_creator.hpp.


Member Typedef Documentation

template<typename T>
typedef T* s11n::Private::abstract_creator< T * >::value_type

Same as (T *).

Definition at line 93 of file abstract_creator.hpp.

template<typename T>
typedef T s11n::Private::abstract_creator< T * >::base_value_type

Same as (T).

Definition at line 96 of file abstract_creator.hpp.


Member Function Documentation

template<typename T>
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.


The documentation for this struct was generated from the following file:
Generated on Sun Apr 27 11:46:50 2008 for libs11n-1.2.6 by  doxygen 1.5.3