37#ifndef GECODE_FLATZINC_BLACKBOX_BACKEND_HH
38#define GECODE_FLATZINC_BLACKBOX_BACKEND_HH
47#ifdef GECODE_HAS_THREADS
52#define GECODE_BLACKBOX_CALL __stdcall
54#define GECODE_BLACKBOX_CALL
60class BlackBoxProcessSession;
75 void run(
const std::vector<int64_t>& int_input,
76 const std::vector<double>& float_input,
77 std::vector<int64_t>& int_output,
78 std::vector<double>& float_output) {
79 BlackBoxCall call = {int_input, float_input, int_output, float_output};
89 const std::vector<std::string>& args);
103#ifdef GECODE_HAS_THREADS
116 const std::vector<std::string>&
args);
#define GECODE_BLACKBOX_CALL
Backend for a deterministic FlatZinc blackbox function.
virtual ~BlackBoxBackend(void)
virtual void run(BlackBoxCall &call)=0
void run(const std::vector< int64_t > &int_input, const std::vector< double > &float_input, std::vector< int64_t > &int_output, std::vector< double > &float_output)
BlackBoxProcessSession & session(void)
std::vector< std::string > args
BlackBoxExec(const std::string &program, const std::vector< std::string > &args)
std::vector< BlackBoxProcessSession * > sessions
void run(BlackBoxCall &call) override
void *GECODE_BLACKBOX_CALL * library_fzn_clone(void *)
void *GECODE_BLACKBOX_CALL * library_fzn_init(const char **, size_t)
BlackBoxLibrary(const std::string &name, const std::vector< std::string > &args)
void run(BlackBoxCall &call) override
std::vector< Instance * > instances
void(GECODE_BLACKBOX_CALL *library_fzn_blackbox)(void *
void(GECODE_BLACKBOX_CALL *library_fzn_free)(void *)
Instance * instance(void)
Platform process session used by the executable blackbox backend.
A mutex for mutual exclausion among several threads.
#define GECODE_FLATZINC_EXPORT
GECODE_FLATZINC_EXPORT std::string encode_blackbox_request(const BlackBoxCall &call)
Encode one request for the executable backend's line protocol.
GECODE_FLATZINC_EXPORT void decode_blackbox_response(const std::string &response, BlackBoxCall &call)
Decode and validate one response from the executable backend.
Gecode toplevel namespace
Inputs and pre-sized output buffers for one backend call.
const std::vector< int64_t > & int_input
std::vector< int64_t > & int_output
const std::vector< double > & float_input
std::vector< double > & float_output