Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::internal::GraphList< T > Class Template Reference

Lists of graph objects (like nodes, edges, etc.). More...

#include <ogdf/basic/GraphList.h>

+ Inheritance diagram for ogdf::internal::GraphList< T >:

Public Types

using iterator = GraphIterator< T * >
 Provides a bidirectional iterator to an object in the container. More...
 
using reverse_iterator = GraphReverseIterator< T * >
 Provides a bidirectional reverse iterator to an object in the container. More...
 
using value_type = T *
 The value type (a pointer to a specific graph object) More...
 

Public Member Functions

 GraphList ()
 Constructs an empty list. More...
 
 ~GraphList ()
 Destruction: deletes all elements. More...
 
iterator begin () const
 Returns an iterator to the first element in the container. More...
 
void clear ()
 Removes all elements from the list and deletes them. More...
 
void consistencyCheck () const
 Asserts consistency of this list. More...
 
void del (T *pX)
 Removes element pX from the list and deletes it. More...
 
void delPure (T *pX)
 Only removes element pX from the list; does not delete it. More...
 
bool empty () const
 Returns true iff the list is empty. More...
 
iterator end () const
 Returns an iterator to the one-past-last element in the container. More...
 
T * head () const
 Returns the first element in the list. More...
 
void insertAfter (T *pX, T *pY)
 Inserts element pX after element pY. More...
 
void insertBefore (T *pX, T *pY)
 Inserts element pX before element pY. More...
 
void move (T *pX, GraphList< T > &L)
 Moves element pX to list L and inserts it at the end. More...
 
void move (T *pX, GraphList< T > &L, T *pY, Direction dir)
 Moves element pX to list L and inserts it before or after pY. More...
 
void moveAfter (T *pX, T *pY)
 Moves element pX from its current position to a position after pY. More...
 
void moveBefore (T *pX, T *pY)
 Moves element pX from its current position to a position before pY. More...
 
void permute ()
 Permutes all list elements. More...
 
template<class RNG >
void permute (RNG &rng)
 Permutes all list elements. More...
 
void pushBack (T *pX)
 Adds element pX at the end of the list. More...
 
reverse_iterator rbegin () const
 Returns a reverse iterator to the last element in the container. More...
 
reverse_iterator rend () const
 Returns a reverse iterator to the one-before-first element in the container. More...
 
void reverse ()
 Reverses the order of the list elements. More...
 
int size () const
 Returns the size of the list. More...
 
template<class LIST >
void sort (const LIST &newOrder)
 Sorts the list according to newOrder. More...
 
template<class IT >
void sort (IT begin, IT end)
 Sorts the list according to the range defined by two iterators. More...
 
void swap (T *pX, T *pY)
 Exchanges the positions of pX and pY in the list. More...
 
T * tail () const
 Returns the last element in the list. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ogdf::internal::GraphListBase
 GraphListBase ()
 Constructs an empty list. More...
 
 ~GraphListBase ()
 Destruction. More...
 
void consistencyCheck () const
 Asserts consistency of this list. More...
 
void del (GraphElement *pX)
 Removes element pX from the list. More...
 
bool empty () const
 Returns true iff the list is empty. More...
 
void insertAfter (GraphElement *pX, GraphElement *pY)
 Inserts element pX after element pY. More...
 
void insertBefore (GraphElement *pX, GraphElement *pY)
 Inserts element pX before element pY. More...
 
void permute ()
 Permutes all list elements. More...
 
template<class RNG >
void permute (RNG &rng)
 Permutes all list elements. More...
 
void pushBack (GraphElement *pX)
 Adds element pX at the end of the list. More...
 
void reverse ()
 Reverses the order of the list elements. More...
 
int size () const
 Returns the size of the list. More...
 
template<class LIST >
void sort (const LIST &newOrder)
 Sorts the list according to newOrder. More...
 
template<class IT >
void sort (IT begin, IT end)
 Sorts the list according to the range defined by two iterators. More...
 
void swap (GraphElement *pX, GraphElement *pY)
 Exchanges the positions of pX and pY in the list. More...
 
- Protected Attributes inherited from ogdf::internal::GraphListBase
GraphElementm_head
 Pointer to the first element in the list. More...
 
int m_size
 The size of the list. More...
 
GraphElementm_tail
 Pointer to the last element in the list. More...
 

Detailed Description

template<class T>
class ogdf::internal::GraphList< T >

Lists of graph objects (like nodes, edges, etc.).

The template type T must be a class derived from GraphElement.

Definition at line 296 of file GraphList.h.

Member Typedef Documentation

◆ iterator

template<class T >
using ogdf::internal::GraphList< T >::iterator = GraphIterator<T*>

Provides a bidirectional iterator to an object in the container.

Definition at line 301 of file GraphList.h.

◆ reverse_iterator

template<class T >
using ogdf::internal::GraphList< T >::reverse_iterator = GraphReverseIterator<T*>

Provides a bidirectional reverse iterator to an object in the container.

Definition at line 303 of file GraphList.h.

◆ value_type

template<class T >
using ogdf::internal::GraphList< T >::value_type = T*

The value type (a pointer to a specific graph object)

Definition at line 299 of file GraphList.h.

Constructor & Destructor Documentation

◆ GraphList()

template<class T >
ogdf::internal::GraphList< T >::GraphList ( )
inline

Constructs an empty list.

Definition at line 306 of file GraphList.h.

◆ ~GraphList()

template<class T >
ogdf::internal::GraphList< T >::~GraphList ( )
inline

Destruction: deletes all elements.

Definition at line 309 of file GraphList.h.

Member Function Documentation

◆ begin()

template<class T >
iterator ogdf::internal::GraphList< T >::begin ( ) const
inline

Returns an iterator to the first element in the container.

Definition at line 380 of file GraphList.h.

◆ clear()

template<class T >
void ogdf::internal::GraphList< T >::clear ( )
inline

Removes all elements from the list and deletes them.

Definition at line 371 of file GraphList.h.

◆ consistencyCheck()

template<class T >
void ogdf::internal::GraphListBase::consistencyCheck
inline

Asserts consistency of this list.

Definition at line 264 of file GraphList.h.

◆ del()

template<class T >
void ogdf::internal::GraphList< T >::del ( T *  pX)
inline

Removes element pX from the list and deletes it.

Definition at line 362 of file GraphList.h.

◆ delPure()

template<class T >
void ogdf::internal::GraphList< T >::delPure ( T *  pX)
inline

Only removes element pX from the list; does not delete it.

Definition at line 368 of file GraphList.h.

◆ empty()

template<class T >
bool ogdf::internal::GraphListBase::empty
inline

Returns true iff the list is empty.

Definition at line 87 of file GraphList.h.

◆ end()

template<class T >
iterator ogdf::internal::GraphList< T >::end ( ) const
inline

Returns an iterator to the one-past-last element in the container.

Definition at line 383 of file GraphList.h.

◆ head()

template<class T >
T* ogdf::internal::GraphList< T >::head ( ) const
inline

Returns the first element in the list.

Definition at line 319 of file GraphList.h.

◆ insertAfter()

template<class T >
void ogdf::internal::GraphList< T >::insertAfter ( T *  pX,
T *  pY 
)
inline

Inserts element pX after element pY.

Definition at line 328 of file GraphList.h.

◆ insertBefore()

template<class T >
void ogdf::internal::GraphList< T >::insertBefore ( T *  pX,
T *  pY 
)
inline

Inserts element pX before element pY.

Definition at line 331 of file GraphList.h.

◆ move() [1/2]

template<class T >
void ogdf::internal::GraphList< T >::move ( T *  pX,
GraphList< T > &  L 
)
inline

Moves element pX to list L and inserts it at the end.

Definition at line 344 of file GraphList.h.

◆ move() [2/2]

template<class T >
void ogdf::internal::GraphList< T >::move ( T *  pX,
GraphList< T > &  L,
T *  pY,
Direction  dir 
)
inline

Moves element pX to list L and inserts it before or after pY.

Definition at line 334 of file GraphList.h.

◆ moveAfter()

template<class T >
void ogdf::internal::GraphList< T >::moveAfter ( T *  pX,
T *  pY 
)
inline

Moves element pX from its current position to a position after pY.

Definition at line 350 of file GraphList.h.

◆ moveBefore()

template<class T >
void ogdf::internal::GraphList< T >::moveBefore ( T *  pX,
T *  pY 
)
inline

Moves element pX from its current position to a position before pY.

Definition at line 356 of file GraphList.h.

◆ permute() [1/2]

template<class T >
void ogdf::internal::GraphListBase::permute
inline

Permutes all list elements.

Definition at line 257 of file GraphList.h.

◆ permute() [2/2]

template<class T >
template<class RNG >
void ogdf::internal::GraphListBase::permute ( class RNG  )
inline

Permutes all list elements.

Definition at line 230 of file GraphList.h.

◆ pushBack()

template<class T >
void ogdf::internal::GraphList< T >::pushBack ( T *  pX)
inline

Adds element pX at the end of the list.

Definition at line 325 of file GraphList.h.

◆ rbegin()

template<class T >
reverse_iterator ogdf::internal::GraphList< T >::rbegin ( ) const
inline

Returns a reverse iterator to the last element in the container.

Definition at line 386 of file GraphList.h.

◆ rend()

template<class T >
reverse_iterator ogdf::internal::GraphList< T >::rend ( ) const
inline

Returns a reverse iterator to the one-before-first element in the container.

Definition at line 389 of file GraphList.h.

◆ reverse()

template<class T >
void ogdf::internal::GraphListBase::reverse
inline

Reverses the order of the list elements.

Definition at line 171 of file GraphList.h.

◆ size()

template<class T >
int ogdf::internal::GraphListBase::size
inline

Returns the size of the list.

Definition at line 84 of file GraphList.h.

◆ sort() [1/2]

template<class T >
template<class LIST >
void ogdf::internal::GraphListBase::sort ( class LIST  )
inline

Sorts the list according to newOrder.

Definition at line 146 of file GraphList.h.

◆ sort() [2/2]

template<class T >
template<class IT >
void ogdf::internal::GraphListBase::sort ( class IT  )
inline

Sorts the list according to the range defined by two iterators.

Definition at line 154 of file GraphList.h.

◆ swap()

template<class T >
void ogdf::internal::GraphList< T >::swap ( T *  pX,
T *  pY 
)
inline

Exchanges the positions of pX and pY in the list.

Definition at line 396 of file GraphList.h.

◆ tail()

template<class T >
T* ogdf::internal::GraphList< T >::tail ( ) const
inline

Returns the last element in the list.

Definition at line 322 of file GraphList.h.


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