diff --git a/factory/doc/factory.qbk b/factory/doc/factory.qbk index 487537c..cac614b 100644 --- a/factory/doc/factory.qbk +++ b/factory/doc/factory.qbk @@ -107,7 +107,7 @@ interfaces. // [...] - std::auto_ptr x = factories[some_name]->create(); + std::auto_ptr x(factories.at(some_name).create()); // [...] } diff --git a/factory/doc/html/index.html b/factory/doc/html/index.html index 93ce15f..2f14b71 100644 --- a/factory/doc/html/index.html +++ b/factory/doc/html/index.html @@ -1,10 +1,10 @@ - -Chapter 1. Boost.Functional/Factory 1.0 - - - + +Chapter 1. Boost.Functional/Factory 1.0 + + + @@ -17,16 +17,16 @@

-
+

-Chapter 1. Boost.Functional/Factory 1.0

+Chapter 1. Boost.Functional/Factory 1.0

Tobias Schwinger

-
+
-

+

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

@@ -37,14 +37,15 @@
Brief Description
Background
-
Reference
+
Reference
Acknowledgements
References
-

The template boost::factory lets you encapsulate a new expression as a function object, boost::value_factory encapsulates a constructor invocation without new. @@ -61,9 +62,10 @@ or boost::bind.

-

In traditional Object Oriented Programming a Factory is an object implementing an interface of one or more methods that construct objects conforming to known @@ -112,7 +114,7 @@ // [...] - std::auto_ptr<an_abstract_factory> x = factories[some_name]->create(); + std::auto_ptr<an_abstract_class> x(factories.at(some_name).create()); // [...] } @@ -130,7 +132,7 @@ objects, o we might not necessarily need a polymorphic base class for the objects, o as we will see, we do not need a factory base class at all, -o we might want to just call the constructor - without #new# to create +o we might want to just call the constructor - without `new` to create an object on the stack, and o finally we might want to use customized memory management. @@ -246,33 +248,35 @@ Smart Pointers.

- - +
+ + Description +

Function object template that invokes the constructor of the type T.

-

- - Header -

+
+ + Header +
#include <boost/functional/value_factory.hpp>
 
-

- - Synopsis -

+
+ + Synopsis +
namespace boost
 {
     template< typename T >
@@ -284,27 +288,27 @@
 
T

- an arbitrary type with at least one public constructor -

+ an arbitrary type with at least one public constructor +

a0...aN

- argument LValues to a constructor of T -

+ argument LValues to a constructor of T +

F

- the type value_factory<F> -

+ the type value_factory<F> +

f

- an instance object of F -

+ an instance object of F +

-

- - Expression +

+ + Expression Semantics -
+
@@ -312,83 +316,84 @@
-

- Expression -

+

+ Expression +

-

- Semantics -

+

+ Semantics +

-

- F() -

+

+ F() +

-

- creates an object of type F. -

+

+ creates an object of type F. +

-

- F(f) -

+

+ F(f) +

-

- creates an object of type F. -

+

+ creates an object of type F. +

-

- f(a0...aN) -

+

+ f(a0...aN) +

-

- returns T(a0...aN). -

+

+ returns T(a0...aN). +

-

- F::result_type -

+

+ F::result_type +

-

- is the type T. -

+

+ is the type T. +

-

- - Limits -

+
+ + Limits +

The macro BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY can be defined to set the maximum arity. It defaults to 10.

-
+
+
+ + Description +

Function object template that dynamically constructs a pointee object for the type of pointer given as template argument. Smart pointers may be used @@ -396,12 +401,12 @@ yields the pointee type.

- If an _allocator_ is given, it is used + If an _allocator_ is given, it is used for memory allocation and the placement form of the new operator is used to construct the object. A function object that calls the destructor and deallocates the memory with a copy of the Allocator is used for the second constructor argument of Pointer - (thus it must be a __smartpointer_ + (thus it must be a _smart_pointer_ that provides a suitable constructor, such as boost::shared_ptr).

@@ -409,16 +414,16 @@ the allocator itself is used for the third constructor argument of Pointer (boost::shared_ptr then uses the allocator to manage the memory of its seperately allocated reference counter).

-

- - Header -

+
+ + Header +
#include <boost/functional/factory.hpp>
 
-

- - Synopsis -

+
+ + Synopsis +
namespace boost
 {
     enum factory_alloc_propagation
@@ -439,31 +444,31 @@
 
T

- an arbitrary type with at least one public constructor -

+ an arbitrary type with at least one public constructor +

P

- pointer or smart pointer to T -

+ pointer or smart pointer to T +

a0...aN

- argument LValues to a constructor of T -

+ argument LValues to a constructor of T +

F

- the type factory<P> -

+ the type factory<P> +

f

- an instance object of F -

+ an instance object of F +

-

- - Expression +

+ + Expression Semantics -
+
@@ -471,83 +476,84 @@
-

- Expression -

+

+ Expression +

-

- Semantics -

+

+ Semantics +

-

- F() -

+

+ F() +

-

- creates an object of type F. -

+

+ creates an object of type F. +

-

- F(f) -

+

+ F(f) +

-

- creates an object of type F. -

+

+ creates an object of type F. +

-

- f(a0...aN) -

+

+ f(a0...aN) +

-

- dynamically creates an object of type T - using a0...aN as arguments for the constructor - invocation. -

+

+ dynamically creates an object of type T + using a0...aN as arguments for the constructor + invocation. +

-

- F::result_type -

+

+ F::result_type +

-

- is the type P with - top-level cv-qualifiers removed. -

+

+ is the type P with + top-level cv-qualifiers removed. +

-

- - Limits -

+
+ + Limits +

The macro BOOST_FUNCTIONAL_FACTORY_MAX_ARITY can be defined to set the maximum arity. It defaults to 10.

-

Eric Niebler requested a function to invoke a type's constructor (with the arguments supplied as a Tuple) as a Fusion feature. These Factory utilities @@ -565,26 +571,27 @@ and their evolution.

-
+
-
    -
  1. -Design Patterns, - Gamma et al. - Addison Wesley Publishing, 1995 -
  2. -
  3. -Standard Template Library Programmer's - Guide, Hewlett-Packard Company, 1994 -
  4. -
  5. -Boost.Bind, - Peter Dimov, 2001-2005 -
  6. -
  7. -Boost.Function, - Douglas Gregor, 2001-2004 -
  8. +References +
+
    +
  1. + Design Patterns, + Gamma et al. - Addison Wesley Publishing, 1995 +
  2. +
  3. + Standard Template Library Programmer's + Guide, Hewlett-Packard Company, 1994 +
  4. +
  5. + Boost.Bind, + Peter Dimov, 2001-2005 +
  6. +
  7. + Boost.Function, + Douglas Gregor, 2001-2004 +