Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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

Registered arrays with default values. More...

#include <ogdf/basic/RegisteredArray.h>

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

Public Member Functions

 RegisteredArrayWithDefault ()
 Creates a new registered array associated with no registry and a default-constructed default value. More...
 
 RegisteredArrayWithDefault (const Registry *registry)
 Creates a new registered array associated with registry and a default-constructed default value. More...
 
 RegisteredArrayWithDefault (const Registry *registry, const Value &def)
 Creates a new registered array associated with registry and default value def. More...
 
 RegisteredArrayWithDefault (const Registry *registry, Value &&def)
 Creates a new registered array associated with registry and default value def. More...
 
 RegisteredArrayWithDefault (const Value &def)
 Creates a new registered array associated with no registry and default value def. More...
 
 RegisteredArrayWithDefault (Value &&def)
 Creates a new registered array associated with no registry and default value def. More...
 
void fillWithDefault ()
 Overwrites all values with the current default value. More...
 
Value & getDefault ()
 Returns the current default value for new keys. More...
 
const Value & getDefault () const
 Returns the current default value for new keys. More...
 
void setDefault (const Value &def)
 Sets a new default value for new keys. More...
 
void setDefault (Value &&def)
 Sets a new default value for new keys. More...
 

Protected Member Functions

void copyEntry (int toIndex, int fromIndex) override
 Copies the entry stored at oldIndex to newIndex. More...
 
void resize (int size, bool shrink) override
 

Private Types

using RA = RegisteredArrayWithoutDefault< Registry, Value >
 

Private Attributes

Value m_default
 

Detailed Description

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

Registered arrays with default values.

Extends the functionality of RegisteredArrayWithoutDefault by adding the possibility to set a specific default value for new keys added to the registry.

Precondition
Type Value must be copy-constructible.
Template Parameters
RegistryThe class which manages the registered keys. Must provide the functions defined in class RegistryBase.
ValueThe type of the stored data.
See also
RegistryBase, RegisteredArrayWithoutDefault, RegisteredArrayWithoutDefaultOrIndexAccess, RegisteredArray

Definition at line 638 of file RegisteredArray.h.

Member Typedef Documentation

◆ RA

template<class Registry , class Value >
using ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::RA = RegisteredArrayWithoutDefault<Registry, Value>
private

Definition at line 639 of file RegisteredArray.h.

Constructor & Destructor Documentation

◆ RegisteredArrayWithDefault() [1/6]

template<class Registry , class Value >
ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::RegisteredArrayWithDefault ( )
inlineexplicit

Creates a new registered array associated with no registry and a default-constructed default value.

Definition at line 649 of file RegisteredArray.h.

◆ RegisteredArrayWithDefault() [2/6]

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

Creates a new registered array associated with registry and a default-constructed default value.

Definition at line 652 of file RegisteredArray.h.

◆ RegisteredArrayWithDefault() [3/6]

template<class Registry , class Value >
ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::RegisteredArrayWithDefault ( const Value &  def)
inlineexplicit

Creates a new registered array associated with no registry and default value def.

Definition at line 658 of file RegisteredArray.h.

◆ RegisteredArrayWithDefault() [4/6]

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

Creates a new registered array associated with registry and default value def.

Definition at line 661 of file RegisteredArray.h.

◆ RegisteredArrayWithDefault() [5/6]

template<class Registry , class Value >
ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::RegisteredArrayWithDefault ( Value &&  def)
inlineexplicit

Creates a new registered array associated with no registry and default value def.

Definition at line 668 of file RegisteredArray.h.

◆ RegisteredArrayWithDefault() [6/6]

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

Creates a new registered array associated with registry and default value def.

Definition at line 671 of file RegisteredArray.h.

Member Function Documentation

◆ copyEntry()

template<class Registry , class Value >
void ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::copyEntry ( int  toIndex,
int  fromIndex 
)
inlineoverrideprotected

Copies the entry stored at oldIndex to newIndex.

Definition at line 694 of file RegisteredArray.h.

◆ fillWithDefault()

template<class Registry , class Value >
void ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::fillWithDefault ( )
inline

Overwrites all values with the current default value.

Definition at line 690 of file RegisteredArray.h.

◆ getDefault() [1/2]

template<class Registry , class Value >
Value& ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::getDefault ( )
inline

Returns the current default value for new keys.

Definition at line 687 of file RegisteredArray.h.

◆ getDefault() [2/2]

template<class Registry , class Value >
const Value& ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::getDefault ( ) const
inline

Returns the current default value for new keys.

Definition at line 684 of file RegisteredArray.h.

◆ resize()

template<class Registry , class Value >
void ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::resize ( int  size,
bool  shrink 
)
inlineoverrideprotected

Definition at line 698 of file RegisteredArray.h.

◆ setDefault() [1/2]

template<class Registry , class Value >
void ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::setDefault ( const Value &  def)
inline

Sets a new default value for new keys.

Definition at line 681 of file RegisteredArray.h.

◆ setDefault() [2/2]

template<class Registry , class Value >
void ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::setDefault ( Value &&  def)
inline

Sets a new default value for new keys.

Definition at line 678 of file RegisteredArray.h.

Member Data Documentation

◆ m_default

template<class Registry , class Value >
Value ogdf::internal::RegisteredArrayWithDefault< Registry, Value >::m_default
private

Definition at line 640 of file RegisteredArray.h.


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