Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::HypergraphRegistry< Key > Class Template Reference

Registry for nodes and edges of a hypergraph. More...

#include <ogdf/hypergraph/Hypergraph.h>

+ Inheritance diagram for ogdf::HypergraphRegistry< Key >:

Public Types

using iterator = internal::GraphIterator< Key * >
 
- Public Types inherited from ogdf::RegistryBase< Key *, HypergraphRegistry< Key >, internal::GraphIterator< Key * > >
using iterator_type = internal::GraphIterator< Key * >
 
using key_type = Key *
 
using registered_array_type = internal::RegisteredArrayBase< HypergraphRegistry< Key > >
 
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 = HypergraphRegistry< Key >
 

Public Member Functions

 HypergraphRegistry (Hypergraph *graph, int *nextKeyIndex)
 Constructor.
 
int calculateArraySize (int add) const
 
HypergraphgraphOf () const
 Returns a pointer to the associated hypergraph.
 
bool isKeyAssociated (Key *key) const
 
int maxKeyIndex () const
 
- Public Member Functions inherited from ogdf::RegistryBase< Key *, HypergraphRegistry< Key >, internal::GraphIterator< Key * > >
virtual ~RegistryBase () noexcept
 Destructor. Unregisters all associated arrays.
 
void copyArrayEntries (int toIndex, int fromIndex)
 Copies the entry from fromIndex to toIndex in all registered arrays.
 
int getArraySize () const
 Returns the current size of all registered arrays.
 
const registration_list_typegetRegisteredArrays () const
 Returns a reference to the list of all registered arrays.
 
bool isAutoShrink () const
 Returns whether the registry allows arrays to shrink when keys are removed.
 
void keyAdded (Key * key)
 Records the addition of a new key and resizes all registered arrays if necessary.
 
void keyRemoved (Key * key)
 Records the deletion of a key and resizes all registered arrays if auto shrink is enabled.
 
void keysCleared ()
 Records that all keys have been cleared. If auto shrink is enabled, all arrays are cleared and resized to 0.
 
void moveRegisterArray (registration_iterator_type it, registered_array_type *pArray) const
 Stores array pArray at position it in the list of registered arrays.
 
OGDF_NODISCARD registration_iterator_type registerArray (registered_array_type *pArray) const
 Registers a new array with this registry.
 
void reserveSpace (int new_keys)
 Resizes all arrays to make space of new_keys new keys.
 
void resizeArrays ()
 Resizes all arrays to the size requested by calculateArraySize(). Only shrinks the arrays if auto shrink is enabled.
 
void resizeArrays (int size)
 Resizes all arrays to size. Only shrinks the arrays if auto shrink is enabled.
 
void resizeArrays (int size, bool shrink)
 Resizes all arrays to size. If shrink is true, the arrays may also shrink.
 
void setAutoShrink (bool mAutoShrink)
 Specifies whether the registry allows arrays to shrink when keys are removed.
 
void swapArrayEntries (int index1, int index2)
 Swaps the entries at index1 and index2 in all registered arrays.
 
void unregisterArray (registration_iterator_type it) const noexcept
 Unregisters an array associated with this registry.
 
void unregisterArrays () noexcept
 Unregister all associated arrays.
 
- Public Member Functions inherited from ogdf::Observable< TObserver, TObserved >
 Observable ()=default
 
 Observable (const Observable &copy)=delete
 If you want to copy a subclass of Observable, call the default Observable() constructor.
 
 Observable (Observable &&move)=delete
 If you want to move a subclass of Observable, call the default Observable() constructor.
 
virtual ~Observable ()
 Note that all Observers must already be removed once the destructor of this base class is invoked (e.g.
 
Observableoperator= (const Observable &copy)=delete
 
Observableoperator= (Observable &&move)=delete
 

Static Public Member Functions

static int keyToIndex (Key *key)
 

Private Attributes

int * m_nextKeyIndex
 
Hypergraphm_pGraph
 

Additional Inherited Members

- Protected Member Functions inherited from ogdf::RegistryBase< Key *, HypergraphRegistry< Key >, internal::GraphIterator< Key * > >
 RegistryBase ()=default
 
- Protected Member Functions inherited from ogdf::Observable< TObserver, TObserved >
void clearObservers ()
 
const ListPure< TObserver * > & getObservers () const
 
ListPure< TObserver * >::iterator registerObserver (TObserver *obs) const
 Registers an observer.
 
void unregisterObserver (typename ListPure< TObserver * >::iterator it) const
 Unregisters an observer.
 

Detailed Description

template<typename Key>
class ogdf::HypergraphRegistry< Key >

Registry for nodes and edges of a hypergraph.

Definition at line 333 of file Hypergraph.h.

Member Typedef Documentation

◆ iterator

template<typename Key >
using ogdf::HypergraphRegistry< Key >::iterator = internal::GraphIterator<Key*>

Definition at line 339 of file Hypergraph.h.

Constructor & Destructor Documentation

◆ HypergraphRegistry()

template<typename Key >
ogdf::HypergraphRegistry< Key >::HypergraphRegistry ( Hypergraph graph,
int *  nextKeyIndex 
)
inline

Constructor.

Definition at line 342 of file Hypergraph.h.

Member Function Documentation

◆ calculateArraySize()

template<typename Key >
int ogdf::HypergraphRegistry< Key >::calculateArraySize ( int  add) const
inline

Definition at line 363 of file Hypergraph.h.

◆ graphOf()

template<typename Key >
Hypergraph * ogdf::HypergraphRegistry< Key >::graphOf ( ) const
inline

Returns a pointer to the associated hypergraph.

Definition at line 368 of file Hypergraph.h.

◆ isKeyAssociated()

template<typename Key >
bool ogdf::HypergraphRegistry< Key >::isKeyAssociated ( Key *  key) const
inline

Definition at line 347 of file Hypergraph.h.

◆ keyToIndex()

template<typename Key >
static int ogdf::HypergraphRegistry< Key >::keyToIndex ( Key *  key)
inlinestatic

Definition at line 345 of file Hypergraph.h.

◆ maxKeyIndex()

template<typename Key >
int ogdf::HypergraphRegistry< Key >::maxKeyIndex ( ) const
inline

Definition at line 365 of file Hypergraph.h.

Member Data Documentation

◆ m_nextKeyIndex

template<typename Key >
int* ogdf::HypergraphRegistry< Key >::m_nextKeyIndex
private

Definition at line 336 of file Hypergraph.h.

◆ m_pGraph

template<typename Key >
Hypergraph* ogdf::HypergraphRegistry< Key >::m_pGraph
private

Definition at line 335 of file Hypergraph.h.


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