OCILIB (C and C++ Driver for Oracle)
4.6.3
|
Object identifying the SQL data types VARRAY and NESTED TABLE. More...
#include <ocilib.hpp>
Inherits ocilib::HandleHolder< OCI_Coll *>, and ocilib::Streamable.
Public Types | |
enum | CollectionTypeValues { Varray = OCI_COLL_VARRAY, NestedTable = OCI_COLL_NESTED_TABLE, IndexedTable = OCI_COLL_INDEXED_TABLE } |
Collection type enumerated values. More... | |
typedef Enum< CollectionTypeValues > | CollectionType |
Collection type. More... | |
typedef CollectionIterator< CollectionElement< T > > | iterator |
Common iterator declaration. | |
typedef CollectionIterator< const CollectionElement< T > > | const_iterator |
Common const iterator declaration. | |
Public Member Functions | |
Collection () | |
Create an empty null Collection instance. | |
Collection (const TypeInfo &typeInfo) | |
Parametrized constructor. More... | |
CollectionType | GetType () const |
Return the type of the collection. | |
unsigned int | GetMax () const |
Returns the maximum number of elements for the collection. | |
unsigned int | GetSize () const |
Returns the total number of elements in the collection. | |
unsigned int | GetCount () const |
Returns the current number of elements in the collection. More... | |
void | Truncate (unsigned int size) |
Trim the given number of elements from the end of the collection. More... | |
void | Clear () |
Clear all items of the collection. | |
bool | IsElementNull (unsigned int index) const |
check if the element at the given index is null More... | |
void | SetElementNull (unsigned int index) |
Nullify the element at the given index. More... | |
bool | Delete (unsigned int index) const |
Delete the element at the given position in the Nested Table Collection. More... | |
T | Get (unsigned int index) const |
Return the collection element value at the given position. More... | |
void | Set (unsigned int index, const T &value) |
Set the collection element value at the given position. More... | |
void | Append (const T &data) |
Append the given element value at the end of the collection. More... | |
TypeInfo | GetTypeInfo () const |
Return the type information object associated to the collection. | |
Collection | Clone () const |
Clone the current instance to a new one performing deep copy. | |
ostring | ToString () const override |
return a string representation of the current collection | |
iterator | begin () |
Returns an iterator pointing to the first element in the collection. | |
const_iterator | begin () const |
Returns a const iterator pointing to the first element in the collection. | |
iterator | end () |
Returns an iterator referring to the past-the-end element in the collection. | |
const_iterator | end () const |
Returns a const iterator referring to the past-the-end element in the collection. | |
CollectionElement< T > | operator[] (unsigned int index) |
Returns the element at a given position in the collection. | |
const CollectionElement< T > | operator[] (unsigned int index) const |
Returns the element at a given position in the collection. | |
Object identifying the SQL data types VARRAY and NESTED TABLE.
This class wraps the OCILIB object handle OCI_Coll and its related methods
Definition at line 5181 of file ocilib.hpp.
typedef Enum<CollectionTypeValues> ocilib::Collection< T >::CollectionType |
Collection type.
Possible values are Collection::CollectionTypeValues
Definition at line 5216 of file ocilib.hpp.
enum ocilib::Collection::CollectionTypeValues |
Collection type enumerated values.
Enumerator | |
---|---|
Varray | Collection is a VARRAY |
NestedTable | Collection is a NESTED TABLE |
IndexedTable | Collection is a PL/SQL TABLE INDEX BY |
Definition at line 5199 of file ocilib.hpp.
ocilib::Collection< T >::Collection | ( | const TypeInfo & | typeInfo | ) |
Parametrized constructor.
typeInfo | - type info descriptor |
Definition at line 3894 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::Collection< T >::Collection(), ocilib::TypeInfo::GetConnection(), OCI_CollCreate(), and OCI_CollFree().
unsigned int ocilib::Collection< T >::GetCount | ( | ) | const |
Returns the current number of elements in the collection.
Definition at line 3941 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_CollGetCount().
void ocilib::Collection< T >::Truncate | ( | unsigned int | size | ) |
Trim the given number of elements from the end of the collection.
size | - Number of elements to trim |
Definition at line 3948 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_CollTrim().
bool ocilib::Collection< T >::IsElementNull | ( | unsigned int | index | ) | const |
check if the element at the given index is null
index | - Index of the element |
Definition at line 3960 of file ocilib_impl.hpp.
References ocilib::Check(), OCI_CollGetElem(), and OCI_ElemIsNull().
void ocilib::Collection< T >::SetElementNull | ( | unsigned int | index | ) |
Nullify the element at the given index.
index | - Index of the element |
Definition at line 3966 of file ocilib_impl.hpp.
References ocilib::Check(), OCI_CollGetElem(), and OCI_ElemSetNull().
bool ocilib::Collection< T >::Delete | ( | unsigned int | index | ) | const |
Delete the element at the given position in the Nested Table Collection.
index | - Index of the element to delete |
Definition at line 3972 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_CollDeleteElem().
T ocilib::Collection< T >::Get | ( | unsigned int | index | ) | const |
Return the collection element value at the given position.
index | - Index of the element |
Definition at line 4002 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_CollGetElem().
void ocilib::Collection< T >::Set | ( | unsigned int | index, |
const T & | value | ||
) |
Set the collection element value at the given position.
index | - Index of the element |
value | - Value to set |
Definition at line 4008 of file ocilib_impl.hpp.
References ocilib::Check(), OCI_CollGetElem(), and OCI_CollSetElem().
void ocilib::Collection< T >::Append | ( | const T & | data | ) |
Append the given element value at the end of the collection.
data | - Value to add |
Definition at line 4018 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeRaw(), ocilib::MakeString(), OCI_CollAppend(), OCI_CollGetTypeInfo(), OCI_ElemCreate(), OCI_ElemFree(), OCI_ElemGetBigInt(), OCI_ElemGetBoolean(), OCI_ElemGetColl(), OCI_ElemGetDate(), OCI_ElemGetDouble(), OCI_ElemGetFile(), OCI_ElemGetFloat(), OCI_ElemGetInt(), OCI_ElemGetInterval(), OCI_ElemGetLob(), OCI_ElemGetNumber(), OCI_ElemGetObject(), OCI_ElemGetRaw(), OCI_ElemGetRawSize(), OCI_ElemGetRef(), OCI_ElemGetShort(), OCI_ElemGetString(), OCI_ElemGetTimestamp(), OCI_ElemGetUnsignedBigInt(), OCI_ElemGetUnsignedInt(), OCI_ElemGetUnsignedShort(), OCI_ElemSetBigInt(), OCI_ElemSetBoolean(), OCI_ElemSetColl(), OCI_ElemSetDate(), OCI_ElemSetDouble(), OCI_ElemSetFile(), OCI_ElemSetFloat(), OCI_ElemSetInt(), OCI_ElemSetInterval(), OCI_ElemSetLob(), OCI_ElemSetNumber(), OCI_ElemSetObject(), OCI_ElemSetRaw(), OCI_ElemSetRef(), OCI_ElemSetShort(), OCI_ElemSetString(), OCI_ElemSetTimestamp(), OCI_ElemSetUnsignedBigInt(), OCI_ElemSetUnsignedInt(), and OCI_ElemSetUnsignedShort().