This interface represents dynamic arrays, i.e., arrays with a variable number of elements. More...
#include <idynamic_array.h>
Public Member Functions | |
virtual void | set_length (Size size)=0 |
Sets the size of the array to size . More... | |
virtual void | clear ()=0 |
Sets the size of the array to zero. More... | |
virtual Sint32 | insert (Size index, base::IInterface *element)=0 |
Inserts the given element at the given index. More... | |
virtual Sint32 | erase (Size index)=0 |
Removes the element stored at the given index. More... | |
virtual Sint32 | push_back (base::IInterface *element)=0 |
Stores the given element at the end of the array. More... | |
virtual Sint32 | pop_back ()=0 |
Removes the last element from the array and decreases the array size by one. More... | |
virtual const base::IInterface * | back () const =0 |
Returns the last element of the array. More... | |
template<class T> | |
const T * | back () const |
Returns the last element of the array. More... | |
virtual base::IInterface * | back ()=0 |
Returns the last element of the array. More... | |
template<class T> | |
T * | back () |
Returns the last element of the array. More... | |
virtual const base::IInterface * | front () const =0 |
Returns the first element of the array. More... | |
template<class T> | |
const T * | front () const |
Returns the first element of the array. More... | |
virtual base::IInterface * | front ()=0 |
Returns the first element of the array. More... | |
template<class T> | |
T * | front () |
Returns the first element of the array. More... | |
Public Member Functions inherited from mi::IArray | |
virtual Size | get_length () const =0 |
Returns the size of the array. More... | |
virtual const base::IInterface * | get_element (Size index) const =0 |
Returns the index -th element of the array. More... | |
template<class T> | |
const T * | get_element (Size index) const |
Returns the index -th element of the array. More... | |
virtual base::IInterface * | get_element (Size index)=0 |
Returns the index -th element of the array. More... | |
template<class T> | |
T * | get_element (Size index) |
Returns the index -th element of the array. More... | |
virtual Sint32 | set_element (Size index, base::IInterface *element)=0 |
Sets the index -th element of the array. More... | |
virtual bool | empty () const =0 |
Checks whether the array is empty. More... | |
Public Member Functions inherited from mi::IData_collection | |
virtual Size | get_length () const =0 |
Returns the number of values. More... | |
virtual const char * | get_key (Size index) const =0 |
Returns the key corresponding to index . More... | |
virtual bool | has_key (const char *key) const =0 |
Indicates whether the key key exists or not. More... | |
virtual const base::IInterface * | get_value (const char *key) const =0 |
Returns the value for key key . More... | |
template<class T> | |
const T * | get_value (const char *key) const |
Returns the value for key key . More... | |
virtual base::IInterface * | get_value (const char *key)=0 |
Returns the value for key key . More... | |
template<class T> | |
T * | get_value (const char *key) |
Returns the value for key key . More... | |
virtual const base::IInterface * | get_value (Size index) const =0 |
Returns the value for index index . More... | |
template<class T> | |
const T * | get_value (Size index) const |
Returns the value for index index . More... | |
virtual base::IInterface * | get_value (Size index)=0 |
Returns the value for index index . More... | |
template<class T> | |
T * | get_value (Size index) |
Returns the value for index index . More... | |
virtual Sint32 | set_value (const char *key, base::IInterface *value)=0 |
Stores the value for key key . More... | |
virtual Sint32 | set_value (Size index, base::IInterface *value)=0 |
Stores the value for index index . More... | |
Public Member Functions inherited from mi::IData | |
virtual const char * | get_type_name () const =0 |
Returns the type name. More... | |
Public Member Functions inherited from mi::base::IInterface | |
virtual Uint32 | retain () const =0 |
Increments the reference count. More... | |
virtual Uint32 | release () const =0 |
Decrements the reference count. More... | |
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
Acquires a const interface from another. More... | |
template<class T> | |
const T * | get_interface () const |
Acquires a const interface from another. More... | |
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
Acquires a mutable interface from another. More... | |
template<class T> | |
T * | get_interface () |
Acquires a mutable interface from another. More... | |
virtual Uuid | get_iid () const =0 |
Returns the interface ID of the most derived interface. More... | |
Additional Inherited Members | |
Public Types inherited from mi::base::Interface_declare< 0x575af5ad, ... > | |
typedef Interface_declare< id1, ... > | Self |
Own type. More... | |
typedef Uuid_t< id1, ... > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Types inherited from mi::base::Interface_declare< 0x329db537, ... > | |
typedef Interface_declare< id1, ... > | Self |
Own type. More... | |
typedef Uuid_t< id1, ... > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Types inherited from mi::base::Interface_declare< 0x1bb2be0f, ... > | |
typedef Interface_declare< id1, ... > | Self |
Own type. More... | |
typedef Uuid_t< id1, ... > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Types inherited from mi::base::Interface_declare< 0x2e5f84bc, ... > | |
typedef Interface_declare< id1, ... > | Self |
Own type. More... | |
typedef Uuid_t< id1, ... > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Types inherited from mi::base::IInterface | |
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | IID |
Declares the interface ID (IID) of this interface. More... | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0x575af5ad, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0x329db537, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0x1bb2be0f, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0x2e5f84bc, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Static Public Member Functions inherited from mi::base::IInterface | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface. More... | |
This interface represents dynamic arrays, i.e., arrays with a variable number of elements.
Arrays are either typed or untyped. Typed arrays enforce all elements to be of the same type. The elements of typed arrays have to be derived from mi::IData. The type name of a typed dynamic array is the type name of the element followed by "[]"
, e.g., "Sint32[]"
for a dynamic array of mi::Sint32 elements. Initially, a dynamic array has size zero, i.e., it is empty.
Untyped arrays simply store pointers of type mi::base::IInterface. The type name of an untyped dynamic array is "Interface[]"
.
|
inline |
Returns the last element of the array.
NULL
if the array is empty.This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
|
inline |
Returns the last element of the array.
NULL
if the array is empty.This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
|
pure virtual |
Returns the last element of the array.
NULL
if the array is empty.
|
pure virtual |
Returns the last element of the array.
NULL
if the array is empty.
|
pure virtual |
Sets the size of the array to zero.
Removes all existing elements from the array (if any). Equivalent to calling set_length() with parameter 0.
Removes the element stored at the given index.
Removes the element at index
and shifts the remaining elements by one slot.
index
is out of bounds.
|
inline |
Returns the first element of the array.
NULL
if the array is empty.This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
|
inline |
Returns the first element of the array.
NULL
if the array is empty.This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
|
pure virtual |
Returns the first element of the array.
NULL
if the array is empty.
|
pure virtual |
Returns the first element of the array.
NULL
if the array is empty.
|
pure virtual |
Inserts the given element at the given index.
Stores element
at slot index
and shifts the remaining elements by one slot.
index
is out of bounds.element
is NULL
or has the wrong type.
|
pure virtual |
Removes the last element from the array and decreases the array size by one.
|
pure virtual |
Stores the given element at the end of the array.
Increases the array size by one and stores element
at the end of the array.
element
is NULL
or has the wrong type.
|
pure virtual |
Sets the size of the array to size
.
If the array size decreases, the first size
elements of the array are maintained and the surplus elements are removed from the array. If the array size increases, the existing elements are maintained, and the additional elements are default-constructed.