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