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;
119 typedef EnableIf<IsSame<T, unsigned char>::value ||
120 IsSame<T, char>::value ||
121 IsSame<T, float>::value ||
122 IsSame<T, double>::value> Type;
142 operator unsigned int()
const;
144 bool operator == (
const Enum& other)
const;
145 bool operator != (
const Enum& other)
const;
147 bool operator == (
const T& other)
const;
148 bool operator != (
const T& other)
const;
170 Flags& operator = (
const Flags& other)
noexcept;
172 Flags operator~ ()
const;
174 Flags operator | (T other)
const;
175 Flags operator & (T other)
const;
176 Flags operator ^ (T other)
const;
182 Flags& operator |= (T other);
183 Flags& operator &= (T other);
184 Flags& operator ^= (T other);
190 bool operator == (T other)
const;
191 bool operator == (
const Flags& other)
const;
193 unsigned int GetValues()
const;
195 bool IsSet(T other)
const;
199 Flags(
unsigned int flags);
208 template<
typename T>
246 void Acquire()
const;
247 void Release()
const;
269 void Acquire()
const;
270 void Release()
const;
281 template<
class K,
class V>
291 void Set(K key, V value);
314 void Remove(T value);
317 bool Exists(
const T& value);
320 bool FindIf(P predicate, T& value);
323 void ForEach(A action);
343 virtual void DetachFromHolders() = 0;
344 virtual void DetachFromParent() = 0;
346 virtual Handle* GetParent()
const = 0;
384 operator bool()
const;
399 typedef void(*SmartHandleFreeNotifyFunc)(SmartHandle* smartHandle);
401 Handle* GetHandle()
const;
403 void AcquireAllocated(T handle,
Handle* parent);
404 void AcquireTransient(T handle,
Handle* parent);
405 void AcquireAllocatedWithNotification(T handle,
Handle* parent, SmartHandleFreeNotifyFunc freeNotifyFunc);
408 void Acquire(T handle,
bool allocated, SmartHandleFreeNotifyFunc freeNotifyFunc,
Handle* parent);
411 class SmartHandle :
public Handle
415 SmartHandle(
HandleHolder* holder, T handle,
bool allocated, SmartHandleFreeNotifyFunc freeNotifyFunc,
Handle* parent);
416 virtual ~SmartHandle()
noexcept;
429 void DetachFromHolders()
override;
430 void DetachFromParent()
override;
432 Handle* GetParent()
const override;
436 static void DeleteHandle(
Handle* handle);
447 SmartHandleFreeNotifyFunc _freeNotifyFunc;
453 SmartHandle* _smartHandle;
472 virtual ostring ToString()
const = 0;
475 friend T& operator << (T& lhs,
const Streamable& rhs)
477 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.
Internal usage. Determine if the given type is a supported numeric type.