Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 55 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 58 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.

a) s11n_exceptions are passed on as-is.

b) std::exceptions are translated to s11n::factory_exceptions, keeping the what() text.

c) Unknown exceptions (...) are translated to s11n::factory_exceptions with an unspecified non-empty what() text.


The documentation for this struct was generated from the following file:
Generated on Mon Dec 26 15:53:18 2005 for libs11n-1.2.3 by  doxygen 1.4.4