idxarray.hh
Go to the documentation of this file.00001 /* 00002 * Main authors: 00003 * Guido Tack <tack@gecode.org> 00004 * Christian Schulte <schulte@gecode.org> 00005 * 00006 * Copyright: 00007 * Guido Tack, 2004,2005 00008 * Christian Schulte, 2004,2005 00009 * 00010 * Last modified: 00011 * $Date: 2006-08-24 11:25:05 +0200 (Thu, 24 Aug 2006) $ by $Author: schulte $ 00012 * $Revision: 3559 $ 00013 * 00014 * This file is part of Gecode, the generic constraint 00015 * development environment: 00016 * http://www.gecode.org 00017 * 00018 * See the file "LICENSE" for information on usage and 00019 * redistribution of this file, and for a 00020 * DISCLAIMER OF ALL WARRANTIES. 00021 * 00022 */ 00023 00024 namespace Gecode { namespace Set { namespace Select { 00025 00030 template <class View> 00031 class IdxView { 00032 public: 00034 int idx; 00036 View var; 00038 static IdxView* allocate(Space* home,int n); 00039 }; 00040 00045 template <class View> 00046 class IdxViewArray { 00047 private: 00049 IdxView<View>* xs; 00051 int n; 00052 public: 00054 IdxViewArray(void); 00056 IdxViewArray(const IdxViewArray<View>&); 00057 00059 IdxViewArray(Space* home, const SetVarArgs& x); 00060 00062 int size(void) const; 00064 void size(int n); 00065 00067 IdxView<View>& operator[](int n); 00069 const IdxView<View>& operator[](int) const; 00070 00075 void subscribe(Space* home,Propagator* p, PropCond pc, bool process=true); 00080 void cancel(Space* home, Propagator* p, PropCond pc); 00081 00083 void update(Space* home, bool share, IdxViewArray<View>& x); 00084 }; 00085 00086 }}} 00087 00088 #include "gecode/set/select/idxarray.icc" 00089 00090 // STATISTICS: set-prop 00091