libzed 1.9.9
A general-purpose library for quick and simple data manipulation.
 
Loading...
Searching...
No Matches
z::core::indexable< T > Interface Template Referenceabstract

A base interface for all objects whose elements can be directly indexed. More...

#include <indexable.hpp>

Inheritance diagram for z::core::indexable< T >:
z::core::arrayLike< const T &, T * > z::core::arrayLike< const TYPE &, circularIterator< TYPE, LEN > > z::core::arrayLike< uint32_t, stringIterator< utf8 > > z::core::arrayLike< const zstring *&, zstring ** > z::core::arrayLike< uint32_t, stringIterator< E > > z::core::arrayLike< T, ITER > z::core::array< T > z::core::circularBuffer< TYPE, LEN > z::core::string< z::utf8 > z::core::string< ascii > z::core::array< zstring * > z::core::string< E > z::core::sortedArray< zstring * > z::core::refArray< T > z::core::sortedArray< T > z::core::sortedRefArray< zstring * > z::core::sortedRefArray< T > z::util::dictionary

Public Member Functions

virtual ~indexable () noexcept
 Virtual destructor.
 
virtual T at (int index) const =0
 Function to get the object at the given index.
 
virtual T operator[] (int index) const
 Function to get the object at the given index.
 

Detailed Description

template<typename T>
interface z::core::indexable< T >

A base interface for all objects whose elements can be directly indexed.

Member Function Documentation

◆ at()

template<typename T >
virtual T z::core::indexable< T >::at ( int  index) const
pure virtual

Function to get the object at the given index.

Parameters
indexthe index of the desired object.
Returns
The object at the given index.
See also
operator[](int)

Implemented in z::core::circularBuffer< TYPE, LEN >, z::core::string< E >, z::core::string< ascii >, z::core::string< z::utf8 >, z::core::array< T >, and z::core::array< zstring * >.

◆ operator[]()

template<typename T >
virtual T z::core::indexable< T >::operator[] ( int  index) const
inlinevirtual

Function to get the object at the given index.

Identical behavior to at(int), but allows indexing with square brackets.

Parameters
indexthe index of the desired object.
Returns
The object at the given index.
See also
at(int)

Implemented in z::core::array< T >, and z::core::array< zstring * >.


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