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

infrastructur to use the CcLcConfig specific callbackMore...

#include <Sq3Call_cc.hh>

+ Collaboration diagram for ccsq3lite::Sq3LiteExecV2CallbackC:

Classes

union  Sq3LiteExecV2CallbackU
 storage to hold the callback More...
 

Public Types

enum  Sq3LiteExecV2CallbackE { PC_Sq3LiteExecV2SCB , PC_Sq3LiteExecV2IF }
 

Static Public Member Functions

static MK_CBP Create (MK_RT_ARGS Sq3LiteExecV2SCB const callback, Sq3LiteC *lite)
 
static MK_CBP Create (MK_RT_ARGS Sq3LiteExecV2IF *const callback, Sq3LiteC *lite)
 
static Sq3LiteExecV2CB_ret Call (Sq3LiteExecV2CB_args)
 

Public Attributes

Sq3LiteCself
 
enum ccsq3lite::Sq3LiteExecV2CallbackC::Sq3LiteExecV2CallbackE type
 
union ccsq3lite::Sq3LiteExecV2CallbackC::Sq3LiteExecV2CallbackU call
 

Detailed Description

infrastructur to use the CcLcConfig specific callback

Definition at line 59 of file Sq3Call_cc.hh.

Member Enumeration Documentation

◆ Sq3LiteExecV2CallbackE

Enumerator
PC_Sq3LiteExecV2SCB 
PC_Sq3LiteExecV2IF 

Definition at line 63 of file Sq3Call_cc.hh.

63 {
66 } type;
enum ccsq3lite::Sq3LiteExecV2CallbackC::Sq3LiteExecV2CallbackE type

Member Function Documentation

◆ Call()

Sq3LiteExecV2CB_ret ccsq3lite::Sq3LiteExecV2CallbackC::Call ( Sq3LiteExecV2CB_args )
static

Definition at line 85 of file Sq3Call_cc.cc.

86 {
87 // if NULL than callback is disabled → require attribute "callback-null"
88 // return "1" force sqlite3-abort-error
89 if (callV2 == NULL) return MK_ERROR;
90 auto mycall = static_cast<Sq3LiteExecV2CallbackC* const> (callV2);
91 if (mycall == NULL ) return MK_ERROR;
92 //MkRtSetup_X(lite);
93 if (mycall->self == NULL || !mycall->self->Check()) return MK_ERROR;
94
95 try {
96 // https://stackoverflow.com/questions/58381828/c-assign-char-to-an-array-of-strings
97 MkBufferListC valsR(vals);
98 MkBufferListC colsR(cols);
99
100 switch (mycall->type) {
102 (*mycall->call.LiteExecV2CB)(valsR,colsR);
103 break;
105 (mycall->call.LiteExecV2IF->callback)(valsR,colsR);
106 break;
107 default:
108 MkExceptionC::Catch(mycall->self,"Sq3LiteExecV2CallbackC::Call → callback-data-type-error");
109 goto error;
110 }
111 } catch (const MkExceptionC& ex) {
112 MkExceptionC::Catch(mycall->self,ex);
113 goto error;
114 } catch (const exception& ex) {
115 MkExceptionC::Catch(mycall->self,ex);
116 goto error;
117 } catch (...) {
118 MkExceptionC::Catch(mycall->self,"Sq3LiteExecV2CallbackC::Call → unknown 'C++' exception in callback");
119 goto error;
120 // http://groups.google.com/group/comp.programming.threads/browse_thread/thread/652bcf186fbbf697/f63757846514e5e5
121 // throw;
122 }
123
124error:
125 return MkErrorStack_0E_Check();
126 }
MkBufferListC(MK_BFL hdl)
#define MkErrorStack_0E_Check()
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)
+ Here is the caller graph for this function:

◆ Create() [1/2]

static MK_CBP ccsq3lite::Sq3LiteExecV2CallbackC::Create ( MK_RT_ARGS Sq3LiteExecV2IF *const callback,
Sq3LiteC * lite )
inlinestatic

Definition at line 88 of file Sq3Call_cc.hh.

88 {
89 return callback ? new Sq3LiteExecV2CallbackC(lite,PC_Sq3LiteExecV2IF,callback) : NULL;
90 }

◆ Create() [2/2]

static MK_CBP ccsq3lite::Sq3LiteExecV2CallbackC::Create ( MK_RT_ARGS Sq3LiteExecV2SCB const callback,
Sq3LiteC * lite )
inlinestatic

Definition at line 85 of file Sq3Call_cc.hh.

85 {
86 return callback ? new Sq3LiteExecV2CallbackC(lite,PC_Sq3LiteExecV2SCB,callback) : NULL;
87 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ call

union ccsq3lite::Sq3LiteExecV2CallbackC::Sq3LiteExecV2CallbackU ccsq3lite::Sq3LiteExecV2CallbackC::call

◆ self

Sq3LiteC* ccsq3lite::Sq3LiteExecV2CallbackC::self

Definition at line 61 of file Sq3Call_cc.hh.

◆ type

enum ccsq3lite::Sq3LiteExecV2CallbackC::Sq3LiteExecV2CallbackE ccsq3lite::Sq3LiteExecV2CallbackC::type

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