corelinux_Builder3
Builder seperates the construction of a complex object from its representation so that the same construction process can create different representations.
Usage
Public Member Functions
Builder (AbstractFactory<
UniqueId
>
*aAbstractFactory)
throw
(
Assertion
)
Retrieve the
AbstractFactory.
virtual
ProductImpl
*
create
(void)
Protected Member Functions
Builder (void)
throw
(Assertion)
Pure virtual
createProduct.
virtual
void
destroyProduct
(ProductImpl
*)
const
=0
Pure virtual
destroyProduct.
Protected Attributes
ProductImpl *
theCurrentProduct
Detailed Description
template<class ProductImpl, class UniqueId> class corelinux::Builder< ProductImpl, UniqueId >
Builder seperates the construction of a complex object from its representation so that the same construction process can create different representations.
This differs from AbstractFactory in that the Factory creates parts and Builder creates Products (assembled parts).
See also:
AbstractFactory, Allocator, AbstractAllocator
Constructor & Destructor Documentation
template<class ProductImpl, class UniqueId> corelinux::Builder< ProductImpl, UniqueId >::Builder (AbstractFactory< UniqueId > * aAbstractFactory) throw ( Assertion ) [inline]
Default constructor requires a abstract factory for building the product parts. Parameters:
AbstractFactory .RE
template<class ProductImpl, class UniqueId> corelinux::Builder< ProductImpl, UniqueId >::Builder (const Builder< ProductImpl, UniqueId > & aBuilder) throw ( Assertion ) [inline]
Copy constructor creates a new instance of the reference abstract factory. Parameters:
Builder const reference
Member Function Documentation
template<class ProductImpl, class UniqueId> virtual ProductImpl* corelinux::Builder< ProductImpl, UniqueId >::create (void) [inline, virtual]
Default create routine invokes the implementation createProduct method. Returns:
ProductImpl pointer
template<class ProductImpl, class UniqueId> virtual void corelinux::Builder< ProductImpl, UniqueId >::destroy (ProductImpl * aPtr) [inline, virtual]
Default destroy routine invokes the implementation destroyProduct method. Parameters:
ProductImpl pointer
template<class ProductImpl, class UniqueId> virtual ProductImpl* corelinux::Builder< ProductImpl, UniqueId >::getCurrentProduct (void) const [inline, virtual]
Retrieves the current product. Returns:
ProductImpl pointer
template<class ProductImpl, class UniqueId> Builder& corelinux::Builder< ProductImpl, UniqueId >::operator= (const Builder< ProductImpl, UniqueId > & aRef) [inline]
Operation assignment. Uses the same factory as the reference after destroying theCurrentProduct.
Parameters:
Builder const reference
Returns:
Builder reference
template<class ProductImpl, class UniqueId> bool corelinux::Builder< ProductImpl, UniqueId >::operator== (const Builder< ProductImpl, UniqueId > & aRef) [inline]
Equality operator. Parameters:
Builder const reference
Returns:
bool - true if same Builder instance
History
- Debian 3.1 (Sarge): the text shown here
- Debian 3.0 (Woody)