EclecticFunctionFactory.h
Classes
- EclecticFunctionFactory --
(full description)
Interface
- Public Members
- EclecticFunctionFactory()
- EclecticFunctionFactory(const EclecticFunctionFactory& factory)
- virtual ~EclecticFunctionFactory()
- virtual Function<T> *create(const Record&) const throw(FunctionFactoryError)
- void addFactory(const String& type, FunctionFactory<T> *factory, Bool own=True)
- Int ndefined()
- Bool isDefined(const String& type)
- EclecticFunctionFactory& operator=(const EclecticFunctionFactory& factory)
Review Status
- Date Reviewed:
- yyyy/mm/dd
Prerequisite
Etymology
This class is based on the Factory pattern, similar to the
ApplicationObjectFactory
Synopsis
Example
Motivation
Template Type Argument Requirements (T)
- Function must have a constructor for the form T(const Record&)
Thrown Exceptions
- UnrecognizedFunctionError by create() if the Record field
"functype" does not match a Function added via addFactory()
- InvalidSerializationError by create() if
- Record does not contain a "functype" field containing
a string
- the associated specific factory throws an
InvalidSerializationError
To Do
Member Description
create an empty EclecticFunctionFactory
create a shallow copy of another EclecticFunctionFactory
delete this EclecticFunctionFactory. Those specific factories added
via addFactory() with own=True will be deleted.
virtual Function<T> *create(const Record&) const throw(FunctionFactoryError)
create the Function object described in the given Record. This
implementation will use the value of the "functype" field to lookup
the specific factory to use to create the function. That is, the
the "functype" value will be matched against the type names loaded
via addFactory().
add a factory for creating a specific type of function, associating
it with a given "functype" name.
return the number of factories that have been loaded thus far.
return True if a factory with a given "functype" name has been
loaded.
EclecticFunctionFactory& operator=(const EclecticFunctionFactory& factory)
a shallow assignment operator