41 class ConstCombinatorialEmbedding;
42 class CombinatorialEmbedding;
95 m_tail = m_tail->
m_next = pX;
106 if (pYnext) pYnext->
m_prev = pX;
116 if (pYprev) pYprev->
m_next = pX;
138 void sort(
const LIST &newOrder) {
140 typename LIST::const_iterator it = newOrder.begin();
141 if (!it.valid())
return;
144 for (; it.valid(); ++it) {
150 (m_tail = pPred)->m_next =
nullptr;
174 else if (pY->
m_next == pX) {
210 void consistencyCheck()
const {
212 OGDF_ASSERT((m_head ==
nullptr) == (m_tail ==
nullptr));
214 if (m_head !=
nullptr) {
252 OGDF_ALLOCATOR::deallocateList(
sizeof(T), m_head, m_tail);
256 int size()
const {
return m_size; }
259 T *
head()
const {
return static_cast<T *
>(m_head); }
262 T *
tail()
const {
return static_cast<T *
>(m_tail); }
265 bool empty()
const {
return m_size == 0; }
306 insertBefore(pX, pY);
323 OGDF_ALLOCATOR::deallocateList(
sizeof(T), m_head, m_tail);
324 m_head = m_tail =
nullptr;
330 template<
class T_LIST>
331 void sort(
const T_LIST &newOrder) {
347 using GraphListBase::consistencyCheck;
353 template<
class GraphObject>
void sort(const LIST &newOrder)
Sorts the list according to newOrder.
Data type for general directed graphs (adjacency list representation).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
int size() const
Returns the size of the list.
GraphElement * m_next
The successor in the list.
void insertBefore(T *pX, T *pY)
Inserts element pX before element pY.
Combinatorial embeddings of planar graphs.
void insertAfter(GraphElement *pX, GraphElement *pY)
Inserts element pX after element pY.
void pushBack(T *pX)
Adds element pX at the end of the list.
void moveAfter(T *pX, T *pY)
Moves element pX from its current position to a position after pY.
void reverse()
Reverses the order of the list elements.
void del(T *pX)
Removes element pX from the list and deletes it.
void swap(GraphElement *pX, GraphElement *pY)
Exchanges the positions of pX and pY in the list.
reverse_iterator rbegin() const
Returns a reverse iterator to the last element in the container.
Decralation of graph iterators.
iterator begin() const
Returns an iterator to the first element in the container.
T * tail() const
Returns the last element in the list.
int m_size
The size of the list.
void sort(const T_LIST &newOrder)
Sorts all elements according to newOrder.
int size() const
Returns the size of the list.
int size() const
Returns the number of elements in the container.
Representation of clustered graphs.
iterator end() const
Returns an iterator to the one-past-last element in the container.
T * head() const
Returns the first element in the list.
void insertBefore(GraphElement *pX, GraphElement *pY)
Inserts element pX before element pY.
void reverse()
Reverses the order of the list elements.
void clear()
Removes all elements from the list and deletes them.
Base class for GraphElement lists.
void pushBack(GraphElement *pX)
Adds element pX at the end of the list.
The base class for objects used by (hyper)graphs.
void moveBefore(T *pX, T *pY)
Moves element pX from its current position to a position before pY.
void swap(T *pX, T *pY)
Exchanges the positions of pX and pY in the list.
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
GraphListBase()
Constructs an empty list.
bool empty() const
Returns true iff the list is empty.
void del(GraphElement *pX)
Removes element pX from the list.
void delPure(T *pX)
Only removes element pX from the list; does not delete it.
GraphElement * m_head
Pointer to the first element in the list.
GraphElement * m_prev
The predecessor in the list.
GraphElement * m_tail
Pointer to the last element in the list.
~GraphListBase()
Destruction.
The namespace for all OGDF objects.
~GraphList()
Destruction: deletes all elements.
Lists of graph objects (like nodes, edges, etc.).
void move(T *pX, GraphList< T > &L, T *pY, Direction dir)
Moves element pX to list L and inserts it before or after pY.
Combinatorial embeddings of planar graphs with modification functionality.
Class for adjacency list elements.
reverse_iterator rend() const
Returns a reverse iterator to the one-before-first element in the container.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
void move(T *pX, GraphList< T > &L)
Moves element pX to list L and inserts it at the end.
GraphList()
Constructs an empty list.
void insertAfter(T *pX, T *pY)
Inserts element pX after element pY.
Declaration of doubly linked lists and iterators.