-
Notifications
You must be signed in to change notification settings - Fork 0
/
bindings.cc
31 lines (26 loc) · 1015 Bytes
/
bindings.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifdef __EMSCRIPTEN__
#include "cspsolver.h"
#include <emscripten/bind.h>
using namespace emscripten;
EMSCRIPTEN_BINDINGS(calcudoku_solver) {
class_<CspSolver>("CspSolver")
.constructor<int, int>()
.constructor<int>()
.constructor<>()
.function("addVariable", &CspSolver::addVariable)
.function("constraintFactory", &CspSolver::constraintFactory)
.function("addVariableToConstraint", &CspSolver::addVariableToConstraint)
.function("generateAlldiff", &CspSolver::generateAlldiff)
.function("generateAlldiffBox", &CspSolver::generateAlldiffBox)
.function("solve", &CspSolver::solve)
.function("indexOfVariable", &CspSolver::indexOfVariable)
//.function("getVariable", &CspSolver::getVariable)
;
/*
value_object<Variable>("Variable")
.field("name", &Variable::name)
.field("value", &Variable::value)
.field("values", &Variable::value)
;*/
}
#endif