Assignments Assignments

Public Member Functions | Private Member Functions | Private Attributes | List of all members
Util::BaseFactory< BaseType > Class Template Referenceabstract

`#include <factory.h>`

Inheritance diagram for Util::BaseFactory< BaseType >:

## Public Member Functions
virtual | ~BaseFactory (void)
BaseType * | create (void)
template<typename DerivedType>
BaseType * | create (void)

## Private Member Functions
virtual BaseType * | _create (void)=0

## Private Attributes
std::vector< BaseType * > | _baseTypes

## Detailed Description

template<typename BaseType>
class Util::BaseFactory< BaseType >

This templated class represents a factory for generating objects of type BaseType. It tracks the objects created and deletes them in the destructor.

## Constructor & Destructor Documentation

## ◆ ~BaseFactory()

template<typename BaseType>

virtual Util::BaseFactory< BaseType >::~BaseFactory | ( | void |  | ) |
| inline virtual

The destructor is responsible for deallocating all the BaseType created

## Member Function Documentation

## ◆ _create()

template<typename BaseType>

virtual BaseType * Util::BaseFactory< BaseType >::_create | ( | void |  | ) |
| private pure virtual

The virtual method creating an object of type BaseType on the heap

Implemented in Util::DerivedFactory< BaseType, DerivedType >.

## ◆ create() [1/2]

template<typename BaseType>

BaseType * Util::BaseFactory< BaseType >::create | ( | void |  | ) |
| inline

The (publicly accessible) method for creating a new object

## ◆ create() [2/2]

template<typename BaseType>
template<typename DerivedType>

BaseType * Util::BaseFactory< BaseType >::create | ( | void |  | ) |
| inline

The method for creating a new derived object

## Member Data Documentation

## ◆ _baseTypes

template<typename BaseType>

std::vector< BaseType * > Util::BaseFactory< BaseType >::_baseTypes
| private

The list of BaseType created by the factory

The documentation for this class was generated from the following file:

- Assignments/Util/factory.h