#include <Builder.hpp>
Public Member Functions | |
| Builder (AbstractFactory< UniqueId > *aAbstractFactory) throw ( Assertion ) | |
| Default constructor requires a abstract factory for building the product parts. | |
| Builder (const Builder &aBuilder) throw ( Assertion ) | |
| Copy constructor creates a new instance of the reference abstract factory. | |
| virtual | ~Builder (void) |
| Virtual destructor. | |
| Builder & | operator= (const Builder &aRef) |
| Operation assignment. | |
| bool | operator== (const Builder &aRef) |
| Equality operator. | |
| virtual ProductImpl * | getCurrentProduct (void) const |
| Retrieves the current product. | |
| virtual CountCref | getProductCreates (void) const |
| Retrieve the product create counts. | |
| virtual CountCref | getProductDestroys (void) const |
| Retrieve the product destroy counts. | |
|
virtual AbstractFactory < UniqueId > * | getFactory (void) const |
| Retrieve the AbstractFactory. | |
| virtual ProductImpl * | create (void) |
| Default create routine invokes the implementation createProduct method. | |
| virtual void | destroy (ProductImpl *aPtr) |
| Default destroy routine invokes the implementation destroyProduct method. | |
Protected Member Functions | |
| Builder (void) throw (Assertion) | |
| Default constructor not supported. | |
| void | incrementCreates (void) |
| Increment the creates. | |
| void | incrementDestroys (void) |
| Increment the destroys. | |
| virtual ProductImpl * | createProduct (void) const =0 |
| Pure virtual createProduct. | |
| virtual void | destroyProduct (ProductImpl *) const =0 |
| Pure virtual destroyProduct. | |
Protected Attributes | |
| ProductImpl * | theCurrentProduct |
| The product that was most recently built. | |
| AbstractFactory< UniqueId > * | theFactory |
| The factory for creating parts. | |
| Count | theProductCreates |
| The count of creates. | |
| Count | theProductDestroys |
| The count of destroys. | |
This differs from AbstractFactory in that the Factory creates parts and Builder creates Products (assembled parts).
| corelinux::Builder< ProductImpl, UniqueId >::Builder | ( | AbstractFactory< UniqueId > * | aAbstractFactory | ) | throw ( Assertion ) [inline] |
Default constructor requires a abstract factory for building the product parts.
| AbstractFactory |
References corelinux::Builder< ProductImpl, UniqueId >::theFactory.
| corelinux::Builder< ProductImpl, UniqueId >::Builder | ( | const Builder< ProductImpl, UniqueId > & | aBuilder | ) | throw ( Assertion ) [inline] |
Copy constructor creates a new instance of the reference abstract factory.
| Builder | const reference |
References corelinux::Builder< ProductImpl, UniqueId >::theFactory.
| Builder& corelinux::Builder< ProductImpl, UniqueId >::operator= | ( | const Builder< ProductImpl, UniqueId > & | aRef | ) | [inline] |
Operation assignment.
Uses the same factory as the reference after destroying theCurrentProduct.
| Builder | const reference |
References corelinux::Builder< ProductImpl, UniqueId >::destroy(), corelinux::Builder< ProductImpl, UniqueId >::getFactory(), corelinux::Builder< ProductImpl, UniqueId >::theCurrentProduct, corelinux::Builder< ProductImpl, UniqueId >::theFactory, corelinux::Builder< ProductImpl, UniqueId >::theProductCreates, and corelinux::Builder< ProductImpl, UniqueId >::theProductDestroys.
| bool corelinux::Builder< ProductImpl, UniqueId >::operator== | ( | const Builder< ProductImpl, UniqueId > & | aRef | ) | [inline] |
| virtual ProductImpl* corelinux::Builder< ProductImpl, UniqueId >::getCurrentProduct | ( | void | ) | const [inline, virtual] |
Retrieves the current product.
References corelinux::Builder< ProductImpl, UniqueId >::theCurrentProduct.
| virtual ProductImpl* corelinux::Builder< ProductImpl, UniqueId >::create | ( | void | ) | [inline, virtual] |
Default create routine invokes the implementation createProduct method.
References corelinux::Builder< ProductImpl, UniqueId >::createProduct(), corelinux::Builder< ProductImpl, UniqueId >::incrementCreates(), and corelinux::Builder< ProductImpl, UniqueId >::theCurrentProduct.
| virtual void corelinux::Builder< ProductImpl, UniqueId >::destroy | ( | ProductImpl * | aPtr | ) | [inline, virtual] |
Default destroy routine invokes the implementation destroyProduct method.
| ProductImpl | pointer |
References corelinux::Builder< ProductImpl, UniqueId >::destroyProduct(), corelinux::Builder< ProductImpl, UniqueId >::incrementDestroys(), and corelinux::Builder< ProductImpl, UniqueId >::theCurrentProduct.
Referenced by corelinux::Builder< ProductImpl, UniqueId >::operator=().