Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0

Base-class for derived views. More...

#include <view.hpp>

Public Types

typedef View::VarImpType VarImpType
 The variable implementation type belonging to the View.
 
typedef View::VarType VarType
 The variable type belonging to the View.
 

Public Member Functions

 DerivedView (const View &y)
 Initialize with view y.
 

Protected Member Functions

 DerivedView (void)
 Default constructor.
 

Protected Attributes

View x
 View from which this view is derived.
 

Generic view information

VarImpTypevarimp (void) const
 Return variable implementation of view.
 
View base (void) const
 Return view from which this view is derived.
 
unsigned int degree (void) const
 Return degree (number of subscribed propagators)
 
double afc (void) const
 Return accumulated failure count.
 
static bool varderived (void)
 Return whether this view is derived from a VarImpView.
 

Domain tests

bool assigned (void) const
 Test whether view is assigned.
 

Dependencies

void subscribe (Space &home, Propagator &p, PropCond pc, bool schedule=true)
 Subscribe propagator p with propagation condition pc to view.
 
void cancel (Space &home, Propagator &p, PropCond pc)
 Cancel subscription of propagator p with propagation condition pc to view.
 
void reschedule (Space &home, Propagator &p, PropCond pc)
 Re-schedule propagator p with propagation condition pc.
 
void subscribe (Space &home, Advisor &a, bool fail=false)
 Subscribe advisor a to view.
 
void cancel (Space &home, Advisor &a, bool fail=false)
 Cancel subscription of advisor a.
 

Cloning

void update (Space &home, DerivedView< View > &y)
 Update this view to be a clone of view y.
 

Ordering

bool operator< (const DerivedView< View > &y) const
 Whether this view comes before view y (arbitray order)
 

View-dependent propagator support

static void schedule (Space &home, Propagator &p, ModEvent me)
 Schedule propagator p with modification event me.
 
static ModEvent me (const ModEventDelta &med)
 Return modification event for view type in med.
 
static ModEventDelta med (ModEvent)
 Translate modification event me to modification event delta for view.
 

Delta information for advisors

static ModEvent modevent (const Delta &d)
 Return modification event.
 

Detailed Description

template<class View>
class Gecode::DerivedView< View >

Base-class for derived views.

Definition at line 230 of file view.hpp.

Member Typedef Documentation

◆ VarImpType

template<class View >
View::VarImpType Gecode::DerivedView< View >::VarImpType

The variable implementation type belonging to the View.

Definition at line 233 of file view.hpp.

◆ VarType

template<class View >
View::VarType Gecode::DerivedView< View >::VarType

The variable type belonging to the View.

Definition at line 235 of file view.hpp.

Constructor & Destructor Documentation

◆ DerivedView() [1/2]

template<class View >
Gecode::DerivedView< View >::DerivedView ( void )
inlineprotected

Default constructor.

Definition at line 584 of file view.hpp.

◆ DerivedView() [2/2]

template<class View >
Gecode::DerivedView< View >::DerivedView ( const View & y)
inline

Initialize with view y.

Definition at line 588 of file view.hpp.

Member Function Documentation

◆ varderived()

template<class View >
bool Gecode::DerivedView< View >::varderived ( void )
inlinestatic

Return whether this view is derived from a VarImpView.

Definition at line 593 of file view.hpp.

◆ varimp()

template<class View >
View::VarImpType * Gecode::DerivedView< View >::varimp ( void ) const
inline

Return variable implementation of view.

Definition at line 599 of file view.hpp.

◆ base()

template<class View >
View Gecode::DerivedView< View >::base ( void ) const
inline

Return view from which this view is derived.

Definition at line 605 of file view.hpp.

◆ degree()

template<class View >
unsigned int Gecode::DerivedView< View >::degree ( void ) const
inline

Return degree (number of subscribed propagators)

Definition at line 611 of file view.hpp.

◆ afc()

template<class View >
double Gecode::DerivedView< View >::afc ( void ) const
inline

Return accumulated failure count.

Definition at line 616 of file view.hpp.

◆ assigned()

template<class View >
bool Gecode::DerivedView< View >::assigned ( void ) const
inline

Test whether view is assigned.

Definition at line 628 of file view.hpp.

◆ schedule()

template<class View >
void Gecode::DerivedView< View >::schedule ( Space & home,
Propagator & p,
ModEvent me )
inlinestatic

Schedule propagator p with modification event me.

Definition at line 634 of file view.hpp.

◆ me()

template<class View >
ModEvent Gecode::DerivedView< View >::me ( const ModEventDelta & med)
inlinestatic

Return modification event for view type in med.

Definition at line 639 of file view.hpp.

◆ med()

template<class View >
ModEventDelta Gecode::DerivedView< View >::med ( ModEvent me)
inlinestatic

Translate modification event me to modification event delta for view.

Definition at line 644 of file view.hpp.

◆ subscribe() [1/2]

template<class View >
void Gecode::DerivedView< View >::subscribe ( Space & home,
Propagator & p,
PropCond pc,
bool schedule = true )
inline

Subscribe propagator p with propagation condition pc to view.

In case schedule is false, the propagator is just subscribed but not scheduled for execution (this must be used when creating subscriptions during propagation).

Definition at line 650 of file view.hpp.

◆ cancel() [1/2]

template<class View >
void Gecode::DerivedView< View >::cancel ( Space & home,
Propagator & p,
PropCond pc )
inline

Cancel subscription of propagator p with propagation condition pc to view.

Definition at line 656 of file view.hpp.

◆ reschedule()

template<class View >
void Gecode::DerivedView< View >::reschedule ( Space & home,
Propagator & p,
PropCond pc )
inline

Re-schedule propagator p with propagation condition pc.

Definition at line 661 of file view.hpp.

◆ subscribe() [2/2]

template<class View >
void Gecode::DerivedView< View >::subscribe ( Space & home,
Advisor & a,
bool fail = false )
inline

Subscribe advisor a to view.

If fail is true, run the advisor also on failure. This feature is undocumented.

Definition at line 666 of file view.hpp.

◆ cancel() [2/2]

template<class View >
void Gecode::DerivedView< View >::cancel ( Space & home,
Advisor & a,
bool fail = false )
inline

Cancel subscription of advisor a.

Definition at line 671 of file view.hpp.

◆ modevent()

template<class View >
ModEvent Gecode::DerivedView< View >::modevent ( const Delta & d)
inlinestatic

Return modification event.

Definition at line 676 of file view.hpp.

◆ update()

template<class View >
void Gecode::DerivedView< View >::update ( Space & home,
DerivedView< View > & y )
inline

Update this view to be a clone of view y.

Definition at line 681 of file view.hpp.

◆ operator<()

template<class View >
bool Gecode::DerivedView< View >::operator< ( const DerivedView< View > & y) const
inline

Whether this view comes before view y (arbitray order)

Definition at line 685 of file view.hpp.

Member Data Documentation

◆ x

template<class View >
View Gecode::DerivedView< View >::x
protected

View from which this view is derived.

Definition at line 238 of file view.hpp.


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