Ocean
Ocean::TemporaryIndexedAccessor< T > Class Template Referenceabstract

This class implements a base class for all indexed-based accessors allowing to access temporary elements. More...

Inheritance diagram for Ocean::TemporaryIndexedAccessor< T >:

Public Member Functions

virtual T operator[] (const size_t &index) const =0
 Returns one element of this accessor object by a given index. More...
 
virtual bool canAccess (const size_t &index) const
 Returns whether this accessor has a specific element. More...
 
- Public Member Functions inherited from Ocean::Accessor
virtual ~Accessor ()=default
 Default destructor. More...
 
virtual size_t size () const =0
 Returns the number of accessible elements of this accessor object. More...
 
bool isEmpty () const
 Returns whether this accessor provides no elements. More...
 

Protected Member Functions

 TemporaryIndexedAccessor ()=default
 Creates a new indexed-based accessor object. More...
 
- Protected Member Functions inherited from Ocean::TemporaryAccessor< T, size_t >
 TemporaryAccessor ()=default
 Creates a new indexed-based accessor object. More...
 
- Protected Member Functions inherited from Ocean::Accessor
 Accessor ()=default
 Protected default constructor. More...
 
 Accessor (const Accessor &accessor)=default
 Protected copy constructor. More...
 
Accessoroperator= (const Accessor &accessor)=delete
 Deleted assign operator. More...
 

Additional Inherited Members

- Public Types inherited from Ocean::TemporaryAccessor< T, size_t >
typedef T Type
 Definition of the element type of this accessor. More...
 
- Static Public Member Functions inherited from Ocean::Accessor
template<typename TAccessor >
static std::vector< typename TAccessor::Type > accessor2elements (const TAccessor &accessor)
 Returns all elements of a given accessor (as a block). More...
 
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. More...
 
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). More...
 

Detailed Description

template<typename T>
class Ocean::TemporaryIndexedAccessor< T >

This class implements a base class for all indexed-based accessors allowing to access temporary elements.

Template Parameters
TThe data type of the elements of the accessor

Constructor & Destructor Documentation

◆ TemporaryIndexedAccessor()

template<typename T >
Ocean::TemporaryIndexedAccessor< T >::TemporaryIndexedAccessor ( )
protecteddefault

Creates a new indexed-based accessor object.

Member Function Documentation

◆ canAccess()

template<typename T >
bool Ocean::TemporaryIndexedAccessor< T >::canAccess ( const size_t &  index) const
virtual

Returns whether this accessor has a specific element.

Parameters
indexThe index of the element to be checked
Returns
True, if the element exists

Implements Ocean::TemporaryAccessor< T, size_t >.

◆ operator[]()

template<typename T >
virtual T Ocean::TemporaryIndexedAccessor< T >::operator[] ( const size_t &  index) const
pure virtual

Returns one element of this accessor object by a given index.

Parameters
indexThe index of element to be accessed, with range [0, size())
Returns
The requested element

Implements Ocean::TemporaryAccessor< T, size_t >.


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