advisor.icc
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 namespace Gecode {
00041
00046 template <class View>
00047 class ViewAdvisor : public Advisor {
00048 protected:
00050 View x;
00051 public:
00053 template <class A>
00054 ViewAdvisor(Space* home, Propagator* p, Council<A>& c, View x0);
00056 ViewAdvisor(Space* home, bool share, ViewAdvisor<View>& a);
00058 View view(void) const;
00060 void view(Space* home, View y);
00062 template <class A>
00063 void dispose(Space* home, Council<A>& c);
00064 };
00065
00066
00067 template <class View>
00068 template <class A>
00069 forceinline
00070 ViewAdvisor<View>::ViewAdvisor(Space* home, Propagator* p,
00071 Council<A>& c, View x0)
00072 : Advisor(home,p,c), x(x0) {
00073 x.subscribe(home, this);
00074 }
00075 template <class View>
00076 forceinline
00077 ViewAdvisor<View>::ViewAdvisor(Space* home, bool share,
00078 ViewAdvisor<View>& a)
00079 : Advisor(home,share,a) {
00080 x.update(home,share,a.x);
00081 }
00082 template <class View>
00083 forceinline View
00084 ViewAdvisor<View>::view(void) const {
00085 return x;
00086 }
00087 template <class View>
00088 forceinline void
00089 ViewAdvisor<View>::view(Space* home, View y) {
00090 x.cancel(home, this);
00091 x=y;
00092 x.subscribe(home, this);
00093 }
00094 template <class View>
00095 template <class A>
00096 forceinline void
00097 ViewAdvisor<View>::dispose(Space* home, Council<A>& c) {
00098 x.cancel(home,this);
00099 Advisor::dispose(home,c);
00100 }
00101
00102 }
00103
00104