cartobase
5.0.5
|
ArrayInterface represents any container whose elements can be accessed via an integer index. More...
#include <cartobase/object/object.h>
Public Member Functions | |
virtual | ~ArrayInterface () |
virtual bool | isArray () const |
Returns false if the stored object doesn't actually implement the ArrayInterface API (needed since all GenericObject inherit this interface whatever they actually contain) More... | |
virtual Object | getArrayItem (int index) const =0 |
Get the element of index index . More... | |
virtual void | setArrayItem (int, Object)=0 |
virtual size_t | size () const =0 |
Number of sub-elements. More... | |
Public Member Functions inherited from carto::SizeInterface | |
virtual | ~SizeInterface () |
Public Member Functions inherited from carto::Interface | |
virtual | ~Interface () |
Public Member Functions inherited from carto::IterableInterface | |
virtual | ~IterableInterface () |
virtual bool | isIterable () const |
Returns false if the stored object doesn't actually implement the IterableInterface API (needed since all GenericObject inherit this interface whatever they actually contain) More... | |
virtual Object | objectIterator () const =0 |
returns an object implementing the IteratorIntrerface More... | |
virtual bool | operator== (const IterableInterface &other) const |
equality test More... | |
virtual bool | operator!= (const IterableInterface &other) const |
ArrayInterface represents any container whose elements can be accessed via an integer index.
|
virtual |
|
pure virtual |
Get the element of index index
.
An exception will be thrown if the stored object doesn't actually implement the ArrayInterface. But if it does, access to an element of index greater or equal to size() should not be attempted: depending on the exact storage type and array implementation, it can either throw an exception, or simply crash the program.
Implemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.
Referenced by carto::TypedObject< SyntaxedInterfaceType< T > >::getArrayItem().
|
virtual |
Returns false if the stored object doesn't actually implement the ArrayInterface API (needed since all GenericObject inherit this interface whatever they actually contain)
Reimplemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.
|
pure virtual |
Implemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.
|
pure virtual |
Number of sub-elements.
This method may throw an exception if the stored object has not a size-compatible interface
Implements carto::SizeInterface.
Implemented in carto::TypedObject< T >, carto::TypedObject< SyntaxedInterfaceType< T > >, and carto::GenericObject.