cartobase  4.5.0
carto::DynArrayInterface Class Referenceabstract

A dynamic array has resize and insertion capabilities (like a STL vector) More...

#include <cartobase/object/object.h>

Inheritance diagram for carto::DynArrayInterface:
Collaboration diagram for carto::DynArrayInterface:

Public Member Functions

virtual ~DynArrayInterface ()
 
virtual bool isDynArray () const
 Returns false if the stored object doesn't actually implement the DynArrayInterface API (needed since all GenericObject inherit this interface whatever they actually contain) More...
 
virtual void reserveArray (size_t)=0
 like the STL vector::reserve(), memory is reserved but no element is stored More...
 
virtual void resizeArray (size_t)=0
 resize the array. More...
 
virtual void removeArrayItem (int)=0
 removes an element from the array. More...
 
virtual void insertArrayItem (int, Object)=0
 inserts an element into the array. More...
 
- Public Member Functions inherited from carto::ArrayInterface
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
 

Detailed Description

A dynamic array has resize and insertion capabilities (like a STL vector)

Definition at line 315 of file object.h.

Constructor & Destructor Documentation

virtual carto::DynArrayInterface::~DynArrayInterface ( )
virtual

Member Function Documentation

virtual void carto::DynArrayInterface::insertArrayItem ( int  ,
Object   
)
pure virtual

inserts an element into the array.

All elements after this one may be moved, so iterators pointing after it may become invalid

Implemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.

virtual bool carto::DynArrayInterface::isDynArray ( ) const
virtual

Returns false if the stored object doesn't actually implement the DynArrayInterface API (needed since all GenericObject inherit this interface whatever they actually contain)

Reimplemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.

virtual void carto::DynArrayInterface::removeArrayItem ( int  )
pure virtual

removes an element from the array.

All elements after the one removed may be moved, so iterators pointing after it may become invalid

Implemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.

virtual void carto::DynArrayInterface::reserveArray ( size_t  )
pure virtual

like the STL vector::reserve(), memory is reserved but no element is stored

Implemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.

virtual void carto::DynArrayInterface::resizeArray ( size_t  )
pure virtual

resize the array.

This may need to copy all existing elements, so all iterators may become invalid after this operation

Implemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.


The documentation for this class was generated from the following file: