This class implements a base class for all indexed-based accessors allowing a non-constant reference access.
More...
|
| virtual bool | canAccess (const size_t &index) const |
| | Returns whether this accessor has a specific element.
|
| |
| virtual bool | firstElement (T &element, size_t &index) const |
| | Returns the first element of this accessor.
|
| |
| virtual bool | nextElement (const size_t &previousIndex, T &nextElement, size_t &nextIndex) const |
| | Returns the next element which follows a given key of the previous element.
|
| |
| NonconstIndexedAccessor< T > * | pointer () |
| | Returns the pointer to this object if this accessor holds at least one element (if this accessor is not empty).
|
| |
| virtual const T & | operator[] (const size_t &index) const =0 |
| | Returns one element of this accessor object by a given key.
|
| |
| virtual T & | operator[] (const size_t &index)=0 |
| | Returns one element of this accessor object by a given index.
|
| |
| virtual T * | data () |
| | Returns a pointer to the elements of this accessor if the data exists within one memory block without gaps.
|
| |
| virtual const T * | data () const |
| | Returns a pointer to the elements of this accessor if the data exists within one memory block without gaps.
|
| |
| virtual bool | canAccess (const TKey &key) const =0 |
| | Returns whether this accessor has a specific element.
|
| |
| virtual bool | firstElement (T &element, TKey &key) const =0 |
| | Returns the first element of this accessor.
|
| |
| virtual bool | nextElement (const TKey &previousKey, T &nextElement, TKey &nextKey) const =0 |
| | Returns the next element which follows a given key of the previous element.
|
| |
| virtual const T & | operator[] (const TKey &key) const =0 |
| | Returns one element of this accessor object by a given key.
|
| |
| virtual | ~Accessor ()=default |
| | Default destructor.
|
| |
| virtual size_t | size () const =0 |
| | Returns the number of accessible elements of this accessor object.
|
| |
| bool | isEmpty () const |
| | Returns whether this accessor provides no elements.
|
| |
|
| using | Type = T |
| | Definition of the element type of this accessor.
|
| |
| using | KeyType = TKey |
| | Definition of the key (or e.g., index) type of this accessor.
|
| |
| template<typename TAccessor > |
| static std::vector< typename TAccessor::Type > | accessor2elements (const TAccessor &accessor) |
| | Returns all elements of a given accessor (as a block).
|
| |
| template<typename TAccessor > |
| static std::unordered_map< typename TAccessor::KeyType, typename TAccessor::Type > | accessor2map (const TAccessor &accessor) |
| | Returns all elements of a given accessor as a map with key and elements.
|
| |
| template<typename TAccessor , typename TIndex > |
| static std::vector< typename TAccessor::Type > | accessor2subsetElements (const TAccessor &accessor, const std::vector< TIndex > &subset) |
| | Returns a subset of all elements of a given accessor (as a block).
|
| |
template<typename T>
class Ocean::NonconstIndexedAccessor< T >
This class implements a base class for all indexed-based accessors allowing a non-constant reference access.
- Template Parameters
-
| T | The data type of the elements of the accessor |