OCILIB (C and C++ Driver for Oracle)
4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
|
Object identifying the SQL data types VARRAY and NESTED TABLE. More...
#include <types.hpp>
Inherits ocilib::core::HandleHolder< OCI_Coll * >, and ocilib::core::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 core::Enum< CollectionTypeValues > | CollectionType |
Collection type. | |
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. | |
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. | |
void | Truncate (unsigned int size) |
Trim the given number of elements from the end of the collection. | |
void | Clear () |
Clear all items of the collection. | |
bool | IsElementNull (unsigned int index) const |
check if the element at the given index is null | |
void | SetElementNull (unsigned int index) |
Nullify the element at the given index. | |
bool | Delete (unsigned int index) const |
Delete the element at the given position in the Nested Table Collection. | |
T | Get (unsigned int index) const |
Return the collection element value at the given position. | |
void | Set (unsigned int index, const T &value) |
Set the collection element value at the given position. | |
void | Append (const T &value) |
Append the given element value at the end of the collection. | |
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. | |
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
typedef core::Enum<CollectionTypeValues> ocilib::Collection< T >::CollectionType |
Collection type.
Possible values are Collection::CollectionTypeValues
typedef CollectionIterator<CollectionElement<T> > ocilib::Collection< T >::iterator |
typedef CollectionIterator<const CollectionElement<T> > ocilib::Collection< T >::const_iterator |
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 |
ocilib::Collection< T >::Collection |
Create an empty null Collection instance.
Definition at line 31 of file Collection.hpp.
ocilib::Collection< T >::Collection | ( | const TypeInfo & | typeInfo | ) |
Parametrized constructor.
typeInfo | - type info descriptor |
Definition at line 36 of file Collection.hpp.
References ocilib::core::Check(), ocilib::TypeInfo::GetConnection(), and OCI_CollCreate().
Collection< T >::CollectionType ocilib::Collection< T >::GetType |
Return the type of the collection.
Definition at line 68 of file Collection.hpp.
References ocilib::core::Check(), and OCI_CollGetType().
unsigned int ocilib::Collection< T >::GetMax |
Returns the maximum number of elements for the collection.
Definition at line 74 of file Collection.hpp.
References ocilib::core::Check(), and OCI_CollGetMax().
unsigned int ocilib::Collection< T >::GetSize |
Returns the total number of elements in the collection.
Definition at line 80 of file Collection.hpp.
References ocilib::core::Check(), and OCI_CollGetSize().
unsigned int ocilib::Collection< T >::GetCount |
Returns the current number of elements in the collection.
Definition at line 87 of file Collection.hpp.
References ocilib::core::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 94 of file Collection.hpp.
References ocilib::core::Check(), and OCI_CollTrim().
void ocilib::Collection< T >::Clear |
Clear all items of the collection.
Definition at line 100 of file Collection.hpp.
References ocilib::core::Check(), and OCI_CollClear().
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 106 of file Collection.hpp.
References ocilib::core::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 112 of file Collection.hpp.
References ocilib::core::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 118 of file Collection.hpp.
References ocilib::core::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 148 of file Collection.hpp.
References ocilib::core::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 154 of file Collection.hpp.
References ocilib::core::Check(), OCI_CollGetElem(), and OCI_CollSetElem().
void ocilib::Collection< T >::Append | ( | const T & | value | ) |
Append the given element value at the end of the collection.
value | - Value to add |
Definition at line 164 of file Collection.hpp.
References ocilib::core::Check(), OCI_CollAppend(), OCI_CollGetTypeInfo(), OCI_ElemCreate(), and OCI_ElemFree().
TypeInfo ocilib::Collection< T >::GetTypeInfo |
Return the type information object associated to the collection.
Definition at line 62 of file Collection.hpp.
References ocilib::core::Check(), and OCI_CollGetTypeInfo().
Collection< T > ocilib::Collection< T >::Clone |
Clone the current instance to a new one performing deep copy.
Definition at line 52 of file Collection.hpp.
References ocilib::core::Check(), and OCI_CollAssign().
|
overridevirtual |
return a string representation of the current collection
Implements ocilib::core::Streamable.
Definition at line 468 of file Collection.hpp.
References ocilib::core::Check(), ocilib::core::MakeString(), and OCI_CollToText().
Collection< T >::iterator ocilib::Collection< T >::begin |
Returns an iterator pointing to the first element in the collection.
Definition at line 124 of file Collection.hpp.
Collection< T >::const_iterator ocilib::Collection< T >::begin |
Returns a const iterator pointing to the first element in the collection.
Definition at line 130 of file Collection.hpp.
Collection< T >::iterator ocilib::Collection< T >::end |
Returns an iterator referring to the past-the-end element in the collection.
Definition at line 136 of file Collection.hpp.
Collection< T >::const_iterator ocilib::Collection< T >::end |
Returns a const iterator referring to the past-the-end element in the collection.
Definition at line 142 of file Collection.hpp.
CollectionElement< T > ocilib::Collection< T >::operator[] | ( | unsigned int | index | ) |
Returns the element at a given position in the collection.
Definition at line 487 of file Collection.hpp.
CollectionElement< T > ocilib::Collection< T >::operator[] | ( | unsigned int | index | ) | const |
Returns the element at a given position in the collection.
Definition at line 493 of file Collection.hpp.