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. | |
Protected Member Functions | |
DerivedView (void) | |
Default constructor. | |
DerivedView (const View &y) | |
Initialize with view y. | |
Protected Attributes | |
View | x |
View from which this view is derived. | |
Generic view information | |
static bool | varderived (void) |
Return whether this view is derived from a VarImpView. | |
VarImpType * | varimp (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 (const Space &home) const |
Return accumulated failure count. | |
Domain tests | |
bool | assigned (void) const |
Test whether view is assigned. | |
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. | |
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 | subscribe (Space &home, Advisor &a) |
Subscribe advisor a to view. | |
void | cancel (Space &home, Advisor &a) |
Cancel subscription of advisor a. | |
Delta information for advisors | |
static ModEvent | modevent (const Delta &d) |
Return modification event. | |
Cloning | |
void | update (Space &home, bool share, DerivedView< View > &y) |
Update this view to be a clone of view y. |
Base-class for derived views.
typedef View::VarImpType Gecode::DerivedView< View >::VarImpType |
typedef View::VarType Gecode::DerivedView< View >::VarType |
Gecode::DerivedView< View >::DerivedView | ( | void | ) | [inline, protected] |
Gecode::DerivedView< View >::DerivedView | ( | const View & | y | ) | [inline, protected] |
bool Gecode::DerivedView< View >::varderived | ( | void | ) | [inline, static] |
Return whether this view is derived from a VarImpView.
View::VarImpType * Gecode::DerivedView< View >::varimp | ( | void | ) | const [inline] |
View Gecode::DerivedView< View >::base | ( | void | ) | const [inline] |
unsigned int Gecode::DerivedView< View >::degree | ( | void | ) | const [inline] |
double Gecode::DerivedView< View >::afc | ( | const Space & | home | ) | const [inline] |
bool Gecode::DerivedView< View >::assigned | ( | void | ) | const [inline] |
void Gecode::DerivedView< View >::schedule | ( | Space & | home, |
Propagator & | p, | ||
ModEvent | me | ||
) | [inline, static] |
Schedule propagator p with modification event me.
Reimplemented in Gecode::Set::CachedView< View >, Gecode::Set::ComplementView< View >, and Gecode::Set::SingletonView.
ModEvent Gecode::DerivedView< View >::me | ( | const ModEventDelta & | med | ) | [inline, static] |
Return modification event for view type in med.
Reimplemented in Gecode::Set::CachedView< View >, Gecode::Set::ComplementView< View >, and Gecode::Set::SingletonView.
ModEventDelta Gecode::DerivedView< View >::med | ( | ModEvent | me | ) | [inline, static] |
Translate modification event me to modification event delta for view.
Reimplemented in Gecode::Int::CachedView< View >, Gecode::Int::CachedView< Gecode::Int::IntView >, Gecode::Set::CachedView< View >, Gecode::Set::ComplementView< View >, Gecode::Int::ScaleView< Val, UnsVal >, Gecode::Set::SingletonView, Gecode::Int::OffsetView, Gecode::Float::ScaleView, Gecode::Int::MinusView, Gecode::Float::OffsetView, and Gecode::Float::MinusView.
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).
Reimplemented in Gecode::Set::CachedView< View >, Gecode::Set::ComplementView< View >, and Gecode::Set::SingletonView.
void Gecode::DerivedView< View >::cancel | ( | Space & | home, |
Propagator & | p, | ||
PropCond | pc | ||
) | [inline] |
Cancel subscription of propagator p with propagation condition pc to view.
Reimplemented in Gecode::Set::CachedView< View >, Gecode::Set::ComplementView< View >, and Gecode::Set::SingletonView.
void Gecode::DerivedView< View >::subscribe | ( | Space & | home, |
Advisor & | a | ||
) | [inline] |
Subscribe advisor a to view.
Reimplemented in Gecode::Set::CachedView< View >, Gecode::Set::ComplementView< View >, and Gecode::Set::SingletonView.
void Gecode::DerivedView< View >::cancel | ( | Space & | home, |
Advisor & | a | ||
) | [inline] |
Cancel subscription of advisor a.
Reimplemented in Gecode::Set::CachedView< View >, Gecode::Set::ComplementView< View >, and Gecode::Set::SingletonView.
ModEvent Gecode::DerivedView< View >::modevent | ( | const Delta & | d | ) | [inline, static] |
Return modification event.
Reimplemented in Gecode::Set::CachedView< View >, Gecode::Set::ComplementView< View >, and Gecode::Set::SingletonView.
void Gecode::DerivedView< View >::update | ( | Space & | home, |
bool | share, | ||
DerivedView< View > & | y | ||
) | [inline] |
View Gecode::DerivedView< View >::x [protected] |