Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::Prioritized< X, Priority > Class Template Reference

Augments any data elements of type X with keys of type Priority. This class is also its own Comparer. More...

#include <ogdf/basic/comparer.h>

Public Member Functions

 Prioritized ()
 Constructor of empty element. Be careful! More...
 
 Prioritized (const Prioritized &P)=default
 Copy-constructor. More...
 
 Prioritized (X xt, Priority pt)
 Constructor using a key/value pair. More...
 
item () const
 Returns the data of the element. More...
 
bool operator!= (const Prioritized< X, Priority > &P) const
 Comparison oprator based on the compare-operator for the key type (Priority) More...
 
bool operator< (const Prioritized< X, Priority > &P) const
 Comparison oprator based on the compare-operator for the key type (Priority) More...
 
bool operator<= (const Prioritized< X, Priority > &P) const
 Comparison oprator based on the compare-operator for the key type (Priority) More...
 
Prioritizedoperator= (const Prioritized< X, Priority > &P)=default
 Copy assignment operator. More...
 
bool operator== (const Prioritized< X, Priority > &P) const
 Comparison oprator based on the compare-operator for the key type (Priority) More...
 
bool operator> (const Prioritized< X, Priority > &P) const
 Comparison oprator based on the compare-operator for the key type (Priority) More...
 
bool operator>= (const Prioritized< X, Priority > &P) const
 Comparison oprator based on the compare-operator for the key type (Priority) More...
 
Priority priority () const
 Returns the key of the element. More...
 
void setItem (X item)
 Sets value x. More...
 
void setPriority (Priority pp)
 Sets priority. More...
 

Private Attributes

Priority p
 
x
 

Detailed Description

template<class X, class Priority = double>
class ogdf::Prioritized< X, Priority >

Augments any data elements of type X with keys of type Priority. This class is also its own Comparer.

Also defines comparator function using the keys. This class is intended as a helpful convenience class for using with BinaryHeapSimple, Top10Heap,..

Definition at line 279 of file comparer.h.

Constructor & Destructor Documentation

◆ Prioritized() [1/3]

template<class X , class Priority = double>
ogdf::Prioritized< X, Priority >::Prioritized ( )
inline

Constructor of empty element. Be careful!

Definition at line 285 of file comparer.h.

◆ Prioritized() [2/3]

template<class X , class Priority = double>
ogdf::Prioritized< X, Priority >::Prioritized ( xt,
Priority  pt 
)
inline

Constructor using a key/value pair.

Definition at line 288 of file comparer.h.

◆ Prioritized() [3/3]

template<class X , class Priority = double>
ogdf::Prioritized< X, Priority >::Prioritized ( const Prioritized< X, Priority > &  P)
default

Copy-constructor.

Member Function Documentation

◆ item()

template<class X , class Priority = double>
X ogdf::Prioritized< X, Priority >::item ( ) const
inline

Returns the data of the element.

Definition at line 297 of file comparer.h.

◆ operator!=()

template<class X , class Priority = double>
bool ogdf::Prioritized< X, Priority >::operator!= ( const Prioritized< X, Priority > &  P) const
inline

Comparison oprator based on the compare-operator for the key type (Priority)

Definition at line 324 of file comparer.h.

◆ operator<()

template<class X , class Priority = double>
bool ogdf::Prioritized< X, Priority >::operator< ( const Prioritized< X, Priority > &  P) const
inline

Comparison oprator based on the compare-operator for the key type (Priority)

Definition at line 309 of file comparer.h.

◆ operator<=()

template<class X , class Priority = double>
bool ogdf::Prioritized< X, Priority >::operator<= ( const Prioritized< X, Priority > &  P) const
inline

Comparison oprator based on the compare-operator for the key type (Priority)

Definition at line 312 of file comparer.h.

◆ operator=()

template<class X , class Priority = double>
Prioritized& ogdf::Prioritized< X, Priority >::operator= ( const Prioritized< X, Priority > &  P)
default

Copy assignment operator.

◆ operator==()

template<class X , class Priority = double>
bool ogdf::Prioritized< X, Priority >::operator== ( const Prioritized< X, Priority > &  P) const
inline

Comparison oprator based on the compare-operator for the key type (Priority)

Definition at line 321 of file comparer.h.

◆ operator>()

template<class X , class Priority = double>
bool ogdf::Prioritized< X, Priority >::operator> ( const Prioritized< X, Priority > &  P) const
inline

Comparison oprator based on the compare-operator for the key type (Priority)

Definition at line 315 of file comparer.h.

◆ operator>=()

template<class X , class Priority = double>
bool ogdf::Prioritized< X, Priority >::operator>= ( const Prioritized< X, Priority > &  P) const
inline

Comparison oprator based on the compare-operator for the key type (Priority)

Definition at line 318 of file comparer.h.

◆ priority()

template<class X , class Priority = double>
Priority ogdf::Prioritized< X, Priority >::priority ( ) const
inline

Returns the key of the element.

Definition at line 294 of file comparer.h.

◆ setItem()

template<class X , class Priority = double>
void ogdf::Prioritized< X, Priority >::setItem ( item)
inline

Sets value x.

Definition at line 303 of file comparer.h.

◆ setPriority()

template<class X , class Priority = double>
void ogdf::Prioritized< X, Priority >::setPriority ( Priority  pp)
inline

Sets priority.

Definition at line 300 of file comparer.h.

Member Data Documentation

◆ p

template<class X , class Priority = double>
Priority ogdf::Prioritized< X, Priority >::p
private

Definition at line 281 of file comparer.h.

◆ x

template<class X , class Priority = double>
X ogdf::Prioritized< X, Priority >::x
private

Definition at line 280 of file comparer.h.


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