クラス SQLiteCSLib.Inner.OSQLiteFunc

SQLite3 ユーザ定義関数. [詳細]

SQLiteCSLib.Inner.OSQLiteFuncのコラボレーション図
Collaboration graph
[凡例]

すべてのメンバ一覧

Public メソッド

 OSQLiteFunc (OSQLiteDBWrap db, ICallUserFunction iCallinterface)
 コンストラクタ
void Dispose ()
 破棄
ResultEnum CreateFunction (string funcname, int inArg)

Protected メソッド

unsafe delegate void CallFuncDelegate (IntPtr context, int argc, void **inparams)
 コールバック型(マネージ)
unsafe delegate void CallStepDelegate (IntPtr context, int argc, void **inparams)
unsafe delegate void CallFinalDelegate (IntPtr context)
unsafe virtual void CallFunc (IntPtr context, int argc, void **inparams)
 スカラー関数コールバック
unsafe virtual void CallStep (IntPtr context, int argc, void **inparams)
 集約関数ステップコールバック
unsafe virtual void CallFinal (IntPtr context)
 集約関数最終コールバック
unsafe object[] CreateParams (int argc, void **inparams)
 ユーザ定義関数パラメータ作成

Static Protected メソッド

static int osqlite3_createfunction (IntPtr instance, string funcname, int iarg, int eTextRep, CallFuncDelegate xFunc, CallStepDelegate xStep, CallFinalDelegate xFinal)
static int __sqlite3_value_type (IntPtr inparam)
static long __sqlite3_value_int64 (IntPtr inparam)
static double __sqlite3_value_double (IntPtr inparam)
static int __sqlite3_value_bytes (IntPtr inparam)
static IntPtr __sqlite3_value_blob (IntPtr inparam)
static string __sqlite3_value_text16 (IntPtr inparam)
static void __sqlite3_result_int (IntPtr inparam, int val)
static void __sqlite3_result_int64 (IntPtr inparam, long val)
static void __sqlite3_result_double (IntPtr inparam, double val)
static void __sqlite3_result_text16 (IntPtr inparam, string val, int ilen)
static void __sqlite3_result_blob (IntPtr inparam, IntPtr val, int ilen)

Protected 変数

OSQLiteDBWrap m_db
 データベース
ICallUserFunction m_callinterface
 コールバックインターフェース

説明

SQLite3 ユーザ定義関数.

OSQLiteFunc.cs11 行で定義されています。


コンストラクタとデストラクタ

SQLiteCSLib.Inner.OSQLiteFunc.OSQLiteFunc ( OSQLiteDBWrap  db,
ICallUserFunction  iCallinterface 
)

コンストラクタ

OSQLiteFunc.cs58 行で定義されています。

00059                 {
00060                         m_db = db;
00061                         m_callinterface = iCallinterface;
00062 
00063                         unsafe
00064                         {
00065                                 m_funcpoint = GCHandle.Alloc( new CallFuncDelegate( CallFunc ) );
00066                                 m_steppoint = GCHandle.Alloc( new CallStepDelegate( CallStep ) );
00067                                 m_finalpoint = GCHandle.Alloc( new CallFinalDelegate( CallFinal ) );
00068                         }
00069 
00070 #if MOBILEPC
00071                         m_disposeevent = CreateEvent( IntPtr.Zero , true, false, IntPtr.Zero );
00072 #endif
00073                 }


メソッド

unsafe virtual void SQLiteCSLib.Inner.OSQLiteFunc.CallFinal ( IntPtr  context  )  [protected, virtual]

集約関数最終コールバック

引数:
context コンテキスト

OSQLiteFunc.cs250 行で定義されています。

00251                 {
00252                         IAggregateCallUserFunction iAggregate = m_callinterface as IAggregateCallUserFunction;
00253                         if( iAggregate != null  )
00254                         {
00255                                 object returnval = iAggregate.CallFinal();
00256                                 if( returnval != null )
00257                                 {
00258                                         SetResultValue( context, returnval );
00259                                 }
00260                         }
00261                 }

unsafe virtual void SQLiteCSLib.Inner.OSQLiteFunc.CallFunc ( IntPtr  context,
int  argc,
void **  inparams 
) [protected, virtual]

スカラー関数コールバック

引数:
context コンテキスト
argc 引数数
inparams 引数リスト

OSQLiteFunc.cs218 行で定義されています。

00219                 {
00220                         IScalarCallUserFunction iScalar = m_callinterface as IScalarCallUserFunction;
00221                         if( iScalar != null  )
00222                         {
00223                                 object returnval = iScalar.CallFunc( CreateParams(argc,inparams) );
00224                                 if( returnval != null )
00225                                 {
00226                                         SetResultValue( context, returnval );
00227                                 }
00228                         }
00229                 }

unsafe delegate void SQLiteCSLib.Inner.OSQLiteFunc.CallFuncDelegate ( IntPtr  context,
int  argc,
void **  inparams 
) [protected]

コールバック型(マネージ)

unsafe virtual void SQLiteCSLib.Inner.OSQLiteFunc.CallStep ( IntPtr  context,
int  argc,
void **  inparams 
) [protected, virtual]

集約関数ステップコールバック

引数:
context コンテキスト
argc 引数数
inparams 引数リスト

OSQLiteFunc.cs237 行で定義されています。

00238                 {
00239                         IAggregateCallUserFunction iAggregate = m_callinterface as IAggregateCallUserFunction;
00240                         if( iAggregate != null  )
00241                         {
00242                                 iAggregate.CallStep( CreateParams(argc,inparams) );
00243                         }
00244                 }

unsafe object [] SQLiteCSLib.Inner.OSQLiteFunc.CreateParams ( int  argc,
void **  inparams 
) [protected]

ユーザ定義関数パラメータ作成

引数:
argc 引数数
inparams 引数リスト
戻り値:
マネージ引数リスト

OSQLiteFunc.cs318 行で定義されています。

00319                 {
00320                         object[] argslist = new object[argc];
00321 
00322                         for( int iIdx=0; iIdx<argc; iIdx++ )
00323                         {
00324                                 void* val = inparams[ iIdx ];
00325 
00326                                 if( val != null )
00327                                 {
00328                                         IntPtr context = new IntPtr(val);
00329 
00330                                         DATATYPE iType = (DATATYPE)__sqlite3_value_type( context );
00331 
00332                                         switch( iType )
00333                                         {
00334                                         case DATATYPE.INTEGER:
00335                                                 argslist[ iIdx ] = __sqlite3_value_int64( context );
00336                                                 break;
00337                                         case DATATYPE.FLOAT:
00338                                                 argslist[ iIdx ] = __sqlite3_value_double( context ) ;
00339                                                 break;
00340                                         case DATATYPE.BLOB:
00341                                                 {
00342                                                         IntPtr pBin = __sqlite3_value_blob( context );
00343                                                         int valsize = __sqlite3_value_bytes( context );
00344 
00345                                                         byte[] managememory = new byte[valsize];
00346                                                         Marshal.Copy( pBin, managememory, 0, valsize );
00347 
00348                                                         argslist[ iIdx ] = managememory;
00349                                                 }
00350 
00351                                                 break;
00352                                         case DATATYPE.DBNULL:
00353                                                 argslist[ iIdx ] = null;
00354                                                 break;
00355                                         case DATATYPE.TEXT:
00356                                                 argslist[ iIdx ] = __sqlite3_value_text16( context );
00357                                                 break;
00358                                         }
00359                                 }
00360                         }
00361 
00362                         return argslist;
00363                 }

void SQLiteCSLib.Inner.OSQLiteFunc.Dispose (  ) 

破棄

OSQLiteFunc.cs86 行で定義されています。

00087                 {
00088 #if MOBILEPC
00089                         EventModify( m_disposeevent, 3 );
00090                         CloseHandle( m_disposeevent );
00091                         CloseHandle( m_clrevent );
00092 #endif
00093 
00094                         if( m_db != null )
00095                         {
00096                                 m_funcpoint.Free();
00097                                 m_steppoint.Free();
00098                                 m_finalpoint.Free();
00099                                 m_db = null;
00100                                 m_callinterface = null;
00101                         }
00102                 }


変数

コールバックインターフェース

OSQLiteFunc.cs28 行で定義されています。

データベース

OSQLiteFunc.cs23 行で定義されています。


このクラスの説明は次のファイルから生成されました:

SQLite3 Wrap ADO For .Net1.1 or Compact Frameworkに対してSun Nov 15 13:03:09 2009に生成されました。  doxygen 1.6.1