Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::internal::RegisteredArrayWithoutDefaultWithIndexAccess< Registry, Value > Class Template Reference

RegisteredArrayWithoutDefaultOrIndexAccess that also allows accessing its values directly by their index. More...

#include <ogdf/basic/RegisteredArray.h>

+ Inheritance diagram for ogdf::internal::RegisteredArrayWithoutDefaultWithIndexAccess< Registry, Value >:

Public Member Functions

 RegisteredArrayWithoutDefaultWithIndexAccess ()=default
 
 RegisteredArrayWithoutDefaultWithIndexAccess (const Registry *registry)
 
RA::value_ref_type operator[] (int idx)
 Returns a reference to the element with index idx. More...
 
RA::value_const_ref_type operator[] (int idx) const
 Returns a const reference to the element with index idx. More...
 
- Public Member Functions inherited from ogdf::internal::RegisteredArrayWithoutDefaultOrIndexAccess< Registry, Value >
 RegisteredArrayWithoutDefaultOrIndexAccess ()=default
 Creates a new registered array associated with no registry. More...
 
 RegisteredArrayWithoutDefaultOrIndexAccess (const Registry *registry)
 Creates a new registered array associated with registry. More...
 
iterator begin ()
 Returns an iterator to the first key-value pair in the array. More...
 
const_iterator begin () const
 Returns a const iterator to the first key-value pair in the array. More...
 
const_iterator cbegin () const
 Returns a const iterator to the first key-value pair in the array. More...
 
const_iterator cend () const
 Returns the const past-the-end iterator of the array. More...
 
iterator end ()
 Returns the past-the-end iterator of the array. More...
 
const_iterator end () const
 Returns the const past-the-end iterator of the array. More...
 
void fill (value_const_ref_type x)
 Fills all entries with value x. More...
 
void init (const Registry *registry=nullptr)
 Associates the array with registry. All entries are initialized using the default constructor of Value. More...
 
value_ref_type operator() (key_type key)
 Returns a reference to the element associated with key. More...
 
value_const_ref_type operator() (key_type key) const
 Returns a const reference to the element associated with key. More...
 
value_ref_type operator[] (key_type key)
 Returns a reference to the element associated with key. More...
 
value_const_ref_type operator[] (key_type key) const
 Returns a const reference to the element associated with key. More...
 
const Registry * registeredAt () const
 Returns a pointer to the associated registry. More...
 
bool valid () const
 Returns true iff the array is associated with a registry. More...
 

Private Types

using RA = RegisteredArrayWithoutDefaultOrIndexAccess< Registry, Value >
 

Additional Inherited Members

- Public Types inherited from ogdf::internal::RegisteredArrayWithoutDefaultOrIndexAccess< Registry, Value >
using const_iterator = RegisteredArrayIterator< registered_array, key_iterator, true >
 
using iterator = RegisteredArrayIterator< registered_array, key_iterator, false >
 
using key_type = typename Registry::key_type
 
using registry_type = Registry
 
using value_const_ref_type = typename vector_type::const_reference
 
using value_ref_type = typename vector_type::reference
 
using value_type = typename vector_type::value_type
 
using vector_type = std::vector< Value, OGDFAllocator< Value > >
 
- Protected Types inherited from ogdf::internal::RegisteredArrayWithoutDefaultOrIndexAccess< Registry, Value >
using key_iterator = typename Registry::iterator_type
 
using registered_array = RegisteredArrayWithoutDefaultOrIndexAccess< Registry, Value >
 
using registered_array_base = RegisteredArrayBase< Registry >
 
- Protected Member Functions inherited from ogdf::internal::RegisteredArrayWithoutDefaultOrIndexAccess< Registry, Value >
void copyEntry (int toIndex, int fromIndex) override
 This operation is not supported for registered arrays without default. More...
 
const Registry & getRegistry () const
 Returns a reference to the associated registry. More...
 
void resize (int size, bool shrink) override
 Resizes the registered array to size. The array will only shrink if shrink is true. More...
 
void swapEntries (int index1, int index2) override
 Swaps the entries stored at index1 and index2. More...
 
- Protected Member Functions inherited from ogdf::internal::RegisteredArrayBase< Registry >
void moveRegister (RegisteredArrayBase< Registry > &move_from)
 Moves array registration from move_from to this array. More...
 
void reregister (const Registry *registry)
 Associates the array with a new registry. More...
 
 RegisteredArrayBase ()=default
 Creates a registered array associated with no registry. More...
 
 RegisteredArrayBase (const RegisteredArrayBase< Registry > &copy)
 Creates a registered array associated with the same registry as copy. More...
 
 RegisteredArrayBase (RegisteredArrayBase< Registry > &&move_from) noexcept
 Moves the registration of move_from to this registered array. More...
 
virtual ~RegisteredArrayBase () noexcept
 Destructor. More...
 
RegisteredArrayBaseoperator= (const RegisteredArrayBase< Registry > &copy)
 Assignment operator. More...
 
RegisteredArrayBaseoperator= (RegisteredArrayBase< Registry > &&move_from) noexcept
 Assignment operator (move semantics). More...
 
const Registry * registeredAt () const
 Returns a pointer to the associated registry. More...
 
void unregister () noexcept
 Clears the array and associates it with no registry. More...
 
- Protected Attributes inherited from ogdf::internal::RegisteredArrayWithoutDefaultOrIndexAccess< Registry, Value >
vector_type m_data
 

Detailed Description

template<class Registry, class Value>
class ogdf::internal::RegisteredArrayWithoutDefaultWithIndexAccess< Registry, Value >

RegisteredArrayWithoutDefaultOrIndexAccess that also allows accessing its values directly by their index.

Definition at line 586 of file RegisteredArray.h.

Member Typedef Documentation

◆ RA

template<class Registry , class Value >
using ogdf::internal::RegisteredArrayWithoutDefaultWithIndexAccess< Registry, Value >::RA = RegisteredArrayWithoutDefaultOrIndexAccess<Registry, Value>
private

Definition at line 588 of file RegisteredArray.h.

Constructor & Destructor Documentation

◆ RegisteredArrayWithoutDefaultWithIndexAccess() [1/2]

template<class Registry , class Value >
ogdf::internal::RegisteredArrayWithoutDefaultWithIndexAccess< Registry, Value >::RegisteredArrayWithoutDefaultWithIndexAccess ( )
default

◆ RegisteredArrayWithoutDefaultWithIndexAccess() [2/2]

template<class Registry , class Value >
ogdf::internal::RegisteredArrayWithoutDefaultWithIndexAccess< Registry, Value >::RegisteredArrayWithoutDefaultWithIndexAccess ( const Registry *  registry)
inlineexplicit

Definition at line 593 of file RegisteredArray.h.

Member Function Documentation

◆ operator[]() [1/2]

template<class Registry , class Value >
RA::value_ref_type ogdf::internal::RegisteredArrayWithoutDefaultWithIndexAccess< Registry, Value >::operator[] ( int  idx)
inline

Returns a reference to the element with index idx.

Definition at line 608 of file RegisteredArray.h.

◆ operator[]() [2/2]

template<class Registry , class Value >
RA::value_const_ref_type ogdf::internal::RegisteredArrayWithoutDefaultWithIndexAccess< Registry, Value >::operator[] ( int  idx) const
inline

Returns a const reference to the element with index idx.

Definition at line 599 of file RegisteredArray.h.


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