Generated on for Gecode by doxygen 1.17.0
blackbox-process.hh
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Jip J. Dekker <jip.dekker@monash.edu>
5 *
6 * Contributing authors:
7 * Mikael Zayenz Lagerkvist <lagerkvist@gecode.dev>
8 *
9 * Copyright:
10 * Jip J. Dekker, 2026
11 */
12#ifndef GECODE_FLATZINC_BLACKBOX_PROCESS_HH
13#define GECODE_FLATZINC_BLACKBOX_PROCESS_HH
14
15#include <string>
16#include <vector>
17
18#ifdef GECODE_HAS_THREADS
19#include <thread>
20#endif
21
22namespace Gecode { namespace FlatZinc {
23
26protected:
27#ifdef GECODE_HAS_THREADS
28 std::thread::id owner;
29#endif
31#ifdef GECODE_HAS_THREADS
32 : owner(std::this_thread::get_id())
33#endif
34 {}
35public:
36 virtual ~BlackBoxProcessSession(void) {}
37 bool owned_by_current_thread(void) const {
38#ifdef GECODE_HAS_THREADS
39 return owner == std::this_thread::get_id();
40#else
41 return true;
42#endif
43 }
44 virtual std::string exchange(const std::string& request) = 0;
45};
46
49create_blackbox_process(const std::string& program,
50 const std::vector<std::string>& args);
51
52}}
53
54#endif
55
56// STATISTICS: flatzinc-other
Platform process session used by the executable blackbox backend.
virtual std::string exchange(const std::string &request)=0
Interpreter for the FlatZinc language.
BlackBoxProcessSession * create_blackbox_process(const std::string &program, const std::vector< std::string > &args)
Create the process implementation selected for the target platform.
Gecode toplevel namespace