OR-Tools  8.0
sat_python_wrap.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.2
4  *
5  * This file is not intended to be easily readable and contains a number of
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG
8  * interface file instead.
9  * ----------------------------------------------------------------------------- */
10 
11 #ifndef SWIG_pywrapsat_WRAP_H_
12 #define SWIG_pywrapsat_WRAP_H_
13 
14 #include <map>
15 #include <string>
16 
17 
18 class SwigDirector_SolutionCallback : public operations_research::sat::SolutionCallback, public Swig::Director {
19 
20 public:
21  SwigDirector_SolutionCallback(PyObject *self);
23  virtual void OnSolutionCallback() const;
24 
25 /* Internal director utilities */
26 public:
27  bool swig_get_inner(const char *swig_protected_method_name) const {
28  std::map<std::string, bool>::const_iterator iv = swig_inner.find(swig_protected_method_name);
29  return (iv != swig_inner.end() ? iv->second : false);
30  }
31  void swig_set_inner(const char *swig_protected_method_name, bool swig_val) const {
32  swig_inner[swig_protected_method_name] = swig_val;
33  }
34 private:
35  mutable std::map<std::string, bool> swig_inner;
36 
37 #if defined(SWIG_PYTHON_DIRECTOR_VTABLE)
38 /* VTable implementation */
39  PyObject *swig_get_method(size_t method_index, const char *method_name) const {
40  PyObject *method = vtable[method_index];
41  if (!method) {
43  method = PyObject_GetAttr(swig_get_self(), name);
44  if (!method) {
45  std::string msg = "Method in class SolutionCallback doesn't exist, undefined ";
46  msg += method_name;
48  }
49  vtable[method_index] = method;
50  }
51  return method;
52  }
53 private:
54  mutable swig::SwigVar_PyObject vtable[1];
55 #endif
56 
57 };
58 
59 
60 #endif
Swig::DirectorMethodException::raise
static void raise(const char *msg)
Definition: constraint_solver_python_wrap.cc:2936
SwigDirector_SolutionCallback
Definition: sat_csharp_wrap.h:14
SWIG_Python_str_FromChar
SWIGINTERN PyObject * SWIG_Python_str_FromChar(const char *c)
Definition: knapsack_solver_python_wrap.cc:840
Swig::Director::swig_get_self
PyObject * swig_get_self() const
Definition: constraint_solver_python_wrap.cc:3008
swig::SwigVar_PyObject
Definition: knapsack_solver_python_wrap.cc:2797
SwigDirector_SolutionCallback::SwigDirector_SolutionCallback
SwigDirector_SolutionCallback()
Definition: sat_csharp_wrap.cc:406
Swig::Director
Definition: constraint_solver_csharp_wrap.cc:349
SwigDirector_SolutionCallback::OnSolutionCallback
virtual void OnSolutionCallback() const
SwigDirector_SolutionCallback::swig_get_inner
bool swig_get_inner(const char *swig_protected_method_name) const
Definition: sat_python_wrap.h:27
SwigDirector_SolutionCallback::swig_set_inner
void swig_set_inner(const char *swig_protected_method_name, bool swig_val) const
Definition: sat_python_wrap.h:31
SwigDirector_SolutionCallback::~SwigDirector_SolutionCallback
virtual ~SwigDirector_SolutionCallback()
name
const std::string name
Definition: default_search.cc:807