DCL 3.7.4
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__LibState__

Function Documentation

◆ IMPLEMENT_CLASSINFO() [1/3]

IMPLEMENT_CLASSINFO ( SQLDriver ,
Dll  )

Definition at line 86 of file SQLDriver.cpp.

88{
89 long n = Thread::incrementAndGet(__refCount);
90 return n;
91}
static long incrementAndGet(volatile long &_n)

◆ IMPLEMENT_CLASSINFO() [2/3]

__DCL_BEGIN_NAMESPACE IMPLEMENT_CLASSINFO ( SQLDriverException ,
DllException  )

Definition at line 33 of file SQLDriver.cpp.

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

◆ IMPLEMENT_CLASSINFO() [3/3]

IMPLEMENT_CLASSINFO ( SQLDriverPool ,
Object  )

Definition at line 329 of file SQLDriver.cpp.

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

Variable Documentation

◆ __LibState__

LibState* __LibState__
extern

Definition at line 64 of file LibMain.cpp.