Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::pc_tree::PCTreeRegistry Class Reference

A registry that allows labelling the nodes of a PC-tree. More...

#include <ogdf/basic/pctree/PCRegistry.h>

+ Inheritance diagram for ogdf::pc_tree::PCTreeRegistry:

Public Member Functions

 PCTreeRegistry (PCTreeForest *pcTreeForest)
 
int calculateArraySize (int add) const
 Returns the array size currently requested by this registry. More...
 
PCTreeForestgetForest () const
 
bool isKeyAssociated (PCNode *key) const
 Returns whether key is associated with this registry. More...
 
int maxKeyIndex () const
 Returns the maximum index of all keys managed by this registry. More...
 
 operator PCTreeForest & () const
 
 operator PCTreeForest * () const
 
- Public Member Functions inherited from ogdf::RegistryBase< PCNode *, PCTreeRegistry >
 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 (PCNode * key)
 Records the addition of a new key and resizes all registered arrays if necessary. More...
 
void keyRemoved (PCNode * 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 (PCNode *key)
 Returns the index of key. More...
 

Private Attributes

PCTreeForestm_pForest
 

Additional Inherited Members

- Public Types inherited from ogdf::RegistryBase< PCNode *, PCTreeRegistry >
using iterator_type = void
 
using key_type = PCNode *
 
using registered_array_type = internal::RegisteredArrayBase< PCTreeRegistry >
 
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 = PCTreeRegistry
 
- Protected Member Functions inherited from ogdf::RegistryBase< PCNode *, PCTreeRegistry >
 RegistryBase ()=default
 

Detailed Description

A registry that allows labelling the nodes of a PC-tree.

Definition at line 44 of file PCRegistry.h.

Constructor & Destructor Documentation

◆ PCTreeRegistry()

ogdf::pc_tree::PCTreeRegistry::PCTreeRegistry ( PCTreeForest pcTreeForest)
inline

Definition at line 48 of file PCRegistry.h.

Member Function Documentation

◆ calculateArraySize()

int ogdf::pc_tree::PCTreeRegistry::calculateArraySize ( int  add) const

Returns the array size currently requested by this registry.

◆ getForest()

PCTreeForest& ogdf::pc_tree::PCTreeRegistry::getForest ( ) const
inline

Definition at line 66 of file PCRegistry.h.

◆ isKeyAssociated()

bool ogdf::pc_tree::PCTreeRegistry::isKeyAssociated ( PCNode key) const

Returns whether key is associated with this registry.

◆ keyToIndex()

int ogdf::pc_tree::PCTreeRegistry::keyToIndex ( PCNode key)
inlinestatic

Returns the index of key.

Definition at line 709 of file PCTree.h.

◆ maxKeyIndex()

int ogdf::pc_tree::PCTreeRegistry::maxKeyIndex ( ) const

Returns the maximum index of all keys managed by this registry.

◆ operator PCTreeForest &()

ogdf::pc_tree::PCTreeRegistry::operator PCTreeForest & ( ) const
inline

Definition at line 62 of file PCRegistry.h.

◆ operator PCTreeForest *()

ogdf::pc_tree::PCTreeRegistry::operator PCTreeForest * ( ) const
inline

Definition at line 64 of file PCRegistry.h.

Member Data Documentation

◆ m_pForest

PCTreeForest* ogdf::pc_tree::PCTreeRegistry::m_pForest
private

Definition at line 45 of file PCRegistry.h.


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