Loading...
Searching...
No Matches
casacore::EclecticFunctionFactory< T > Class Template Reference
scimath package (libcasa_scimath) » Functionals_module

More...

`#include <EclecticFunctionFactory.h>`

## Public Member Functions

| EclecticFunctionFactory ()
| create an empty EclecticFunctionFactory
| EclecticFunctionFactory (const EclecticFunctionFactory &factory)
| create a shallow copy of another EclecticFunctionFactory
virtual | ~EclecticFunctionFactory ()
| delete this EclecticFunctionFactory.
virtual Function< T > * | create (const Record &) const throw (FunctionFactoryError)
| create the Function object described in the given Record.
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.
Int | ndefined ()
| return the number of factories that have been loaded thus far.
Bool | isDefined (const String &type)
| return True if a factory with a given "functype" name has been loaded.
EclecticFunctionFactory & | operator= (const EclecticFunctionFactory &factory)
| a shallow assignment operator
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

- FunctionFactory

### 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

Definition at line 106 of file EclecticFunctionFactory.h.

## Constructor & Destructor Documentation

## EclecticFunctionFactory() [1/2]

template<class T>

casacore::EclecticFunctionFactory< T >::EclecticFunctionFactory | ( |  | ) |

create an empty EclecticFunctionFactory

Referenced by EclecticFunctionFactory(), and operator=().

## EclecticFunctionFactory() [2/2]

template<class T>

casacore::EclecticFunctionFactory< T >::EclecticFunctionFactory | ( | const EclecticFunctionFactory< T > & | factory | ) |

create a shallow copy of another EclecticFunctionFactory

References 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.

References casacore::FunctionFactory< T >::FunctionFactory(), and casacore::True.

## 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 >.

References casacore::Record().

## 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 138 of file EclecticFunctionFactory.h.

References 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 134 of file EclecticFunctionFactory.h.

References lookup.

## operator=()

template<class T>

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

a shallow assignment operator

References EclecticFunctionFactory().

## Member Data Documentation

## lookup

template<class T>

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

private

Definition at line 146 of file EclecticFunctionFactory.h.

Referenced by isDefined(), and ndefined().

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

- scimath/Functionals/EclecticFunctionFactory.h