Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::FaceArray< T > Class Template Reference

Dynamic arrays indexed with faces of a combinatorial embedding. More...

#include <ogdf/basic/CombinatorialEmbedding.h>

Public Types

using const_iterator = internal::GraphArrayConstIterator< FaceArray< T > >
 The type for face array const iterators. More...
 
using iterator = internal::GraphArrayIterator< FaceArray< T > >
 The type for face array iterators. More...
 
using key_type = face
 The type for array keys. More...
 
using value_type = T
 The type for array entries. More...
 

Public Member Functions

 FaceArray ()
 Constructs an empty face array associated with no combinatorial embedding. More...
 
 FaceArray (const ConstCombinatorialEmbedding &E)
 Constructs a face array associated with E. More...
 
 FaceArray (const ConstCombinatorialEmbedding &E, const T &x)
 Constructs a face array associated with E. More...
 
 FaceArray (const FaceArray< T > &A)
 Constructs an face array that is a copy of A. More...
 
 FaceArray (FaceArray< T > &&A)
 Constructs a face array containing the elements of A (move semantics). More...
 
Access methods

These methods provide access to elements, size, and corresponding graph.

bool valid () const
 Returns true iff the array is associated with a combinatorial embedding. More...
 
const ConstCombinatorialEmbeddingembeddingOf () const
 Returns a pointer to the associated combinatorial embedding. More...
 
const T & operator[] (face f) const
 Returns a reference to the element with index f. More...
 
T & operator[] (face f)
 Returns a reference to the element with index f. More...
 
const T & operator() (face f) const
 Returns a reference to the element with index f. More...
 
T & operator() (face f)
 Returns a reference to the element with index f. More...
 
Iterators

These methods return bidirectional iterators to elements in the array.

iterator begin ()
 Returns an iterator to the first entry in the face array. More...
 
const_iterator begin () const
 Returns a const iterator to the first entry in the face array. More...
 
const_iterator cbegin () const
 Returns a const iterator to the first entry in the face array. More...
 
iterator end ()
 Returns an iterator to one-past-last entry in the face array. More...
 
const_iterator end () const
 Returns a const iterator to one-past-last entry in the face array. More...
 
const_iterator cend () const
 Returns a const iterator to one-past-last entry in the face array. More...
 
Initialization and assignment

These methods can be used to reinitialize the array, or to initialize all elements with a given value.

void init ()
 Reinitializes the array. Associates the array with no combinatorial embedding. More...
 
void init (const ConstCombinatorialEmbedding &E)
 Reinitializes the array. Associates the array with E. More...
 
void init (const ConstCombinatorialEmbedding &E, const T &x)
 Reinitializes the array. Associates the array with E. More...
 
void fill (const T &x)
 Sets all array elements to x. More...
 
FaceArray< T > & operator= (const FaceArray< T > &a)
 Assignment operator. More...
 
FaceArray< T > & operator= (FaceArray< T > &&a)
 Assignment operator (move semantics). More...
 

Private Attributes

m_x
 The default value for array elements. More...
 

Helper functions

These methods are mainly intended for internal use.

static key_type findSuccKey (key_type key)
 
static key_type findPredKey (key_type key)
 
virtual void enlargeTable (int newTableSize)
 
virtual void reinit (int initTableSize)
 

Detailed Description

template<class T>
class ogdf::FaceArray< T >

Dynamic arrays indexed with faces of a combinatorial embedding.

Face arrays represent a mapping from faces to data of type T. They adjust their table size automatically when the number of faces in the corresponding combinatorial embedding increases.

Warning
Undefined behavior can occur when the array is used in the left-hand side of an assignment and the observed graph is changed in the right-hand side. To resolve the issue, use:
auto tmp = RHS; LHS = std::move(tmp);
Template Parameters
Tis the element type.

Definition at line 174 of file CombinatorialEmbedding.h.

Member Typedef Documentation

◆ const_iterator

The type for face array const iterators.

Definition at line 125 of file FaceArray.h.

◆ iterator

template<class T >
using ogdf::FaceArray< T >::iterator = internal::GraphArrayIterator<FaceArray<T> >

The type for face array iterators.

Definition at line 123 of file FaceArray.h.

◆ key_type

template<class T >
using ogdf::FaceArray< T >::key_type = face

The type for array keys.

Definition at line 118 of file FaceArray.h.

◆ value_type

template<class T >
using ogdf::FaceArray< T >::value_type = T

The type for array entries.

Definition at line 120 of file FaceArray.h.

Constructor & Destructor Documentation

◆ FaceArray() [1/5]

template<class T >
ogdf::FaceArray< T >::FaceArray ( )
inline

Constructs an empty face array associated with no combinatorial embedding.

Definition at line 129 of file FaceArray.h.

◆ FaceArray() [2/5]

template<class T >
ogdf::FaceArray< T >::FaceArray ( const ConstCombinatorialEmbedding E)
inline

Constructs a face array associated with E.

Definition at line 132 of file FaceArray.h.

◆ FaceArray() [3/5]

template<class T >
ogdf::FaceArray< T >::FaceArray ( const ConstCombinatorialEmbedding E,
const T &  x 
)
inline

Constructs a face array associated with E.

Parameters
Eis the associated combinatorial embedding.
xis the default value for all array elements.

Definition at line 140 of file FaceArray.h.

◆ FaceArray() [4/5]

template<class T >
ogdf::FaceArray< T >::FaceArray ( const FaceArray< T > &  A)
inline

Constructs an face array that is a copy of A.

Associates the array with the same combinatorial embedding as A and copies all elements.

Definition at line 148 of file FaceArray.h.

◆ FaceArray() [5/5]

template<class T >
ogdf::FaceArray< T >::FaceArray ( FaceArray< T > &&  A)
inline

Constructs a face array containing the elements of A (move semantics).

Face array A is empty afterwards and not associated with any combinatorial embedding.

Definition at line 154 of file FaceArray.h.

Member Function Documentation

◆ begin() [1/2]

template<class T >
iterator ogdf::FaceArray< T >::begin ( )
inline

Returns an iterator to the first entry in the face array.

If the face array is empty, a null pointer iterator is returned.

Definition at line 211 of file FaceArray.h.

◆ begin() [2/2]

template<class T >
const_iterator ogdf::FaceArray< T >::begin ( ) const
inline

Returns a const iterator to the first entry in the face array.

If the face array is empty, a null pointer iterator is returned.

Definition at line 217 of file FaceArray.h.

◆ cbegin()

template<class T >
const_iterator ogdf::FaceArray< T >::cbegin ( ) const
inline

Returns a const iterator to the first entry in the face array.

If the face array is empty, a null pointer iterator is returned.

Definition at line 223 of file FaceArray.h.

◆ cend()

template<class T >
const_iterator ogdf::FaceArray< T >::cend ( ) const
inline

Returns a const iterator to one-past-last entry in the face array.

This is always a null pointer iterator.

Definition at line 241 of file FaceArray.h.

◆ embeddingOf()

template<class T >
const ConstCombinatorialEmbedding* ogdf::FaceArray< T >::embeddingOf ( ) const
inline

Returns a pointer to the associated combinatorial embedding.

Definition at line 167 of file FaceArray.h.

◆ end() [1/2]

template<class T >
iterator ogdf::FaceArray< T >::end ( )
inline

Returns an iterator to one-past-last entry in the face array.

This is always a null pointer iterator.

Definition at line 229 of file FaceArray.h.

◆ end() [2/2]

template<class T >
const_iterator ogdf::FaceArray< T >::end ( ) const
inline

Returns a const iterator to one-past-last entry in the face array.

This is always a null pointer iterator.

Definition at line 235 of file FaceArray.h.

◆ enlargeTable()

template<class T >
virtual void ogdf::FaceArray< T >::enlargeTable ( int  newTableSize)
inlineprivatevirtual

Definition at line 309 of file FaceArray.h.

◆ fill()

template<class T >
void ogdf::FaceArray< T >::fill ( const T &  x)
inline

Sets all array elements to x.

Definition at line 270 of file FaceArray.h.

◆ findPredKey()

template<class T >
static key_type ogdf::FaceArray< T >::findPredKey ( key_type  key)
inlinestatic

Definition at line 304 of file FaceArray.h.

◆ findSuccKey()

template<class T >
static key_type ogdf::FaceArray< T >::findSuccKey ( key_type  key)
inlinestatic

Definition at line 303 of file FaceArray.h.

◆ init() [1/3]

template<class T >
void ogdf::FaceArray< T >::init ( )
inline

Reinitializes the array. Associates the array with no combinatorial embedding.

Definition at line 251 of file FaceArray.h.

◆ init() [2/3]

template<class T >
void ogdf::FaceArray< T >::init ( const ConstCombinatorialEmbedding E)
inline

Reinitializes the array. Associates the array with E.

Definition at line 256 of file FaceArray.h.

◆ init() [3/3]

template<class T >
void ogdf::FaceArray< T >::init ( const ConstCombinatorialEmbedding E,
const T &  x 
)
inline

Reinitializes the array. Associates the array with E.

Parameters
Eis the associated combinatorial embedding.
xis the default value.

Definition at line 265 of file FaceArray.h.

◆ operator()() [1/2]

template<class T >
T& ogdf::FaceArray< T >::operator() ( face  f)
inline

Returns a reference to the element with index f.

Definition at line 193 of file FaceArray.h.

◆ operator()() [2/2]

template<class T >
const T& ogdf::FaceArray< T >::operator() ( face  f) const
inline

Returns a reference to the element with index f.

Definition at line 186 of file FaceArray.h.

◆ operator=() [1/2]

template<class T >
FaceArray<T>& ogdf::FaceArray< T >::operator= ( const FaceArray< T > &  a)
inline

Assignment operator.

Definition at line 277 of file FaceArray.h.

◆ operator=() [2/2]

template<class T >
FaceArray<T>& ogdf::FaceArray< T >::operator= ( FaceArray< T > &&  a)
inline

Assignment operator (move semantics).

Face array a is empty afterwards and not associated with any combinatorial embedding.

Definition at line 288 of file FaceArray.h.

◆ operator[]() [1/2]

template<class T >
T& ogdf::FaceArray< T >::operator[] ( face  f)
inline

Returns a reference to the element with index f.

Definition at line 179 of file FaceArray.h.

◆ operator[]() [2/2]

template<class T >
const T& ogdf::FaceArray< T >::operator[] ( face  f) const
inline

Returns a reference to the element with index f.

Definition at line 172 of file FaceArray.h.

◆ reinit()

template<class T >
virtual void ogdf::FaceArray< T >::reinit ( int  initTableSize)
inlineprivatevirtual

Definition at line 313 of file FaceArray.h.

◆ valid()

template<class T >
bool ogdf::FaceArray< T >::valid ( ) const
inline

Returns true iff the array is associated with a combinatorial embedding.

Definition at line 164 of file FaceArray.h.

Member Data Documentation

◆ m_x

template<class T >
T ogdf::FaceArray< T >::m_x
private

The default value for array elements.

Definition at line 114 of file FaceArray.h.


The documentation for this class was generated from the following files:
backward::details::move
const T & move(const T &v)
Definition: backward.hpp:243