exec.cpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2012
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include <gecode/float.hh>
namespace Gecode {
void
wait(Home home, FloatVar x, std::function<void(Space& home)> c) {
GECODE_POST;
GECODE_ES_FAIL(UnaryWait<Float::FloatView>::post(home,x,c));
}
void
wait(Home home, const FloatVarArgs& x, std::function<void(Space& home)> c) {
GECODE_POST;
ViewArray<Float::FloatView> xv(home,x);
GECODE_ES_FAIL(NaryWait<Float::FloatView>::post(home,xv,c));
}
}
// STATISTICS: float-post
Gecode::FloatVarArgs
Passing float variables.
Definition float.hh:979
Gecode::FloatVar
Float variables.
Definition float.hh:870
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::NaryWait::post
static ExecStatus post(Home home, ViewArray< View > &x, std::function< void(Space &home)> c)
Post propagator that waits until x becomes assigned and then executes c.
Definition wait.hpp:232
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::UnaryWait::post
static ExecStatus post(Home home, View x, std::function< void(Space &home)> c)
Post propagator that waits until x becomes assigned and then executes c.
Definition wait.hpp:147
Gecode::ViewArray
View arrays.
Definition array.hpp:253
float.hh
GECODE_POST
#define GECODE_POST
Check for failure in a constraint post function.
Definition macros.hpp:40
GECODE_ES_FAIL
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
Definition macros.hpp:103
Gecode
Gecode toplevel namespace
Gecode::wait
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
Definition exec.cpp:39