ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
No Matches
Calculus::FunctionEntry Struct Reference


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

Definition at line 321 of file calculus.hpp.

#include <calculus.hpp>

Collaboration diagram for Calculus::FunctionEntry:

Public Field Index:

CallbackDecl Callback
const char * DbgCallbackName
Token Descriptor
CTInvokable IsCTInvokable
Box ** Signature
size_t SignatureLength

Field Details:

◆ Callback

CallbackDecl 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 350 of file calculus.hpp.

◆ DbgCallbackName

const char* 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 359 of file calculus.hpp.

◆ Descriptor

Token Descriptor

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

Definition at line 324 of file calculus.hpp.

◆ IsCTInvokable

CTInvokable 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 382 of file calculus.hpp.

◆ ResultType

Box* ResultType

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

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 372 of file calculus.hpp.

◆ Signature

Box** 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 amount of arguments of arbitrary type 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 341 of file calculus.hpp.

◆ SignatureLength

size_t SignatureLength

See Signature for more information.

Definition at line 346 of file calculus.hpp.

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