Generated on for Gecode by doxygen 1.18.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 <thread>
17#include <vector>
18
19namespace Gecode { namespace FlatZinc {
20
29protected:
30 std::thread::id owner;
31 BlackBoxProcessSession(void) : owner(std::this_thread::get_id()) {}
32public:
33 virtual ~BlackBoxProcessSession(void) {}
34 bool owned_by_current_thread(void) const {
35 return owner == std::this_thread::get_id();
36 }
37 virtual std::string exchange(const std::string& request) = 0;
38};
39
42create_blackbox_process(const std::string& program,
43 const std::vector<std::string>& args);
44
45}}
46
47#endif
48
49// 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