casacore
Public Member Functions | Private Attributes | List of all members
casacore::EclecticFunctionFactory< T > Class Template Reference

More...

#include <EclecticFunctionFactory.h>

Public Member Functions

 EclecticFunctionFactory ()
 create an empty EclecticFunctionFactory More...
 
 EclecticFunctionFactory (const EclecticFunctionFactory &factory)
 create a shallow copy of another EclecticFunctionFactory More...
 
virtual ~EclecticFunctionFactory ()
 delete this EclecticFunctionFactory. More...
 
virtual Function< T > * create (const Record &) const throw (FunctionFactoryError)
 create the Function object described in the given Record. More...
 
void addFactory (const String &type, FunctionFactory< T > *factory, Bool own=True)
 add a factory for creating a specific type of function, associating it with a given "functype" name. More...
 
Int ndefined ()
 return the number of factories that have been loaded thus far. More...
 
Bool isDefined (const String &type)
 return True if a factory with a given "functype" name has been loaded. More...
 
EclecticFunctionFactoryoperator= (const EclecticFunctionFactory &factory)
 a shallow assignment operator More...
 
- Public Member Functions inherited from casacore::FunctionFactory< T >
 FunctionFactory ()
 
 FunctionFactory (const FunctionFactory< T > &factory)
 
virtual ~FunctionFactory ()
 
FunctionFactory< T > & operator= (const FunctionFactory< T > &factory)
 

Private Attributes

OrderedMap< String, OrderedPair< FunctionFactory< T > *, Bool > > lookup
 

Detailed Description

template<class T>
class casacore::EclecticFunctionFactory< T >

Intended use:

Public interface

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)

Thrown Exceptions

To Do

Definition at line 109 of file EclecticFunctionFactory.h.

Constructor & Destructor Documentation

◆ EclecticFunctionFactory() [1/2]

create an empty EclecticFunctionFactory

◆ EclecticFunctionFactory() [2/2]

template<class T >
casacore::EclecticFunctionFactory< T >::EclecticFunctionFactory ( const EclecticFunctionFactory< T > &  factory)

create a shallow copy of another EclecticFunctionFactory

◆ ~EclecticFunctionFactory()

template<class T >
virtual casacore::EclecticFunctionFactory< T >::~EclecticFunctionFactory ( )
virtual

delete this EclecticFunctionFactory.

Those specific factories added via addFactory() with own=True will be deleted.

Member Function Documentation

◆ addFactory()

template<class T >
void casacore::EclecticFunctionFactory< T >::addFactory ( const String type,
FunctionFactory< T > *  factory,
Bool  own = True 
)

add a factory for creating a specific type of function, associating it with a given "functype" name.

◆ create()

template<class T >
virtual Function<T>* casacore::EclecticFunctionFactory< T >::create ( const Record ) const
throw (FunctionFactoryError
)
virtual

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().

Implements casacore::FunctionFactory< T >.

◆ isDefined()

template<class T >
Bool casacore::EclecticFunctionFactory< T >::isDefined ( const String type)
inline

return True if a factory with a given "functype" name has been loaded.

Definition at line 141 of file EclecticFunctionFactory.h.

References casacore::EclecticFunctionFactory< T >::lookup.

◆ ndefined()

template<class T >
Int casacore::EclecticFunctionFactory< T >::ndefined ( )
inline

return the number of factories that have been loaded thus far.

Definition at line 137 of file EclecticFunctionFactory.h.

References casacore::EclecticFunctionFactory< T >::lookup.

◆ operator=()

template<class T >
EclecticFunctionFactory& casacore::EclecticFunctionFactory< T >::operator= ( const EclecticFunctionFactory< T > &  factory)

a shallow assignment operator

Member Data Documentation

◆ lookup

template<class T >
OrderedMap<String, OrderedPair<FunctionFactory<T>*, Bool> > casacore::EclecticFunctionFactory< T >::lookup
private

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