26#include "ocilibcpp/config.hpp"
45#ifdef OCILIBPP_HAS_ENABLEIF
47 template<
bool B,
class T =
void>
48 using EnableIf = std::enable_if<B, T>;
50 template<
class T,
class U>
51 using IsSame = std::is_same<T, U>;
55 template<
bool B,
class T =
void>
59 struct EnableIf<true, T> {
typedef T type; };
62 struct BoolConstant {
static const bool value = B; };
64 template<
class T,
class U>
65 struct IsSame : BoolConstant<false> {};
68 struct IsSame<T, T> : BoolConstant<true> {};
72#define ARG_NOT_USED(a) (a) = (a)
80 static T
Check(T result);
101 typedef EnableIf<IsSame<T, short>::value ||
102 IsSame<T, unsigned short>::value ||
103 IsSame<T, int>::value ||
104 IsSame<T, unsigned int>::value ||
105 IsSame<T, big_int>::value ||
106 IsSame<T, big_uint>::value ||
107 IsSame<T, float>::value ||
108 IsSame<T, double>::value ||
109 IsSame<T, Number>::value> Type;
129 operator unsigned int()
const;
131 bool operator == (
const Enum& other)
const;
132 bool operator != (
const Enum& other)
const;
134 bool operator == (
const T& other)
const;
135 bool operator != (
const T& other)
const;
157 Flags& operator = (
const Flags& other)
noexcept;
159 Flags operator~ ()
const;
161 Flags operator | (T other)
const;
162 Flags operator & (T other)
const;
163 Flags operator ^ (T other)
const;
169 Flags& operator |= (T other);
170 Flags& operator &= (T other);
171 Flags& operator ^= (T other);
177 bool operator == (T other)
const;
178 bool operator == (
const Flags& other)
const;
180 unsigned int GetValues()
const;
182 bool IsSet(T other)
const;
186 Flags(
unsigned int flags);
195 template<
typename T>
233 void Acquire()
const;
234 void Release()
const;
256 void Acquire()
const;
257 void Release()
const;
268 template<
class K,
class V>
278 void Set(K key, V value);
301 void Remove(T value);
304 bool Exists(
const T& value);
307 bool FindIf(P predicate, T& value);
310 void ForEach(A action);
330 virtual void DetachFromHolders() = 0;
331 virtual void DetachFromParent() = 0;
375 operator bool()
const;
390 typedef void(*SmartHandleFreeNotifyFunc)(SmartHandle* smartHandle);
392 Handle* GetHandle()
const;
394 void AcquireAllocated(T handle,
Handle* parent);
395 void AcquireTransient(T handle,
Handle* parent);
396 void AcquireAllocatedWithNotification(T handle,
Handle* parent, SmartHandleFreeNotifyFunc freeNotifyFunc);
399 void Acquire(T handle,
bool allocated, SmartHandleFreeNotifyFunc freeNotifyFunc,
Handle* parent);
402 class SmartHandle :
public Handle
406 SmartHandle(
HandleHolder* holder, T handle,
bool allocated, SmartHandleFreeNotifyFunc freeNotifyFunc,
Handle* parent);
407 virtual ~SmartHandle()
noexcept;
416 Handle* GetParent()
const;
422 void DetachFromHolders()
override;
423 void DetachFromParent()
override;
428 static void DeleteHandle(
Handle* handle);
439 SmartHandleFreeNotifyFunc _freeNotifyFunc;
445 SmartHandle* _smartHandle;
464 virtual ostring ToString()
const = 0;
467 friend T& operator << (T& lhs,
const Streamable& rhs)
469 lhs << static_cast<ostring>(rhs);
Internal usage. List supporting concurrent access from multiple threads.
Internal usage. Map supporting concurrent access from multiple threads.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Template Flags template class providing some type safety to some extends for manipulating flags set v...
Internal usage. Smart pointer class with reference counting for managing OCILIB object handles.
Internal usage. Interface for handling ownership and relationship of a C API handle.
Internal usage. Provide a store for C Handles to C++ Handles mapping.
Internal usage. Provide a buffer class with RAII capabilities.
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
Internal usage. Base class for types that can be locked.
Internal usage. SynchronizationGuard object.
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so,...
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
Raw MakeRaw(AnyPointer result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
SynchronizationMode
Internal usage. Synchronization mode enumeration.
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 )
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
void * AnyPointer
Alias for the generic void pointer.
Internal usage. Determine if the given type is a supported numeric type.