s11n::cl::object_factory< InterfaceBase > Struct Template Reference

A default object factory functor for use with the s11n::s11n_traits type. More...

#include <classload.hpp>

List of all members.

Public Types

typedef InterfaceBase base_type
 Same as InterfaceBase.

Public Member Functions

base_typeoperator() (const std::string &key) const
 The default implementation returns s11n::fac::factory<InterfaceBase>().create(key).


Detailed Description

template<typename InterfaceBase>
struct s11n::cl::object_factory< InterfaceBase >

A default object factory functor for use with the s11n::s11n_traits type.

Clients may specialize this to return objects from their own factories. By default it uses s11n::fac's mini-framework, and thus can load any type registered with that API.

Definition at line 56 of file classload.hpp.


Member Typedef Documentation

template<typename InterfaceBase>
typedef InterfaceBase s11n::cl::object_factory< InterfaceBase >::base_type

Same as InterfaceBase.

Definition at line 59 of file classload.hpp.


Member Function Documentation

template<typename InterfaceBase>
base_type* s11n::cl::object_factory< InterfaceBase >::operator() ( const std::string &  key  )  const

The default implementation returns s11n::fac::factory<InterfaceBase>().create(key).

The caller owns the returned pointer, which may be 0.

If the underlying factory does not have the requested class and s11n is built with the s11n::plugin layer, then s11n::plugin::open(classname) is used to search for a DLL. Under the s11n classloader model, opening a plugin will register classes defined in the plugin back with the factory.

This function propagates exceptions if the underlying factory's create() feature throws.

Changed in 1.3.0: this now propogates exceptions as-is, instead of re-wrapping certain exception types as s11n_exceptions.


The documentation for this struct was generated from the following file:
Generated on Sun Apr 27 13:16:05 2008 for libs11n by  doxygen 1.5.3