Atlas-C++
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Atlas::Factory< T > Class Template Referenceabstract

Class factory. More...

#include <Factory.h>

Public Member Functions

 Factory (const std::string &name, const typename T::Metrics &metrics)
 
virtual T * New (const typename T::Parameters &)=0
 
virtual void Delete (T *)=0
 
std::string getName ()
 
T::Metrics getMetrics ()
 

Static Public Member Functions

static std::list< Factory * > * factories ()
 

Protected Attributes

std::string m_name
 
T::Metrics m_metrics
 

Detailed Description

template<typename T>
class Atlas::Factory< T >

Class factory.

Factory is a template class for automatic registration, construction and destruction of particular classes. It is used by creating a static instance for each class that requires it. Each registered class specifies a name and Metrics (can be any class) that is used when enumerating the classes for the purposes of negotiation. Each class also declares a Parameters structure, which is passed to the constructor of the class at creation time by the factory.

Both Codec and Filter specialise Factory and use it for class registration.

See also
Codec
Filter
Negotiate

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

Copyright 2000-2004 the respective authors.

This document can be licensed under the terms of the GNU Free Documentation License or the GNU General Public License and may be freely distributed under the terms given by one of these licenses.