ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy > Class Template Reference

the alteration notifier of LEMON for the items Item of GR told as events of ADS, through Policy More...

#include <ADS/interop/lemon/Observers.h>

Inheritance diagram for ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >:

Public types

using Key = typename T::Key
 the key of an item: its ends, or its id
using Insert = typename T::Ins
 an insertion
using Erase = typename T::Era
 an erasure
using modifications
 the events
using Subject = typename Policy::template bind< modifications , LemonTap >
 the subject

Public member functions

template<class... O>
requires ( ! withCost )
 LemonTap (const GR &g, O &... o)
 the tap of the items of \( g \), the static observers o...; \( g \) must outlive it
template<class C, class... O>
requires ( withCost && std::is_same_v< C , CostMap > )
 LemonTap (const GR &g, const C &c, O &... o)
 the tap of the arcs of \( g \) with the costs \( c \), the static observers o...; it must be constructed after \( c \) [see the order of the observers above], and both must outlive it
bool spoiled (void) const
 whether an observer of ADS threw within erase() or clear(), which LEMON forbids: its state may no longer match the graph
Subject & subject (void)
 the subject, for ADS::batch() and ADS::quiet()
const Subject & subject (void) const
 the subject
template<class O>
requires ( Subject::dynamic )
int attach (O &o)
 attaches the observer \( o \) and gives its number
void detach (int id)
 detaches the observer number \( \mathit{id} \)

Protected member functions

void add (const Item &x) override
 Inserted after the insertion of \( x \)
void add (const std::vector< Item > &X) override
 the insertions of \( X \), in a batch
void erase (const Item &x) noexcept override
 Erased before the removal of \( x \), with its cost
void erase (const std::vector< Item > &X) noexcept override
 the erasures of \( X \), in a batch
void build (void) override
 Rebuilt after the items were built anew
void clear (void) noexcept override
 Cleared before all the items leave

Detailed description

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
class ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >

the alteration notifier of LEMON for the items Item of GR told as events of ADS, through Policy

Member typedef documentation

◆ Erase

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
using ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::Erase = typename T::Era

an erasure

◆ Insert

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
using ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::Insert = typename T::Ins

an insertion

◆ Key

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
using ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::Key = typename T::Key

the key of an item: its ends, or its id

◆ modifications

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
using ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::modifications
Initial value:
typename T::Ins Insert
an insertion
Definition Observers.h:169
typename T::Era Erase
an erasure
Definition Observers.h:170
the structure emptied
Definition Modification.h:699
anything may have changed: forget and recompute
Definition Modification.h:708
a list of types, the events of a structure [see Modification.h]
Definition Modification.h:482

the events

◆ Subject

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
using ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::Subject = typename Policy::template bind< modifications , LemonTap >

the subject

Constructor and destructor documentation

◆ LemonTap() [1/2]

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
template<class... O>
requires ( ! withCost )
ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::LemonTap ( const GR & g,
O &... o )
inlineexplicit

the tap of the items of \( g \), the static observers o...; \( g \) must outlive it

◆ LemonTap() [2/2]

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
template<class C, class... O>
requires ( withCost && std::is_same_v< C , CostMap > )
ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::LemonTap ( const GR & g,
const C & c,
O &... o )
inline

the tap of the arcs of \( g \) with the costs \( c \), the static observers o...; it must be constructed after \( c \) [see the order of the observers above], and both must outlive it

Member function documentation

◆ add() [1/2]

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
void ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::add ( const Item & x)
inlineoverrideprotected

Inserted after the insertion of \( x \)

◆ add() [2/2]

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
void ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::add ( const std::vector< Item > & X)
inlineoverrideprotected

the insertions of \( X \), in a batch

◆ attach()

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
template<class O>
requires ( Subject::dynamic )
int ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::attach ( O & o)
inline

attaches the observer \( o \) and gives its number

Precondition
no batch is open

◆ build()

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
void ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::build ( void )
inlineoverrideprotected

Rebuilt after the items were built anew

◆ clear()

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
void ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::clear ( void )
inlineoverrideprotectednoexcept

Cleared before all the items leave

◆ detach()

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
void ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::detach ( int id)
inline

detaches the observer number \( \mathit{id} \)

Precondition
it is attached, no batch is open

◆ erase() [1/2]

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
void ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::erase ( const Item & x)
inlineoverrideprotectednoexcept

Erased before the removal of \( x \), with its cost

◆ erase() [2/2]

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
void ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::erase ( const std::vector< Item > & X)
inlineoverrideprotectednoexcept

the erasures of \( X \), in a batch

◆ spoiled()

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
bool ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::spoiled ( void ) const
inlinenodiscard

whether an observer of ADS threw within erase() or clear(), which LEMON forbids: its state may no longer match the graph

◆ subject() [1/2]

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
Subject & ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::subject ( void )
inlinenodiscard

the subject, for ADS::batch() and ADS::quiet()

◆ subject() [2/2]

template<class GR, class Item = typename GR::Arc, class CostMap = void, class Policy = Dynamic<>>
const Subject & ADS::lemon_interop::LemonTap< GR, Item, CostMap, Policy >::subject ( void ) const
inlinenodiscard

the subject


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