Oracle Coherence for C++ API


factory Class Template Reference

#include <coherence/lang/lang_spec.hpp>

List of all members.

Detailed Description

template<class T>
class coherence::lang::factory< T >

The factory class auto-generates static create methods for a class, corresponding to the class's constructors.

The factory must be made a friend of the defined class so that it may access the protected constructors.

The factory is used by class specifications to provide the class with static create methods. i.e. the result of using a class_spec when defining class Foo will result in Foo having auto-generated static create methods. Direct use of the factory for class instantiation is not supported.

The factory supports constructors from zero to sixteen parameters. To help the template system it is best (though not required) that there are not multiple constructors with the same number of parameters. Classes wishing to provide custom create methods may simply define them in their class, and these will override and hide the factory auto-generated versions.

See also:



mf 2008.07.14

Static Protected Member Functions

static T * create ()
 Generate a set of static "create" methods matching the signatures of class T's constructors.

Member Function Documentation

static T* create (  )  [inline, static, protected]

Generate a set of static "create" methods matching the signatures of class T's constructors.

NOTE: Compilation errors referencing this line likely indicate that the parameters supplied by the caller to the create method did not match one of the constructors.

The documentation for this class was generated from the following file:
Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.