Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0
subscribed.hpp
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Christian Schulte <schulte@gecode.org>
5 *
6 * Copyright:
7 * Christian Schulte, 2016
8 *
9 * This file is part of Gecode, the generic constraint
10 * development environment:
11 * http://www.gecode.org
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining
14 * a copy of this software and associated documentation files (the
15 * "Software"), to deal in the Software without restriction, including
16 * without limitation the rights to use, copy, modify, merge, publish,
17 * distribute, sublicense, and/or sell copies of the Software, and to
18 * permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be
22 * included in all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 */
32
33namespace Gecode {
34
37 protected:
44 public:
46 template<class VIC>
49 template<class View>
52 template<class Var>
55 template<class View>
58 template<class VIC>
59 void init(VarImp<VIC>& x);
61 template<class View>
62 void init(ConstView<View>& x);
64 template<class Var>
65 void init(VarImpView<Var>& x);
67 template<class View>
70 bool operator ()(void) const;
72 void operator ++(void);
74 Propagator& propagator(void) const;
75 };
76
77 template<class VIC>
78 forceinline void
80 c = x.actor(0);
81 ep = x.actorNonZero(x.pc_max+1); ea = x.b.base+x.entries;
82 }
83 template<class VIC>
88 template<class View>
89 forceinline void
93 template<class View>
98 template<class Var>
103 template<class Var>
104 forceinline void
108 template<class View>
113 template<class View>
114 forceinline void
118
119 forceinline bool
121 return c<ea;
122 }
123 forceinline void
129 return (c < ep) ? *Propagator::cast(*c) : Advisor::cast(*c)->propagator();
130 }
131
132}
133
134// STATISTICS: kernel-prop
Base-class for constant views.
Definition view.hpp:45
Base-class for derived views.
Definition view.hpp:230
Base-class for propagators.
Definition core.hpp:1066
SubscribedPropagators(VarImp< VIC > &x)
Initialize.
void operator++(void)
Move iterator to next propagator.
void init(VarImp< VIC > &x)
Initialize.
Propagator & propagator(void) const
Return propagator.
ActorLink ** c
Pointing at the current subscription (either propagator or advisor)
ActorLink ** ep
End of propagator subscriptions.
ActorLink ** ea
End of advisor subscriptions.
bool operator()(void) const
Test whether there are propagators left.
Base-class for variable implementation views.
Definition view.hpp:133
Base-class for variable implementations.
Definition core.hpp:219
Gecode toplevel namespace
Post propagator for SetVar x
Definition set.hh:773
#define forceinline
Definition config.hpp:194