48 #define ARG_NOT_USED(a) (a) = (a)
64 template <
class TDataType>
66 template<
class TLobObjectType,
int TLobOracleType>
70 template<
class TLongObjectType,
int TLongOracleType>
92 template<
class TResultType>
93 static TResultType
Check(TResultType result);
111 template <
class THandleType>
118 template <
class TEnum>
131 operator unsigned int ();
133 bool operator == (
const Enum& other)
const;
134 bool operator != (
const Enum& other)
const;
136 bool operator == (
const TEnum& other)
const;
137 bool operator != (
const TEnum& other)
const;
148 template <
class TEnum>
158 Flags operator~ ()
const;
160 Flags operator | (TEnum other)
const;
161 Flags operator & (TEnum other)
const;
162 Flags operator ^ (TEnum other)
const;
168 Flags& operator |= (TEnum other);
169 Flags& operator &= (TEnum other);
170 Flags& operator ^= (TEnum other);
176 bool operator == (TEnum other)
const;
177 bool operator == (
const Flags& other)
const;
179 unsigned int GetValues()
const;
181 bool IsSet(TEnum other)
const;
185 Flags(
unsigned int flags);
190 template<
typename TBufferType>
195 ManagedBuffer(
size_t size);
196 ManagedBuffer(TBufferType *buffer,
size_t size);
200 operator TBufferType* ()
const;
201 operator const TBufferType* ()
const;
205 TBufferType* _buffer;
219 void SetAccessMode(
bool threaded);
233 void SetLocker(Locker *locker);
243 template <
class TKey,
class TValue>
244 class ConcurrentMap :
public Lockable
249 virtual ~ConcurrentMap();
251 void Remove(TKey key);
252 TValue Get(TKey key);
253 void Set(TKey key, TValue value);
259 std::map<TKey, TValue> _map;
263 template <
class TValue>
264 class ConcurrentList :
public Lockable
269 virtual ~ConcurrentList();
271 void Add(TValue value);
272 void Remove(TValue value);
275 bool Exists(TValue value);
277 template<
class TPredicate>
278 bool FindIf(TPredicate predicate, TValue &value);
280 template<
class TAction>
281 void ForEach(TAction action);
285 std::list<TValue> _list;
293 virtual ConcurrentList<Handle *> & GetChildren() = 0;
294 virtual void DetachFromHolders() = 0;
295 virtual void DetachFromParent() = 0;
302 template<
class THandleType>
310 operator bool()
const;
312 operator THandleType();
313 operator THandleType()
const;
319 HandleHolder(
const HandleHolder &other);
323 HandleHolder& operator= (
const HandleHolder &other);
325 typedef boolean(OCI_API *HandleFreeFunc)(
AnyPointer handle);
327 Handle* GetHandle()
const;
329 void Acquire(THandleType handle, HandleFreeFunc func, Handle *parent);
330 void Acquire(HandleHolder &other);
333 class SmartHandle :
public Handle
337 SmartHandle(HandleHolder *holder, THandleType handle, HandleFreeFunc func, Handle *parent);
338 virtual ~SmartHandle();
340 void Acquire(HandleHolder *holder);
341 void Release(HandleHolder *holder);
343 const THandleType GetHandle()
const;
345 Handle *GetParent()
const;
350 bool IsLastHolder(HandleHolder *holder);
352 ConcurrentList<Handle *> & GetChildren();
353 void DetachFromHolders();
354 void DetachFromParent();
358 static void DeleteHandle(Handle *handle);
359 static void ResetHolder(HandleHolder *holder);
361 ConcurrentList<HandleHolder *> _holders;
362 ConcurrentList<Handle *> _children;
367 HandleFreeFunc _func;
374 SmartHandle *_smartHandle;
393 virtual ostring ToString()
const = 0;
395 template <
class TStream>
396 friend TStream& operator << (TStream &lhs,
const Streamable &rhs)
398 lhs << static_cast<ostring>(rhs);
403 template <
class TValueType>
409 BindValue(TValueType value);
411 operator TValueType()
const;
422 BindObject(
const Statement &statement,
const ostring& name);
424 virtual ~BindObject();
428 Statement GetStatement()
const;
430 virtual void SetInData() = 0;
431 virtual void SetOutData() = 0;
439 class BindArray :
public BindObject
443 BindArray(
const Statement &statement,
const ostring& name);
444 virtual ~BindArray();
446 template <
class TObjectType,
class TDataType>
447 void SetVector(std::vector<TObjectType> & vector,
unsigned int mode,
unsigned int elemSize);
449 template <
class TObjectType,
class TDataType>
450 TDataType * GetData ()
const;
457 class AbstractBindArrayObject
460 AbstractBindArrayObject() { }
461 virtual ~AbstractBindArrayObject() { }
462 virtual void SetInData() = 0;
463 virtual void SetOutData() = 0;
467 template <
class TObjectType,
class TDataType>
468 class BindArrayObject :
public AbstractBindArrayObject
474 std::vector<TObjectType> & _vector;
477 unsigned int _elemCount;
478 unsigned int _elemSize;
482 BindArrayObject(
const Statement &statement,
const ostring& name, std::vector<TObjectType> &vector,
unsigned int mode,
unsigned int elemSize);
483 virtual ~BindArrayObject();
488 operator std::vector<TObjectType> & ()
const;
489 operator TDataType * ()
const;
497 AbstractBindArrayObject * _object;
500 template <
class TNativeType,
class TObjectType>
501 class BindAdaptor :
public BindObject
503 friend class Statement;
507 operator TNativeType *()
const;
512 BindAdaptor(
const Statement &statement,
const ostring& name, TObjectType &
object,
unsigned int size);
513 virtual ~BindAdaptor();
517 TObjectType& _object;
526 BindsHolder(
const Statement &statement);
531 void AddBindObject(BindObject *bindObject);
538 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.
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
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...
void * AnyPointer
Alias for the generic void pointer.
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
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.
static TResultType Check(TResultType result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
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 ) ...