idx-view.hh
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 #ifndef __GECODE_INT_IDX_VIEW_HH__
00041 #define __GECODE_INT_IDX_VIEW_HH__
00042
00043 #include <gecode/int.hh>
00044
00045 namespace Gecode { namespace Int {
00046
00051 template<class View>
00052 class IdxView {
00053 public:
00055 int idx;
00057 View view;
00059 static IdxView* allocate(Space& home, int n);
00060 };
00061
00063 template<class View>
00064 class ViewToVarArg {};
00065
00070 template<class View>
00071 class IdxViewArray {
00072 private:
00074 IdxView<View>* xs;
00076 int n;
00077 public:
00079 IdxViewArray(void);
00081 IdxViewArray(const IdxViewArray<View>&);
00083 IdxViewArray(Space& home, const typename ViewToVarArg<View>::argtype& x);
00085 IdxViewArray(Space& home, int n);
00086
00088 int size(void) const;
00090 void size(int n);
00091
00093 IdxView<View>& operator [](int n);
00095 const IdxView<View>& operator [](int) const;
00096
00101 void subscribe(Space& home, Propagator& p, PropCond pc, bool process=true);
00106 void cancel(Space& home, Propagator& p, PropCond pc);
00108 void reschedule(Space& home, Propagator& p, PropCond pc);
00109
00111 void update(Space& home, bool share, IdxViewArray<View>& x);
00112 };
00113
00118 template<class Char, class Traits, class View>
00119 std::basic_ostream<Char,Traits>&
00120 operator <<(std::basic_ostream<Char,Traits>& os,
00121 const IdxViewArray<View>& x);
00122
00123 }}
00124
00125 #include <gecode/int/idx-view.hpp>
00126
00127 #endif
00128
00129
00130
00131