theSq3Lite 10.0
Loading...
Searching...
No Matches
ccsq3lite::Sq3LiteExecCallbackC Struct Reference

infrastructur to use the CcLcConfig specific callbackMore...

#include <Sq3Call_cc.hh>

+ Collaboration diagram for ccsq3lite::Sq3LiteExecCallbackC:

Classes

union  Sq3LiteExecCallbackU
 storage to hold the callback More...
 

Public Types

enum  Sq3LiteExecCallbackE { PC_Sq3LiteExecSCB , PC_Sq3LiteExecIF }
 

Static Public Member Functions

static MK_CBP Create (MK_RT_ARGS Sq3LiteExecSCB const callback, Sq3LiteC *lite)
 
static MK_CBP Create (MK_RT_ARGS Sq3LiteExecIF *const callback, Sq3LiteC *lite)
 
static Sq3Fupu_Sq3LiteExec_callback_call_ret Call (Sq3Fupu_Sq3LiteExec_callback_call_args)
 

Public Attributes

Sq3LiteCself
 
enum ccsq3lite::Sq3LiteExecCallbackC::Sq3LiteExecCallbackE type
 
union ccsq3lite::Sq3LiteExecCallbackC::Sq3LiteExecCallbackU call
 

Detailed Description

infrastructur to use the CcLcConfig specific callback

Definition at line 16 of file Sq3Call_cc.hh.

Member Enumeration Documentation

◆ Sq3LiteExecCallbackE

Enumerator
PC_Sq3LiteExecSCB 
PC_Sq3LiteExecIF 

Definition at line 20 of file Sq3Call_cc.hh.

20 {
23 } type;
enum ccsq3lite::Sq3LiteExecCallbackC::Sq3LiteExecCallbackE type

Member Function Documentation

◆ Call()

Sq3Fupu_Sq3LiteExec_callback_call_ret ccsq3lite::Sq3LiteExecCallbackC::Call ( Sq3Fupu_Sq3LiteExec_callback_call_args )
static

Definition at line 39 of file Sq3Call_cc.cc.

40 {
42 // if NULL than callback is disabled → require attribute "callback-null"
43 // return "1" force sqlite3-abort-error
44 auto mycall = static_cast<Sq3LiteExecCallbackC* const> (callV1);
45 //MkRtSetup_X(lite);
46 if (mycall->self == NULL || !mycall->self->Check()) return 1;
47
48 try {
49 // https://stackoverflow.com/questions/58381828/c-assign-char-to-an-array-of-strings
50 std::vector<std::string> valsV( vals, vals+num );
51 std::vector<std::string> colsV( cols, cols+num );
52
53 switch (mycall->type) {
55 //(self->*mycall->mycall.LiteExecCB)(valsV,colsV);
56 (*mycall->call.LiteExecCB)(valsV,colsV);
57 break;
59 (mycall->call.LiteExecIF->callback)(valsV,colsV);
60 break;
61 default:
62 MkExceptionC::Catch(mycall->self,"Sq3LiteExecCallbackC::Call → callback-data-type-error");
63 goto error;
64 }
65 } catch (const MkExceptionC& ex) {
66 MkExceptionC::Catch(mycall->self,ex);
67 goto error;
68 } catch (const exception& ex) {
69 MkExceptionC::Catch(mycall->self,ex);
70 goto error;
71 } catch (...) {
72 MkExceptionC::Catch(mycall->self,"Sq3LiteExecCallbackC::Call → unknown 'C++' exception in callback");
73 goto error;
74 // http://groups.google.com/group/comp.programming.threads/browse_thread/thread/652bcf186fbbf697/f63757846514e5e5
75 // throw;
76 }
77
78 // everything is OK
79 return 0;
80error:
82 return 1;
83 }
#define MkErrorStack_0_NULL()
static MK_ERR Catch(MK_MNGN const expobj, std::exception const *exception, MK_STRN const callfunc=__builtin_FUNCTION())
MkExceptionC(MK_ERR err, MK_STRN const caller, MK_I32 const line)
#define Sq3Fupu_Sq3LiteExec_callback_call_check
+ Here is the caller graph for this function:

◆ Create() [1/2]

static MK_CBP ccsq3lite::Sq3LiteExecCallbackC::Create ( MK_RT_ARGS Sq3LiteExecIF *const callback,
Sq3LiteC * lite )
inlinestatic

Definition at line 45 of file Sq3Call_cc.hh.

45 {
46 return callback ? new Sq3LiteExecCallbackC(lite,PC_Sq3LiteExecIF,callback) : NULL;
47 }

◆ Create() [2/2]

static MK_CBP ccsq3lite::Sq3LiteExecCallbackC::Create ( MK_RT_ARGS Sq3LiteExecSCB const callback,
Sq3LiteC * lite )
inlinestatic

Definition at line 42 of file Sq3Call_cc.hh.

42 {
43 return callback ? new Sq3LiteExecCallbackC(lite,PC_Sq3LiteExecSCB,callback) : NULL;
44 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ call

union ccsq3lite::Sq3LiteExecCallbackC::Sq3LiteExecCallbackU ccsq3lite::Sq3LiteExecCallbackC::call

◆ self

Sq3LiteC* ccsq3lite::Sq3LiteExecCallbackC::self

Definition at line 18 of file Sq3Call_cc.hh.

◆ type

enum ccsq3lite::Sq3LiteExecCallbackC::Sq3LiteExecCallbackE ccsq3lite::Sq3LiteExecCallbackC::type

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