Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::internal::RegisteredArrayBase< Registry > Class Template Referenceabstract

Abstract base class for registered arrays. More...

#include <ogdf/basic/RegisteredArray.h>

+ Inheritance diagram for ogdf::internal::RegisteredArrayBase< Registry >:

Public Member Functions

 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...
 
virtual void copyEntry (int newIndex, int oldIndex)=0
 Copies the entry stored at oldIndex to newIndex. 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...
 
virtual void resize (int size, bool shrink)=0
 Resizes the registered array to size. The array will only shrink if shrink is true. More...
 
virtual void swapEntries (int index1, int index2)=0
 Swaps the entries stored at index1 and index2. More...
 
void unregister () noexcept
 Clears the array and associates it with no registry. More...
 

Protected Member Functions

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...
 

Private Types

using registration_iterator_type = typename Registry::registration_iterator_type
 
using registry_type = Registry
 

Private Attributes

const Registry * m_pRegistry = nullptr
 
registration_iterator_type m_registration
 

Detailed Description

template<class Registry>
class ogdf::internal::RegisteredArrayBase< Registry >

Abstract base class for registered arrays.

Defines the interface for event handling used by the registry.

Template Parameters
RegistryThe class which manages the registered keys. Must provide the functions defined in class RegistryBase.

Definition at line 57 of file RegisteredArray.h.

Member Typedef Documentation

◆ registration_iterator_type

template<class Registry >
using ogdf::internal::RegisteredArrayBase< Registry >::registration_iterator_type = typename Registry::registration_iterator_type
private

Definition at line 259 of file RegisteredArray.h.

◆ registry_type

template<class Registry >
using ogdf::internal::RegisteredArrayBase< Registry >::registry_type = Registry
private

Definition at line 258 of file RegisteredArray.h.

Constructor & Destructor Documentation

◆ RegisteredArrayBase() [1/3]

template<class Registry >
ogdf::internal::RegisteredArrayBase< Registry >::RegisteredArrayBase ( )
default

Creates a registered array associated with no registry.

◆ RegisteredArrayBase() [2/3]

template<class Registry >
ogdf::internal::RegisteredArrayBase< Registry >::RegisteredArrayBase ( const RegisteredArrayBase< Registry > &  copy)
inline

Creates a registered array associated with the same registry as copy.

Definition at line 269 of file RegisteredArray.h.

◆ RegisteredArrayBase() [3/3]

template<class Registry >
ogdf::internal::RegisteredArrayBase< Registry >::RegisteredArrayBase ( RegisteredArrayBase< Registry > &&  move_from)
inlinenoexcept

Moves the registration of move_from to this registered array.

Definition at line 272 of file RegisteredArray.h.

◆ ~RegisteredArrayBase()

template<class Registry >
virtual ogdf::internal::RegisteredArrayBase< Registry >::~RegisteredArrayBase ( )
inlinevirtualnoexcept

Destructor.

Definition at line 289 of file RegisteredArray.h.

Member Function Documentation

◆ copyEntry()

template<class Registry >
virtual void ogdf::internal::RegisteredArrayBase< Registry >::copyEntry ( int  newIndex,
int  oldIndex 
)
pure virtual

Copies the entry stored at oldIndex to newIndex.

Implemented in ogdf::internal::RegisteredArrayWithoutDefaultOrIndexAccess< Registry, Value >.

◆ moveRegister()

template<class Registry >
void ogdf::internal::RegisteredArrayBase< Registry >::moveRegister ( RegisteredArrayBase< Registry > &  move_from)
inlineprotected

Moves array registration from move_from to this array.

Definition at line 325 of file RegisteredArray.h.

◆ operator=() [1/2]

template<class Registry >
RegisteredArrayBase& ogdf::internal::RegisteredArrayBase< Registry >::operator= ( const RegisteredArrayBase< Registry > &  copy)
inline

Assignment operator.

Definition at line 277 of file RegisteredArray.h.

◆ operator=() [2/2]

template<class Registry >
RegisteredArrayBase& ogdf::internal::RegisteredArrayBase< Registry >::operator= ( RegisteredArrayBase< Registry > &&  move_from)
inlinenoexcept

Assignment operator (move semantics).

Definition at line 283 of file RegisteredArray.h.

◆ registeredAt()

template<class Registry >
const Registry* ogdf::internal::RegisteredArrayBase< Registry >::registeredAt ( ) const
inline

Returns a pointer to the associated registry.

Definition at line 340 of file RegisteredArray.h.

◆ reregister()

template<class Registry >
void ogdf::internal::RegisteredArrayBase< Registry >::reregister ( const Registry *  registry)
inlineprotected

Associates the array with a new registry.

Definition at line 312 of file RegisteredArray.h.

◆ resize()

template<class Registry >
virtual void ogdf::internal::RegisteredArrayBase< Registry >::resize ( int  size,
bool  shrink 
)
pure virtual

Resizes the registered array to size. The array will only shrink if shrink is true.

Implemented in ogdf::internal::RegisteredArrayWithoutDefaultOrIndexAccess< Registry, Value >.

◆ swapEntries()

template<class Registry >
virtual void ogdf::internal::RegisteredArrayBase< Registry >::swapEntries ( int  index1,
int  index2 
)
pure virtual

Swaps the entries stored at index1 and index2.

Implemented in ogdf::internal::RegisteredArrayWithoutDefaultOrIndexAccess< Registry, Value >.

◆ unregister()

template<class Registry >
void ogdf::internal::RegisteredArrayBase< Registry >::unregister ( )
inlinenoexcept

Clears the array and associates it with no registry.

Definition at line 305 of file RegisteredArray.h.

Member Data Documentation

◆ m_pRegistry

template<class Registry >
const Registry* ogdf::internal::RegisteredArrayBase< Registry >::m_pRegistry = nullptr
private

Definition at line 262 of file RegisteredArray.h.

◆ m_registration

template<class Registry >
registration_iterator_type ogdf::internal::RegisteredArrayBase< Registry >::m_registration
private

Definition at line 261 of file RegisteredArray.h.


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