ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::expressions::plugins::Calculus::FunctionEntry Struct Reference

Description:

An entry of field Functions. Describes how the function is recognized and the callback function and return type for it.

Definition at line 286 of file calculus.inl.

Collaboration diagram for alib::expressions::plugins::Calculus::FunctionEntry:
[legend]

Public Field Index:

CallbackDecl Callback
 
const char * DbgCallbackName
 
Token Descriptor
 The name, minimum length and letter case sensitivity of the function to recognize.
 
CTInvokable IsCTInvokable
 
BoxResultType
 
Box ** Signature
 
size_t SignatureLength
 See Signature for more information.
 

Field Details:

◆ Callback

CallbackDecl alib::expressions::plugins::Calculus::FunctionEntry::Callback

Callback function to add to the program. If nullptr, field ResultType is used as both: a constant value added to the program and the result type!

Definition at line 311 of file calculus.inl.

◆ DbgCallbackName

const char* alib::expressions::plugins::Calculus::FunctionEntry::DbgCallbackName

The C++ name of the callback function (only available with debug-builds of the library. Use preprocessor macro CALCULUS_CALLBACK to provide this field together with field Callback. The macro selects to prune the name string in release compilations.

Definition at line 319 of file calculus.inl.

◆ Descriptor

Token alib::expressions::plugins::Calculus::FunctionEntry::Descriptor

The name, minimum length and letter case sensitivity of the function to recognize.

Definition at line 289 of file calculus.inl.

◆ IsCTInvokable

CTInvokable alib::expressions::plugins::Calculus::FunctionEntry::IsCTInvokable

Denotes, if the callback function is allowed to be invoked on the Scope object used at compile-time. This scope object is of the same (eventually custom) type as the one for evaluation, however the evaluation-specific data is not set. If allowed, such invocation is performed, if all function arguments are constant and instead of the function, the result is returned.

Definition at line 338 of file calculus.inl.

◆ ResultType

Box* alib::expressions::plugins::Calculus::FunctionEntry::ResultType

The result type given as a pointer to a sample box.

Note
If Callback is nullptr, this box changes its meaning from being just a sample that provides the return type of the callback function, to being the 'real' constant result value that the function represents. However, it is preferable, to implement such constant functions using field Calculus::ConstantIdentifiers

Definition at line 330 of file calculus.inl.

◆ Signature

Box** alib::expressions::plugins::Calculus::FunctionEntry::Signature

A pointer to list of pointers to sample boxes that describe the function signature. If nullptr, then the function does not accept parameters (aka is an identifier).

To denote variadic parameters (similar to C/C++ ellipsis operator "..." ), either nullptr or a void box may be given as the last array element. All prior provided boxes represent mandatory arguments, while the function accepts an arbitrary number of arguments of arbitrary types in addition.

The length of this list is given with field SignatureLength.

See also
Macro CALCULUS_SIGNATURE which is recommended to be used to pass both fields (this and SignatureLength). The macro accepts a C++ array of Box* and deducts the array's length from the declaration type of the given array.

Definition at line 304 of file calculus.inl.

◆ SignatureLength

size_t alib::expressions::plugins::Calculus::FunctionEntry::SignatureLength

See Signature for more information.

Definition at line 307 of file calculus.inl.


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