48 #define ARG_NOT_USED(a) (a) = (a)
64 template <
class TDataType>
66 template<
class TLobObjectType,
int TLobOracleType>
70 template<
class TLongObjectType,
int TLongOracleType>
99 template<
class TResultType>
100 static TResultType
Check(TResultType result);
118 template <
class THandleType>
125 template <
class TEnum>
138 operator unsigned int ();
140 bool operator == (
const Enum& other)
const;
141 bool operator != (
const Enum& other)
const;
143 bool operator == (
const TEnum& other)
const;
144 bool operator != (
const TEnum& other)
const;
155 template <
class TEnum>
165 Flags operator~ ()
const;
167 Flags operator | (TEnum other)
const;
168 Flags operator & (TEnum other)
const;
169 Flags operator ^ (TEnum other)
const;
175 Flags& operator |= (TEnum other);
176 Flags& operator &= (TEnum other);
177 Flags& operator ^= (TEnum other);
183 bool operator == (TEnum other)
const;
184 bool operator == (
const Flags& other)
const;
186 unsigned int GetValues()
const;
188 bool IsSet(TEnum other)
const;
192 Flags(
unsigned int flags);
197 template<
typename TBufferType>
202 ManagedBuffer(
size_t size);
203 ManagedBuffer(TBufferType *buffer,
size_t size);
207 operator TBufferType* ()
const;
208 operator const TBufferType* ()
const;
212 TBufferType* _buffer;
216 template <
class TKey,
class TValue>
223 void Initialize(
unsigned int envMode);
226 void Remove(TKey key);
227 TValue Get(TKey key)
const;
228 void Set(TKey key, TValue value);
232 typedef std::map< TKey, TValue > ConcurrentPoolMap;
234 ConcurrentPoolMap _map;
245 virtual ~Handle() {};
246 virtual std::list<Handle *> & GetChildren() = 0;
247 virtual void DetachFromHolders() = 0;
248 virtual void DetachFromParent() = 0;
255 template<
class THandleType>
262 operator bool()
const;
263 operator THandleType();
264 operator THandleType()
const;
270 HandleHolder(
const HandleHolder &other);
274 HandleHolder& operator= (
const HandleHolder &other);
276 typedef boolean(OCI_API *HandleFreeFunc)(
AnyPointer handle);
278 Handle* GetHandle()
const;
280 void Acquire(THandleType handle, HandleFreeFunc func, Handle *parent);
281 void Acquire(HandleHolder &other);
284 class SmartHandle :
public Handle
288 SmartHandle(HandleHolder *holder, THandleType handle, HandleFreeFunc func, Handle *parent);
289 virtual ~SmartHandle();
291 void Acquire(HandleHolder *holder);
292 void Release(HandleHolder *holder);
294 THandleType GetHandle()
const;
296 Handle *GetParent()
const;
301 bool IsLastHolder(HandleHolder *holder)
const;
303 std::list<Handle *> & GetChildren();
304 void DetachFromHolders();
305 void DetachFromParent();
309 std::list<HandleHolder *> _holders;
310 std::list<Handle *> _children;
313 HandleFreeFunc _func;
320 SmartHandle *_smartHandle;
323 template <
class TValueType>
329 BindValue(TValueType value);
331 operator TValueType()
const;
342 BindObject(
const Statement &statement,
const ostring& name);
344 virtual ~BindObject();
348 Statement GetStatement()
const;
350 virtual void SetInData() = 0;
351 virtual void SetOutData() = 0;
359 class BindArray :
public BindObject
363 BindArray(
const Statement &statement,
const ostring& name);
364 virtual ~BindArray();
366 template <
class TObjectType,
class TDataType>
367 void SetVector(std::vector<TObjectType> & vector,
unsigned int mode,
unsigned int elemSize);
369 template <
class TObjectType,
class TDataType>
370 TDataType * GetData ()
const;
377 class AbstractBindArrayObject
380 AbstractBindArrayObject() { }
381 virtual ~AbstractBindArrayObject() { }
382 virtual void SetInData() = 0;
383 virtual void SetOutData() = 0;
387 template <
class TObjectType,
class TDataType>
388 class BindArrayObject :
public AbstractBindArrayObject
394 std::vector<TObjectType> & _vector;
397 unsigned int _elemCount;
398 unsigned int _elemSize;
402 BindArrayObject(
const Statement &statement,
const ostring& name, std::vector<TObjectType> &vector,
unsigned int mode,
unsigned int elemSize);
403 virtual ~BindArrayObject();
408 operator std::vector<TObjectType> & ()
const;
409 operator TDataType * ()
const;
417 AbstractBindArrayObject * _object;
420 template <
class TNativeType,
class TObjectType>
421 class BindAdaptor :
public BindObject
423 friend class Statement;
427 operator TNativeType *()
const;
432 BindAdaptor(
const Statement &statement,
const ostring& name, TObjectType &
object,
unsigned int size);
433 virtual ~BindAdaptor();
437 TObjectType& _object;
446 BindsHolder(
const Statement &statement);
451 void AddBindObject(BindObject *bindObject);
458 std::vector<BindObject *> _bindObjects;
ostring MakeString(const otext *result)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
Raw MakeRaw(void *result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
Template Enum template class providing some type safety to some extends for manipulating enum variabl...
Oracle SQL or PL/SQL statement.
void * AnyPointer
Alias for the generic void pointer.
Template class providing OCILIB handles auto memory, life cycle and scope management.
Template Flags template class providing some type safety to some extends for manipulating flags set v...
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...
static void Check()
Internal usage. Checks if the last OCILIB method call has raised an error. If so, it raises a C++ exc...