CONZEPT 16 C++ API
C16::Procedure::Execution Class Reference

Execution of a procedure. More...

#include "C16/Procedure.hpp"

Detailed Description

Execution of a procedure.

Classes

class  Exception
 Exception of the execution of a procedure. More...
 

Public Types

enum  Error { ,
  Error::STACK_OVERFLOW = -160, Error::PROCEDURE_CODE_INEXISTENT = -161, Error::PROCEDURE_CODE_INCOMPATIBLE = -162, Error::MEMORY_EXHAUSTED = -164,
  Error::PROCEDURE_CALL_OLD = -169, Error::PROCEDURE_INEXISTENT = -170, Error::DATA_AREA_INEXISTENT = -171, Error::DATA_AREA_DIFFERENT = -172,
  Error::DATA_AREA_NOT_INSTANCED = -173, Error::FUNCTION_INEXISTENT = -174, Error::ARGUMENTS_DIFFERENT = -175, Error::FIELD_INEXISTENT = -176,
  Error::TYPE_DIFFERENT = -177, Error::ARRAY_INDEX_INVALID = -178, Error::VALUE_OVERFLOW = -179, Error::STRING_LENGTH_EXCEEDED = -180,
  Error::DIVISION_BY_ZERO = -181, Error::VALUE_OUT_OF_DOMAIN = -182, Error::VALUE_OUT_OF_RANGE = -183, Error::TABLE_INEXISTENT = -184,
  Error::SUBRECORD_INEXISTENT = -185, Error::KEY_INEXISTENT = -186, Error::LINK_INEXISTENT = -187, Error::VALUE_INVALID = -188,
  Error::KEY_FIELD_INEXISTENT = -189, Error::LINK_FIELD_INEXISTENT = -190, Error::HANDLE_INVALID = -191, Error::ARGUMENT_MISSING = -192,
  Error::LINK_INVALID = -193, Error::TABLE_INVALID = -194, Error::SELECTIONS_HAVE_VALUE_SET = -195, Error::SELECTIONS_SORT_DIFFERENT = -196,
  Error::SELECTIONS_IDENTICAL = -197, Error::PROPERTY_INVALID = -199, Error::DECIMAL_ARITHMETIC_FAILED = -200, Error::CONVERSION_FAILED = -201,
  Error::FRAME_DIFFERENT = -202, Error::FRAME_INEXISTENT = -203, Error::OPERATION_ILLEGAL = -205, Error::DEADLOCK = -206
}
 Error of the execution of a procedure. More...
 

Static Public Attributes

static const int ARGUMENT_COUNT_LIMIT = 64
 Argument count limit. More...
 

Public Member Functions

 Execution (const Database &database, const std::string &procedure_name, const std::string &function_name)
 Constructs an execution of procedure. More...
 
 Execution (const Database &database, const std::string &function_name)
 Constructs an execution of procedure. More...
 
template<typename ... Arguments>
void arguments_add (Arguments &&... arguments)
 Adds multiple arguments to the execution. More...
 
const Variantexecute ()
 Executes the execution. More...
 
const Variantexecute_error_throw ()
 Executes the execution and throws an exception if the execution has an error. More...
 
const Variantresult () const
 Gets the result of the execution. More...
 
const Errorerror () const
 Gets the error of the execution. More...
 
void error_throw () const
 Throws an exception if the execution has an error. More...
 
void reset ()
 Resets the execution. More...
 
void argument_add_value (const Value::Alpha &argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_value (Value::Alpha::const_pointer argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_value (const Value::Logic &argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_value (const Value::Byte &argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_value (const Value::Word &argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_value (const Value::Int &argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_value (const Value::Bigint &argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_value (const Value::Float &argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_value (const Value::Decimal &argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_value (const Value::Date &argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_value (const Value::Time &argument)
 Adds a single argument to the execution which is passed by value. More...
 
void argument_add_reference (Value::Alpha &argument)
 Adds a single argument to the execution which is passed by reference. More...
 
void argument_add_reference (Value::Logic &argument)
 Adds a single argument to the execution which is passed by reference. More...
 
void argument_add_reference (Value::Byte &argument)
 Adds a single argument to the execution which is passed by reference. More...
 
void argument_add_reference (Value::Word &argument)
 Adds a single argument to the execution which is passed by reference. More...
 
void argument_add_reference (Value::Int &argument)
 Adds a single argument to the execution which is passed by reference. More...
 
void argument_add_reference (Value::Bigint &argument)
 Adds a single argument to the execution which is passed by reference. More...
 
void argument_add_reference (Value::Float &argument)
 Adds a single argument to the execution which is passed by reference. More...
 
void argument_add_reference (Value::Decimal &argument)
 Adds a single argument to the execution which is passed by reference. More...
 
void argument_add_reference (Value::Date &argument)
 Adds a single argument to the execution which is passed by reference. More...
 
void argument_add_reference (Value::Time &argument)
 Adds a single argument to the execution which is passed by reference. More...
 

Member Enumeration Documentation

◆ Error

Error of the execution of a procedure.

Enumerator
STACK_OVERFLOW 

Stack overflow occurred.

PROCEDURE_CODE_INEXISTENT 

Procedure code inexistent.

PROCEDURE_CODE_INCOMPATIBLE 

Procedure code incompatible.

MEMORY_EXHAUSTED 

Memory exhausted.

PROCEDURE_CALL_OLD 

Old procedure (A-) called.

PROCEDURE_INEXISTENT 

Procedure inexistent.

DATA_AREA_INEXISTENT 

Data area inexistent.

DATA_AREA_DIFFERENT 

Data area different.

DATA_AREA_NOT_INSTANCED 

Data area not instanced.

FUNCTION_INEXISTENT 

Function inexistent.

ARGUMENTS_DIFFERENT 

Arguments different.

FIELD_INEXISTENT 

Field inexistent.

TYPE_DIFFERENT 

Type different.

ARRAY_INDEX_INVALID 

Array index invalid.

VALUE_OVERFLOW 

Value overflow occurred.

STRING_LENGTH_EXCEEDED 

String length exceeded.

DIVISION_BY_ZERO 

Division by zero occurred.

VALUE_OUT_OF_DOMAIN 

Value out of domain.

VALUE_OUT_OF_RANGE 

Value out of range.

TABLE_INEXISTENT 

Table inexistent.

SUBRECORD_INEXISTENT 

Subrecord inexistent.

KEY_INEXISTENT 

Key inexistent.

LINK_INEXISTENT 

Link inexistent.

VALUE_INVALID 

Value invalid.

KEY_FIELD_INEXISTENT 

Key field inexistent.

LINK_FIELD_INEXISTENT 

Link field inexistent.

HANDLE_INVALID 

Handle invalid.

ARGUMENT_MISSING 

Argument missing.

LINK_INVALID 

Link valid.

TABLE_INVALID 

Table invalid.

SELECTIONS_HAVE_VALUE_SET 

Selections have value set.

SELECTIONS_SORT_DIFFERENT 

Sort of selections different.

SELECTIONS_IDENTICAL 

Selections idenctical.

PROPERTY_INVALID 

Property invalid.

DECIMAL_ARITHMETIC_FAILED 

Decimal arithmetic failed.

CONVERSION_FAILED 

Conversion failed.

FRAME_DIFFERENT 

Frame different.

FRAME_INEXISTENT 

Frame inexistent.

OPERATION_ILLEGAL 

Operation illegal.

DEADLOCK 

Deadlock occurred.

Member Data Documentation

◆ ARGUMENT_COUNT_LIMIT

const int C16::Procedure::Execution::ARGUMENT_COUNT_LIMIT = 64
static

Argument count limit.

Constructor & Destructor Documentation

◆ Execution() [1/2]

C16::Procedure::Execution::Execution ( const Database database,
const std::string &  procedure_name,
const std::string &  function_name 
)

Constructs an execution of procedure.

Parameters
databaseDatabase the execution relates to
procedure_nameName of the procedure
function_nameName of the function

◆ Execution() [2/2]

C16::Procedure::Execution::Execution ( const Database database,
const std::string &  function_name 
)

Constructs an execution of procedure.

Parameters
databaseDatabase the execution relates to
function_nameName of the function

The name of the function is of the form <procedure_name> [ :<name> ], where the parts in angle brackets (< ... >) contain the following data:

  • <procedure_name> – Name of the procedure.
  • <name> – Name of the function of the procedure.

Fragments in square brackets ([ ... ]) may be ommitted.

Member Function Documentation

◆ argument_add_value() [1/11]

void C16::Procedure::Execution::argument_add_value ( const Value::Alpha argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_value() [2/11]

void C16::Procedure::Execution::argument_add_value ( Value::Alpha::const_pointer  argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_value() [3/11]

void C16::Procedure::Execution::argument_add_value ( const Value::Logic argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_value() [4/11]

void C16::Procedure::Execution::argument_add_value ( const Value::Byte argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_value() [5/11]

void C16::Procedure::Execution::argument_add_value ( const Value::Word argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_value() [6/11]

void C16::Procedure::Execution::argument_add_value ( const Value::Int argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_value() [7/11]

void C16::Procedure::Execution::argument_add_value ( const Value::Bigint argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_value() [8/11]

void C16::Procedure::Execution::argument_add_value ( const Value::Float argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_value() [9/11]

void C16::Procedure::Execution::argument_add_value ( const Value::Decimal argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_value() [10/11]

void C16::Procedure::Execution::argument_add_value ( const Value::Date argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_value() [11/11]

void C16::Procedure::Execution::argument_add_value ( const Value::Time argument)

Adds a single argument to the execution which is passed by value.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will not be applied to the passed argument.

◆ argument_add_reference() [1/10]

void C16::Procedure::Execution::argument_add_reference ( Value::Alpha argument)

Adds a single argument to the execution which is passed by reference.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will be applied to the passed argument.

◆ argument_add_reference() [2/10]

void C16::Procedure::Execution::argument_add_reference ( Value::Logic argument)

Adds a single argument to the execution which is passed by reference.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will be applied to the passed argument.

◆ argument_add_reference() [3/10]

void C16::Procedure::Execution::argument_add_reference ( Value::Byte argument)

Adds a single argument to the execution which is passed by reference.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will be applied to the passed argument.

◆ argument_add_reference() [4/10]

void C16::Procedure::Execution::argument_add_reference ( Value::Word argument)

Adds a single argument to the execution which is passed by reference.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will be applied to the passed argument.

◆ argument_add_reference() [5/10]

void C16::Procedure::Execution::argument_add_reference ( Value::Int argument)

Adds a single argument to the execution which is passed by reference.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will be applied to the passed argument.

◆ argument_add_reference() [6/10]

void C16::Procedure::Execution::argument_add_reference ( Value::Bigint argument)

Adds a single argument to the execution which is passed by reference.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will be applied to the passed argument.

◆ argument_add_reference() [7/10]

void C16::Procedure::Execution::argument_add_reference ( Value::Float argument)

Adds a single argument to the execution which is passed by reference.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will be applied to the passed argument.

◆ argument_add_reference() [8/10]

void C16::Procedure::Execution::argument_add_reference ( Value::Decimal argument)

Adds a single argument to the execution which is passed by reference.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will be applied to the passed argument.

◆ argument_add_reference() [9/10]

void C16::Procedure::Execution::argument_add_reference ( Value::Date argument)

Adds a single argument to the execution which is passed by reference.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will be applied to the passed argument.

◆ argument_add_reference() [10/10]

void C16::Procedure::Execution::argument_add_reference ( Value::Time argument)

Adds a single argument to the execution which is passed by reference.

Parameters
argumentArgument
Note
Changes to the argument made by the execution will be applied to the passed argument.

◆ arguments_add()

template<typename ... Arguments>
void C16::Procedure::Execution::arguments_add ( Arguments &&...  arguments)
inline

Adds multiple arguments to the execution.

Parameters
argumentsArguments
Note
Changes to constant arguments made by the execution will not be applied to the passed arguments. Changes to non-constant arguments made by the execution will be applied to the passed arguments.

Referenced by C16::Procedures::execute(), and C16::Procedure::execute().

◆ execute()

const Variant& C16::Procedure::Execution::execute ( )

Executes the execution.

Returns
Return value of the executed function

◆ execute_error_throw()

const Variant& C16::Procedure::Execution::execute_error_throw ( )

Executes the execution and throws an exception if the execution has an error.

Returns
Return value of the executed function
Exceptions
ExceptionProcedure execution exception occurred.

Referenced by C16::Procedures::execute(), and C16::Procedure::execute().

◆ result()

const Variant& C16::Procedure::Execution::result ( ) const

Gets the result of the execution.

The result is the return value of the executed function.

◆ error()

const Error& C16::Procedure::Execution::error ( ) const

Gets the error of the execution.

◆ error_throw()

void C16::Procedure::Execution::error_throw ( ) const

Throws an exception if the execution has an error.

Exceptions
ExceptionProcedure execution exception occurred.

◆ reset()

void C16::Procedure::Execution::reset ( )

Resets the execution.

Removes all arguments and clears the result and the error.