Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

Function Class Reference

#include <NArgs.h>

Inherited by AbsFunction, FidAlarmCounterFunc, IntFunction, LRSecToMinFunction, MinOrMaxFunction< minOrMax >, PadFunction, RandFunction, SequenceFunction, and StrLenFunction.

List of all members.


Detailed Description

A function factory, capable of returning a function implementation given a statically typed set of arguments.

To create a custom function, create a subclass of Function that implements makeExpression(). Include the AURORA_DECLARE_FUNCTION(ClassName) macro in the class declaration, and the AURORA_DEFINE_FUNCTION(ClassName, "funcname") macro outside the class declaration, where ClassName is the name of the subclass and "funcname" is the name of the function that will be used in expressions.

See plugin/src/RandFunction.C for an example.


Public Member Functions

virtual ptr< ExpressionmakeExpression (const NArgs &args)=0 throw ( ExprException )
 Generates a function implementation.


Member Function Documentation

virtual ptr<Expression> Function::makeExpression const NArgs args  )  throw ( ExprException ) [pure virtual]
 

Generates a function implementation.

This method should examine the given set of arguments, throwing an AuroraException if they are not valid (e.g., there are too many or too few, or the types are not correct). It should then return an Expression that can be evaluated to determine the result of the function. (Generally, the returned Expression will be a TypedExpression<T>, where T is the return type of the function.)

Implemented in PadFunction, MinOrMaxFunction< minOrMax >, FidAlarmCounterFunc, LRSecToMinFunction, and RandFunction.


The documentation for this class was generated from the following file:
Generated on Fri Nov 12 15:15:23 2004 for Borealis by doxygen 1.3.8