23 #include "ocilibcpp/types.hpp" 44 Acquire(pColl,
nullptr,
nullptr, parent);
134 return iterator(const_cast<Collection*>(
this), GetCount() + 1);
140 return const_iterator(const_cast<Collection*>(
this), GetCount() + 1);
154 SetElem(elem, value);
164 SetElem(elem, value);
173 ARG_NOT_USED(parent);
181 ARG_NOT_USED(parent);
189 ARG_NOT_USED(parent);
197 ARG_NOT_USED(parent);
205 ARG_NOT_USED(parent);
213 ARG_NOT_USED(parent);
221 ARG_NOT_USED(parent);
229 ARG_NOT_USED(parent);
237 ARG_NOT_USED(parent);
251 ARG_NOT_USED(parent);
259 ARG_NOT_USED(parent);
398 const AnyPointer data = value.empty() ? nullptr :
static_cast<AnyPointer>(
const_cast<Raw::value_type*
>(&value[0])) ;
468 unsigned int len = 0;
476 return core::MakeString(static_cast<const otext *>(buffer), static_cast<int>(len));
479 return OCI_STRING_NULL;
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemGetBoolean(OCI_Elem *elem)
Return the boolean value of the given collection element.
OCI_SYM_PUBLIC OCI_Timestamp *OCI_API OCI_ElemGetTimestamp(OCI_Elem *elem)
Return the Timestamp value of the given collection element.
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
long long big_int
big_int is a C scalar integer (32 or 64 bits) depending on compiler support for 64bits integers...
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetBigInt(OCI_Elem *elem, big_int value)
Set a big int value to a collection element.
OCI_SYM_PUBLIC int OCI_API OCI_ElemGetInt(OCI_Elem *elem)
Return the int value of the given collection element.
STL compliant Collection Random iterator class.
Internal usage. Interface for handling ownership and relationship of a C API handle.
OCI_SYM_PUBLIC OCI_Coll *OCI_API OCI_CollCreate(OCI_TypeInfo *typinf)
Create a local collection instance.
bool Delete(unsigned int index) const
Delete the element at the given position in the Nested Table Collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemIsNull(OCI_Elem *elem)
Check if the collection element value is null.
unsigned int GetCount() const
Returns the current number of elements in the collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetString(OCI_Elem *elem, const otext *value)
Set a string value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetDouble(OCI_Elem *elem, double value)
Set a double value to a collection element.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_CollGetMax(OCI_Coll *coll)
Returns the maximum number of elements of the given collection.
void Set(unsigned int index, const T &value)
Set the collection element value at the given position.
TypeInfo GetTypeInfo() const
Return the type information object associated to the collection.
iterator begin()
Returns an iterator pointing to the first element in the collection.
CollectionElement< T > operator[](unsigned int index)
Returns the element at a given position in the collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollTrim(OCI_Coll *coll, unsigned int nb_elem)
Trims the given number of elements from the end of the collection.
Raw MakeRaw(AnyPointer result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollAppend(OCI_Coll *coll, OCI_Elem *elem)
Append the given element at the end of the collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetDate(OCI_Elem *elem, OCI_Date *value)
Assign a Date handle to a collection element.
OCI_SYM_PUBLIC OCI_TypeInfo *OCI_API OCI_CollGetTypeInfo(OCI_Coll *coll)
Return the type info object associated to the collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetObject(OCI_Elem *elem, OCI_Object *value)
Assign an Object handle to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetNumber(OCI_Elem *elem, OCI_Number *value)
Set a number value to a collection element.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_ElemGetRawSize(OCI_Elem *elem)
Return the raw attribute value size of the given element handle.
OCI_SYM_PUBLIC OCI_Number *OCI_API OCI_ElemGetNumber(OCI_Elem *elem)
Return the number value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollDeleteElem(OCI_Coll *coll, unsigned int index)
Delete the element at the given position in the Nested Table Collection.
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.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetInterval(OCI_Elem *elem, OCI_Interval *value)
Assign an Interval handle to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetUnsignedShort(OCI_Elem *elem, unsigned short value)
Set a unsigned short value to a collection element.
ostring ToString() const override
return a string representation of the current collection
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetUnsignedInt(OCI_Elem *elem, unsigned int value)
Set a unsigned int value to a collection element.
OCI_SYM_PUBLIC const otext *OCI_API OCI_ElemGetString(OCI_Elem *elem)
Return the String value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetInt(OCI_Elem *elem, int value)
Set a int value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemFree(OCI_Elem *elem)
Free a local collection element.
OCI_SYM_PUBLIC OCI_Elem *OCI_API OCI_ElemCreate(OCI_TypeInfo *typinf)
Create a local collection element instance based on a collection type descriptor. ...
OCI_SYM_PUBLIC OCI_Lob *OCI_API OCI_ElemGetLob(OCI_Elem *elem)
Return the Lob value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetLob(OCI_Elem *elem, OCI_Lob *value)
Assign a Lob handle to a collection element.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_ElemGetRaw(OCI_Elem *elem, void *value, unsigned int len)
Read the RAW value of the collection element into the given buffer.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetTimestamp(OCI_Elem *elem, OCI_Timestamp *value)
Assign a Timestamp handle to a collection element.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_ElemGetUnsignedInt(OCI_Elem *elem)
Return the unsigned int value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetBoolean(OCI_Elem *elem, boolean value)
Set a boolean value to a collection element.
OCI_SYM_PUBLIC OCI_Date *OCI_API OCI_ElemGetDate(OCI_Elem *elem)
Return the Date value of the given collection element.
Object identifying the SQL data type REF.
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetColl(OCI_Elem *elem, OCI_Coll *value)
Assign a Collection handle to a collection element.
Class used for handling transient collection value. it is used internally by the Collection<T> class:...
OCI_SYM_PUBLIC unsigned int OCI_API OCI_CollGetCount(OCI_Coll *coll)
Returns the current number of elements of the given collection.
CollectionType GetType() const
Return the type of the collection.
void * AnyPointer
Alias for the generic void pointer.
void Clear()
Clear all items of the collection.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
OCI_SYM_PUBLIC OCI_Ref *OCI_API OCI_ElemGetRef(OCI_Elem *elem)
Return the Ref value of the given collection element.
unsigned int GetSize() const
Returns the total number of elements in the collection.
Object identifying the SQL data type BFILE.
Object identifying the SQL data types VARRAY and NESTED TABLE.
Collection Clone() const
Clone the current instance to a new one performing deep copy.
Object identifying the SQL data type INTERVAL.
OCI_SYM_PUBLIC OCI_Coll *OCI_API OCI_ElemGetColl(OCI_Elem *elem)
Return the collection value of the given collection element.
OCI_SYM_PUBLIC double OCI_API OCI_ElemGetDouble(OCI_Elem *elem)
Return the Double value of the given collection element.
Internal usage. Provide a buffer class with RAII capabilities.
void Append(const T &value)
Append the given element value at the end of the collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollFree(OCI_Coll *coll)
Free a local collection.
OCI_SYM_PUBLIC float OCI_API OCI_ElemGetFloat(OCI_Elem *elem)
Return the float value of the given collection element.
T Get(unsigned int index) const
Return the collection element value at the given position.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetNull(OCI_Elem *elem)
Set a collection element value to null.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_CollGetType(OCI_Coll *coll)
Return the collection type.
Connection GetConnection() const
Return the connection associated with a statement.
OCI_SYM_PUBLIC OCI_Elem *OCI_API OCI_CollGetElem(OCI_Coll *coll, unsigned int index)
Return the element at the given position in the collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetUnsignedBigInt(OCI_Elem *elem, big_uint value)
Set a unsigned big_int value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetFloat(OCI_Elem *elem, float value)
Set a float value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetRef(OCI_Elem *elem, OCI_Ref *value)
Assign a Ref handle to a collection element.
Collection()
Create an empty null Collection instance.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollToText(OCI_Coll *coll, unsigned int *size, otext *str)
Convert a collection handle value to a string.
unsigned int GetMax() const
Returns the maximum number of elements for the collection.
OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_ElemGetObject(OCI_Elem *elem)
Return the object value of the given collection element.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
iterator end()
Returns an iterator referring to the past-the-end element in the collection.
Provides type information on Oracle Database objects.
Object identifying the SQL data type NUMBER.
OCI_SYM_PUBLIC short OCI_API OCI_ElemGetShort(OCI_Elem *elem)
Return the short value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollAssign(OCI_Coll *coll, OCI_Coll *coll_src)
Assign a collection to another one.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_CollGetSize(OCI_Coll *coll)
Returns the total number of elements of the given collection.
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
bool IsElementNull(unsigned int index) const
check if the element at the given index is null
OCI_SYM_PUBLIC boolean OCI_API OCI_CollClear(OCI_Coll *coll)
clear all items of the given collection
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetFile(OCI_Elem *elem, OCI_File *value)
Assign a File handle to a collection element.
void SetElementNull(unsigned int index)
Nullify the element at the given index.
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
OCI_SYM_PUBLIC OCI_Interval *OCI_API OCI_ElemGetInterval(OCI_Elem *elem)
Return the Interval value of the given collection element.
OCI_SYM_PUBLIC unsigned short OCI_API OCI_ElemGetUnsignedShort(OCI_Elem *elem)
Return the unsigned short value of the given collection element.
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
OCI_SYM_PUBLIC big_int OCI_API OCI_ElemGetBigInt(OCI_Elem *elem)
Return the big int value of the given collection element.
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
OCI_SYM_PUBLIC OCI_File *OCI_API OCI_ElemGetFile(OCI_Elem *elem)
Return the File value of the given collection element.
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 ) ...
OCI_SYM_PUBLIC big_uint OCI_API OCI_ElemGetUnsignedBigInt(OCI_Elem *elem)
Return the unsigned big int value of the given collection element.
Object identifying the SQL data type TIMESTAMP.
Object identifying the SQL data type OBJECT.
void Truncate(unsigned int size)
Trim the given number of elements from the end of the collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollSetElem(OCI_Coll *coll, unsigned int index, OCI_Elem *elem)
Assign the given element value to the element at the given position in the collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetShort(OCI_Elem *elem, short value)
Set a short value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetRaw(OCI_Elem *elem, void *value, unsigned int len)
Set a RAW value to a collection element.
Object identifying the SQL data type DATE.