 |
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
52 template<
class Registry>
194 for (
const auto& elem : lhs.
elements()) {
203 return !(lhs == rhs);
217 void keyAdded(
typename Registry::key_type v)
override { }
#define OGDF_COPY_CONSTR(cls)
Declares the copy constructor for class cls.
The namespace for all OGDF objects.
friend bool operator==(const RegisteredSet &lhs, const RegisteredSet &rhs)
Dynamic arrays indexed with arbitrary keys.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Utility macros for declaring copy and move constructors and assignment operations.
bool remove(element_type v)
Removes element v from this set and return true iff v was previously present.
RegisteredSet(const Registry *R)
Creates an empty set associated with registry R.
#define OGDF_MOVE_OP(cls)
Declares the move assignment operation for class cls.
bool contains(element_type v) const
Returns the same as isMember()
void init()
Reinitializes the set. Associates the set with no registry.
bool valid() const
Returns true iff the iterator points to an element.
list_type::const_iterator begin() const
void keysSwapped(int index1, int index2) override
Called when an entry is swapped between index1 and index2 in all registered arrays.
void reregister(const Registry *obs)
Associates observer instance with instance obs.
bool operator()(element_type v) const
Returns the same as isMember() to use an RegisteredSet instance as filter function.
static void copy(const T &from, T &to)
bool isMember(element_type v) const
Returns true iff element v is contained in this set.
const T & move(const T &v)
const list_type & elements() const
Returns a reference to the list of elements contained in this set.
Declaration and implementation of RegisteredArray class.
const Registry * getRegistry() const
friend bool operator!=(const RegisteredSet &lhs, const RegisteredSet &rhs)
#define OGDF_MOVE_CONSTR(cls)
Declares the move constructor for class cls.
#define OGDF_COPY_OP(cls)
Declares the copy assignment operation for class cls. Don't forget to return *this;.
Constant-time set operations.
void clear()
Removes all elements from this set.
Abstract Base class for registry observers.
void init(const Registry &R)
Reinitializes the set. Associates the set with registry R.
void keyAdded(typename Registry::key_type v) override
Called by watched registry after a key has been added.
void del(iterator it)
Removes it from the list.
Basic declarations, included by all source files.
const Registry * registeredAt() const
Returns the associated registry.
list_type::const_iterator end() const
RegisteredSet()
Creates an empty set associated with no registry.
typename internal::GraphNodeRegistry ::key_type element_type
Declaration of doubly linked lists and iterators.
void keyRemoved(typename Registry::key_type v) override
Called by watched registry just before a key is deleted.
int size() const
Returns the number of elements in the list.
Encapsulates a pointer to a list element.
void registrationChanged(const Registry *old) override
Called after reregister() changed the observed instance.
void keysCopied(int toIndex, int fromIndex) override
Called when an entry is copied from fromIndex to toIndex in all registered arrays.
Registry for nodes, edges and adjEntries of a graph.
int size() const
Returns the number of elements in this set.
iterator pushBack(const E &x)
Adds element x at the end of the list.
void clear()
Removes all elements from the list.
void insert(element_type v)
Inserts element v into this set.
RegisteredArray< Registry, ListIterator< element_type >, false > m_it
m_it[v] contains the list iterator pointing to v if v is contained in this set, or an invalid list it...
void keysCleared() override
Called by watched registry when its clear function is called, just before things are removed.
RegisteredSet(const Registry &R)
Creates an empty set associated with registry R.
list_type m_elements
The list of elements contained in this set.