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>
222 virtual ~
Locker() noexcept;
227 void SetAccessMode(
bool threaded);
245 void SetLocker(
Locker* locker);
259 template<
class K,
class V>
269 void Set(K key, V value);
292 void Remove(T value);
295 bool Exists(
const T& value);
298 bool FindIf(P predicate, T& value);
301 void ForEach(A action);
316 virtual ~
Handle() noexcept {}
318 virtual void DetachFromHolders() = 0;
319 virtual void DetachFromParent() = 0;
334 operator bool()
const;
349 typedef boolean(OCI_API* HandleFreeFunc)(
AnyPointer handle);
351 typedef void(*SmartHandleFreeNotifyFunc)(SmartHandle* smartHandle);
353 Handle* GetHandle()
const;
355 void Acquire(T handle, HandleFreeFunc handleFreefunc, SmartHandleFreeNotifyFunc freeNotifyFunc,
Handle* parent);
359 class SmartHandle :
public Handle 363 SmartHandle(
HandleHolder* holder, T handle, HandleFreeFunc handleFreefunc, SmartHandleFreeNotifyFunc freeNotifyFunc,
Handle* parent);
364 virtual ~SmartHandle() noexcept;
373 Handle* GetParent()
const;
379 void DetachFromHolders()
override;
380 void DetachFromParent()
override;
384 static void DeleteHandle(
Handle* handle);
393 HandleFreeFunc _handleFreeFunc;
394 SmartHandleFreeNotifyFunc _freeNotifyFunc;
399 SmartHandle* _smartHandle;
418 virtual ostring ToString()
const = 0;
421 friend T& operator << (T& lhs,
const Streamable& rhs)
423 lhs << static_cast<ostring>(rhs);
Internal usage. Interface for handling ownership and relationship of a C API handle.
Raw MakeRaw(AnyPointer result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
Internal usage. Locker object.
static T Check(T 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.
Template Flags template class providing some type safety to some extends for manipulating flags set v...
Internal usage. Map supporting concurrent access from multiple threads.
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
Internal usage. Determine if the given type is a supported numeric type.
Internal usage. Smart pointer class with reference counting for managing OCILIB object handles...
void * AnyPointer
Alias for the generic void pointer.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Internal usage. Provide a buffer class with RAII capabilities.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Internal usage. List supporting concurrent access from multiple threads.
Internal usage. Base class for types that can be locked.
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 ) ...