wxSQLite3 4.9.12
|
Context for user defined scalar or aggregate functions. More...
#include <wxsqlite3.h>
Public Member Functions | |
virtual | ~wxSQLite3FunctionContext () |
Default destructor. | |
int | GetArgCount () const |
Get the number of function arguments. | |
int | GetArgType (int argIndex) const |
Get the type of a function argument. | |
bool | IsNull (int argIndex) const |
Check whether a function argument is a NULL value. | |
int | GetInt (int argIndex, int nullValue=0) const |
Get a function argument as an integer value. | |
wxLongLong | GetInt64 (int argIndex, wxLongLong nullValue=0) const |
Get a function argument as an 64-bit integer value. | |
double | GetDouble (int argIndex, double nullValue=0) const |
Get a function argument as a double value. | |
wxString | GetString (int argIndex, const wxString &nullValue=wxEmptyString) const |
Get a function argument as a string value. | |
const unsigned char * | GetBlob (int argIndex, int &len) const |
Get a function argument as a BLOB value. | |
wxMemoryBuffer & | GetBlob (int argIndex, wxMemoryBuffer &buffer) const |
Get a function argument as a BLOB value. | |
void * | GetPointer (int argIndex, const wxString &pointerType) const |
Get a function argument as a pointer value. | |
void | SetResult (int value) |
Set the function result as an integer value. | |
void | SetResult (wxLongLong value) |
Set the function result as an 64-bit integer value. | |
void | SetResult (double value) |
Set the function result as a double value. | |
void | SetResult (const wxString &value) |
Set the function result as a string value. | |
void | SetResult (unsigned char *value, int len) |
Set the function result as a BLOB value. | |
void | SetResult (const wxMemoryBuffer &buffer) |
Set the function result as a BLOB value. | |
void | SetResult (void *pointer, const wxString &pointerType, void(*DeletePointer)(void *)=NULL) |
Set the function result as a pointer value. | |
void | SetResultNull () |
Set the function result as a NULL value. | |
void | SetResultZeroBlob (int blobSize) |
Set the function result as a zero BLOB value. | |
void | SetResultArg (int argIndex) |
Set the function result as a exact copy of a function argument. | |
void | SetResultError (const wxString &errmsg) |
Set an error message as the function result. | |
int | GetAggregateCount () const |
Get the number of aggregate steps. | |
void * | GetAggregateStruct (int len) const |
Get a pointer to an aggregate structure of specified length. | |
Static Public Member Functions | |
static void | ExecScalarFunction (void *ctx, int argc, void **argv) |
Execute a user defined scalar function (internal use only) | |
static void | ExecAggregateStep (void *ctx, int argc, void **argv) |
Execute an aggregate step of a user defined aggregate function (internal use only) | |
static void | ExecAggregateFinalize (void *ctx) |
Execute the final step of a user defined aggregate function (internal use only) | |
static void | ExecWindowStep (void *ctx, int argc, void **argv) |
Execute an aggregate step of a user defined aggregate window function (internal use only) | |
static void | ExecWindowFinalize (void *ctx) |
Execute the final step of a user defined aggregate window function (internal use only) | |
static void | ExecWindowValue (void *ctx) |
Execute the current value step of a user defined aggregate window function (internal use only) | |
static void | ExecWindowInverse (void *ctx, int argc, void **argv) |
Execute the inverse step of a user defined aggregate window function (internal use only) | |
static int | ExecCommitHook (void *hook) |
Execute the user defined commit hook (internal use only) | |
static void | ExecRollbackHook (void *hook) |
Execute the user defined rollback hook (internal use only) | |
static void | ExecUpdateHook (void *hook, int type, const char *database, const char *table, wxsqlite_int64 rowid) |
Execute the user defined update hook (internal use only) | |
static int | ExecWriteAheadLogHook (void *hook, void *dbHandle, const char *database, int numPages) |
Execute the user defined Write Ahead Log hook (internal use only) | |
Context for user defined scalar or aggregate functions.
A function context gives user defined scalar or aggregate functions access to function arguments and function results. The "Execute" method resp. the "Aggregate" and "Finalize" methods receive the current function context as an argument.
|
virtual |
Default destructor.
|
static |
Execute the final step of a user defined aggregate function (internal use only)
|
static |
Execute an aggregate step of a user defined aggregate function (internal use only)
|
static |
Execute the user defined commit hook (internal use only)
|
static |
Execute the user defined rollback hook (internal use only)
|
static |
Execute a user defined scalar function (internal use only)
|
static |
Execute the user defined update hook (internal use only)
|
static |
Execute the final step of a user defined aggregate window function (internal use only)
|
static |
Execute the inverse step of a user defined aggregate window function (internal use only)
|
static |
Execute an aggregate step of a user defined aggregate window function (internal use only)
|
static |
Execute the current value step of a user defined aggregate window function (internal use only)
|
static |
Execute the user defined Write Ahead Log hook (internal use only)
int wxSQLite3FunctionContext::GetAggregateCount | ( | ) | const |
Get the number of aggregate steps.
void * wxSQLite3FunctionContext::GetAggregateStruct | ( | int | len | ) | const |
Get a pointer to an aggregate structure of specified length.
Usually an aggregation functions needs temporary memory to collect the information gathered from each invocation of the "Aggregate" method. On the first invocation of this method the returned memory contains binary zeros. If this memory is used to store pointers to allocated objects, it is important to free all allocated objects in the "Finalize" method.
len | amount of memory needed in bytes |
int wxSQLite3FunctionContext::GetArgCount | ( | ) | const |
Get the number of function arguments.
int wxSQLite3FunctionContext::GetArgType | ( | int | argIndex | ) | const |
Get the type of a function argument.
argIndex | index of the function argument. Indices start with 0. |
const unsigned char * wxSQLite3FunctionContext::GetBlob | ( | int | argIndex, |
int & | len ) const |
Get a function argument as a BLOB value.
argIndex | index of the function argument. Indices start with 0. | |
[out] | len | length of the blob argument in bytes |
wxMemoryBuffer & wxSQLite3FunctionContext::GetBlob | ( | int | argIndex, |
wxMemoryBuffer & | buffer ) const |
Get a function argument as a BLOB value.
argIndex | index of the function argument. Indices start with 0. | |
[out] | buffer | to which the blob argument value is appended |
double wxSQLite3FunctionContext::GetDouble | ( | int | argIndex, |
double | nullValue = 0 ) const |
Get a function argument as a double value.
argIndex | index of the function argument. Indices start with 0. |
nullValue | value to be returned in case the argument is NULL |
int wxSQLite3FunctionContext::GetInt | ( | int | argIndex, |
int | nullValue = 0 ) const |
Get a function argument as an integer value.
argIndex | index of the function argument. Indices start with 0. |
nullValue | value to be returned in case the argument is NULL |
wxLongLong wxSQLite3FunctionContext::GetInt64 | ( | int | argIndex, |
wxLongLong | nullValue = 0 ) const |
Get a function argument as an 64-bit integer value.
argIndex | index of the function argument. Indices start with 0. |
nullValue | value to be returned in case the argument is NULL |
void * wxSQLite3FunctionContext::GetPointer | ( | int | argIndex, |
const wxString & | pointerType ) const |
Get a function argument as a pointer value.
argIndex | index of the function argument. Indices start with 0. |
pointerType | a name identifying the pointer type. |
wxString wxSQLite3FunctionContext::GetString | ( | int | argIndex, |
const wxString & | nullValue = wxEmptyString ) const |
Get a function argument as a string value.
argIndex | index of the function argument. Indices start with 0. |
nullValue | value to be returned in case the argument is NULL |
bool wxSQLite3FunctionContext::IsNull | ( | int | argIndex | ) | const |
Check whether a function argument is a NULL value.
argIndex | index of the function argument. Indices start with 0. |
void wxSQLite3FunctionContext::SetResult | ( | const wxMemoryBuffer & | buffer | ) |
Set the function result as a BLOB value.
buffer | containing the function result value |
void wxSQLite3FunctionContext::SetResult | ( | const wxString & | value | ) |
Set the function result as a string value.
value | function result value |
void wxSQLite3FunctionContext::SetResult | ( | double | value | ) |
Set the function result as a double value.
value | function result value |
void wxSQLite3FunctionContext::SetResult | ( | int | value | ) |
Set the function result as an integer value.
value | function result value |
void wxSQLite3FunctionContext::SetResult | ( | unsigned char * | value, |
int | len ) |
Set the function result as a BLOB value.
value | function result value |
len | length of the result blob in bytes |
void wxSQLite3FunctionContext::SetResult | ( | void * | pointer, |
const wxString & | pointerType, | ||
void(*)(void *) | DeletePointer = NULL ) |
Set the function result as a pointer value.
pointer | pointer value |
pointerType | descriptive name of the pointer type as expected by the extension module |
DeletePointer | pointer to a function for deleting the object pointed to by the pointer after use in SQLite (default: NULL) |
void wxSQLite3FunctionContext::SetResult | ( | wxLongLong | value | ) |
Set the function result as an 64-bit integer value.
value | function result value |
void wxSQLite3FunctionContext::SetResultArg | ( | int | argIndex | ) |
Set the function result as a exact copy of a function argument.
argIndex | index of the argument which should be copied as the result value |
void wxSQLite3FunctionContext::SetResultError | ( | const wxString & | errmsg | ) |
Set an error message as the function result.
errmsg | string containing an error message |
void wxSQLite3FunctionContext::SetResultNull | ( | ) |
Set the function result as a NULL value.
void wxSQLite3FunctionContext::SetResultZeroBlob | ( | int | blobSize | ) |
Set the function result as a zero BLOB value.
blobSize | size of the zero filled BLOB value |