DCL 4.0
Loading...
Searching...
No Matches
SQLDriver.cpp File Reference
#include <dcl/Config.h>
#include <dlfcn.h>
#include <dcl/_stdlib.h>
#include <dcl/Object.h>
#include <dcl/String.h>
#include <dcl/Array.h>
#include <dcl/Thread.h>
#include <dcl/SQLCore.h>
#include <dcl/SQLDriver.h>
#include "LibState.h"

Go to the source code of this file.

Classes

class  SQLDriverPool

Functions

__DCL_BEGIN_NAMESPACE IMPLEMENT_CLASSINFO (SQLDriverException, DllException) SQLDriverException
 IMPLEMENT_CLASSINFO (SQLDriver, Dll) long SQLDriver
 IMPLEMENT_CLASSINFO (SQLDriverPool, Object) SQLDriver *SQLDriverPool

Variables

LibState__pLibState

Function Documentation

◆ IMPLEMENT_CLASSINFO() [1/3]

IMPLEMENT_CLASSINFO ( SQLDriver ,
Dll  )

Definition at line 87 of file SQLDriver.cpp.

89{
90 long n = Thread::incrementAndGet(__refCount);
91 return n;
92}
void CharsetConvertException *size_t n
Definition SQLField.cpp:253
static long incrementAndGet(volatile long &_n)

◆ IMPLEMENT_CLASSINFO() [2/3]

__DCL_BEGIN_NAMESPACE IMPLEMENT_CLASSINFO ( SQLDriverException ,
DllException  )

Definition at line 34 of file SQLDriver.cpp.

37 : Exception(_cause), __name(_name)
38{
39}

◆ IMPLEMENT_CLASSINFO() [3/3]

IMPLEMENT_CLASSINFO ( SQLDriverPool ,
Object  )

Definition at line 333 of file SQLDriver.cpp.

337{
338 String name = _name.trim();
339
340 SQLDriver* pSQLDriver = NULL;
341 // find previous loaded module
342 for (PointerArray::Iterator it = __drivers.begin();
343 it != __drivers.end(); it++) {
344 if (!((SQLDriver*)(*it))->driverName().compareNoCase(name)) {
345 pSQLDriver = (SQLDriver*)(*it);
346 break;
347 }
348 }
349
350 if (!pSQLDriver) {
351 // not found. load new driver
353 __T("Open New SQLDriver: %ls, Prev-Count: %d\n"),
354 name.data(),
355 __drivers.size()
356 );
357
358 pSQLDriver = new SQLDriver(_name);
359 __drivers.add(pSQLDriver);
360 }
361
362 return pSQLDriver;
363}
#define NULL
Definition Config.h:340
#define __T(str)
Definition Object.h:44
#define __DCL_TRACE2(fmt, arg1, arg2)
Definition Object.h:377

Variable Documentation

◆ __pLibState

LibState* __pLibState
extern

Definition at line 62 of file LibMain.cpp.