#include <NArgs.h>
Inherited by AbsFunction, FidAlarmCounterFunc, IntFunction, LRSecToMinFunction, MinOrMaxFunction< minOrMax >, PadFunction, RandFunction, SequenceFunction, and StrLenFunction.
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< Expression > | makeExpression (const NArgs &args)=0 throw ( ExprException ) |
Generates a function implementation. |
|
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.
|