Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::internal::GraphRegistry< Key, Iterable, Factor > Class Template Reference

Registry for nodes, edges and adjEntries of a graph. More...

#include <ogdf/basic/Graph_d.h>

+ Inheritance diagram for ogdf::internal::GraphRegistry< Key, Iterable, Factor >:

Public Types

using iterator = typename Iterable::iterator
 
- Public Types inherited from ogdf::RegistryBase< Key *, GraphRegistry< Key, GraphObjectContainer< Key >, 1 >, GraphObjectContainer< Key > ::iterator >
using iterator_type = GraphObjectContainer< Key > ::iterator
 
using key_type = Key *
 
using registered_array_type = internal::RegisteredArrayBase< GraphRegistry< Key, GraphObjectContainer< Key >, 1 > >
 
using registration_iterator_type = typename registration_list_type::iterator
 
using registration_list_type = std::list< registered_array_type *, OGDFAllocator< registered_array_type * > >
 
using registry_type = GraphRegistry< Key, GraphObjectContainer< Key >, 1 >
 

Public Member Functions

 GraphRegistry (Graph *graph, int *nextKeyIndex)
 Constructor. More...
 
int calculateArraySize (int add) const
 
GraphgraphOf () const
 Returns a pointer to the associated graph. More...
 
bool isKeyAssociated (Key *key) const
 
int maxKeyIndex () const
 
- Public Member Functions inherited from ogdf::RegistryBase< Key *, GraphRegistry< Key, GraphObjectContainer< Key >, 1 >, GraphObjectContainer< Key > ::iterator >
 RegistryBase (const RegistryBase &copy)=delete
 
 RegistryBase (RegistryBase &&move) noexcept=delete
 
virtual ~RegistryBase () noexcept
 Destructor. Unregisters all associated arrays. More...
 
void copyArrayEntries (int toIndex, int fromIndex)
 Copies the entry from fromIndex to toIndex in all registered arrays. More...
 
int getArraySize () const
 Returns the current size of all registered arrays. More...
 
const registration_list_typegetRegisteredArrays () const
 Returns a reference to the list of all registered arrays. More...
 
bool isAutoShrink () const
 Returns whether the registry allows arrays to shrink when keys are removed. More...
 
void keyAdded (Key * key)
 Records the addition of a new key and resizes all registered arrays if necessary. More...
 
void keyRemoved (Key * key)
 Records the deletion of a key and resizes all registered arrays if auto shrink is enabled. More...
 
void keysCleared ()
 Records that all keys have been cleared. If auto shrink is enabled, all arrays are cleared and resized to 0. More...
 
void moveRegisterArray (registration_iterator_type it, registered_array_type *pArray) const
 Stores array pArray at position it in the list of registered arrays. More...
 
RegistryBaseoperator= (const RegistryBase &other)=delete
 
RegistryBaseoperator= (RegistryBase &&other) noexcept=delete
 
OGDF_NODISCARD registration_iterator_type registerArray (registered_array_type *pArray) const
 Registers a new array with this registry. More...
 
void reserveSpace (int new_keys)
 Resizes all arrays to make space of new_keys new keys. More...
 
void resizeArrays ()
 Resizes all arrays to the size requested by calculateArraySize(). Only shrinks the arrays if auto shrink is enabled. More...
 
void resizeArrays (int size)
 Resizes all arrays to size. Only shrinks the arrays if auto shrink is enabled. More...
 
void resizeArrays (int size, bool shrink)
 Resizes all arrays to size. If shrink is true, the arrays may also shrink. More...
 
void setAutoShrink (bool mAutoShrink)
 Specifies whether the registry allows arrays to shrink when keys are removed. More...
 
void swapArrayEntries (int index1, int index2)
 Swaps the entries at index1 and index2 in all registered arrays. More...
 
void unregisterArray (registration_iterator_type it) const noexcept
 Unregisters an array associated with this registry. More...
 
void unregisterArrays () noexcept
 Unregister all associated arrays. More...
 

Static Public Member Functions

static int keyToIndex (Key *key)
 

Private Attributes

int * m_nextKeyIndex
 
Graphm_pGraph
 

Additional Inherited Members

- Protected Member Functions inherited from ogdf::RegistryBase< Key *, GraphRegistry< Key, GraphObjectContainer< Key >, 1 >, GraphObjectContainer< Key > ::iterator >
 RegistryBase ()=default
 

Detailed Description

template<typename Key, typename Iterable = GraphObjectContainer<Key>, int Factor = 1>
class ogdf::internal::GraphRegistry< Key, Iterable, Factor >

Registry for nodes, edges and adjEntries of a graph.

Template Parameters
Keythe type of registered key
Iterablethe type of iterable container with registered keys
FactorHow many array entries are created for each inserted element. This is set to 2 for GraphAdjRegistry, such that only one adjEntry has to be added and the twin adjEntry is registered automatically.

Definition at line 590 of file Graph_d.h.

Member Typedef Documentation

◆ iterator

template<typename Key , typename Iterable = GraphObjectContainer<Key>, int Factor = 1>
using ogdf::internal::GraphRegistry< Key, Iterable, Factor >::iterator = typename Iterable::iterator

Definition at line 596 of file Graph_d.h.

Constructor & Destructor Documentation

◆ GraphRegistry()

template<typename Key , typename Iterable = GraphObjectContainer<Key>, int Factor = 1>
ogdf::internal::GraphRegistry< Key, Iterable, Factor >::GraphRegistry ( Graph graph,
int *  nextKeyIndex 
)
inline

Constructor.

Definition at line 599 of file Graph_d.h.

Member Function Documentation

◆ calculateArraySize()

template<typename Key , typename Iterable = GraphObjectContainer<Key>, int Factor = 1>
int ogdf::internal::GraphRegistry< Key, Iterable, Factor >::calculateArraySize ( int  add) const
inline

Definition at line 620 of file Graph_d.h.

◆ graphOf()

template<typename Key , typename Iterable = GraphObjectContainer<Key>, int Factor = 1>
Graph* ogdf::internal::GraphRegistry< Key, Iterable, Factor >::graphOf ( ) const
inline

Returns a pointer to the associated graph.

Definition at line 627 of file Graph_d.h.

◆ isKeyAssociated()

template<typename Key , typename Iterable = GraphObjectContainer<Key>, int Factor = 1>
bool ogdf::internal::GraphRegistry< Key, Iterable, Factor >::isKeyAssociated ( Key *  key) const
inline

Definition at line 604 of file Graph_d.h.

◆ keyToIndex()

template<typename Key , typename Iterable = GraphObjectContainer<Key>, int Factor = 1>
static int ogdf::internal::GraphRegistry< Key, Iterable, Factor >::keyToIndex ( Key *  key)
inlinestatic

Definition at line 602 of file Graph_d.h.

◆ maxKeyIndex()

template<typename Key , typename Iterable = GraphObjectContainer<Key>, int Factor = 1>
int ogdf::internal::GraphRegistry< Key, Iterable, Factor >::maxKeyIndex ( ) const
inline

Definition at line 624 of file Graph_d.h.

Member Data Documentation

◆ m_nextKeyIndex

template<typename Key , typename Iterable = GraphObjectContainer<Key>, int Factor = 1>
int* ogdf::internal::GraphRegistry< Key, Iterable, Factor >::m_nextKeyIndex
private

Definition at line 593 of file Graph_d.h.

◆ m_pGraph

template<typename Key , typename Iterable = GraphObjectContainer<Key>, int Factor = 1>
Graph* ogdf::internal::GraphRegistry< Key, Iterable, Factor >::m_pGraph
private

Definition at line 592 of file Graph_d.h.


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