26 #ifndef CASADI_GRAPH_MODEL_INTERNAL_HPP
27 #define CASADI_GRAPH_MODEL_INTERNAL_HPP
29 #include "graph_model_impl.hpp"
30 #include "function_internal.hpp"
31 #include "plugin_interface.hpp"
37 class GraphBuilderInternal;
47 class CASADI_EXPORT GraphModelInternal
48 :
public SharedObjectInternal,
49 public PluginInterface<GraphModelInternal> {
51 explicit GraphModelInternal(
const std::vector<uint8_t>& model_data);
52 ~GraphModelInternal()
override;
54 std::string class_name()
const override {
return "GraphModelInternal"; }
55 void disp(std::ostream& stream,
bool more)
const override;
58 typedef GraphModelInternal* (*Creator)(
const std::vector<uint8_t>& model_data);
67 static const Options options_;
68 virtual const Options& get_options()
const {
return options_; }
72 void construct(
const Dict& opts);
77 virtual void init(
const Dict& opts);
80 virtual void fill_metadata(GraphBuilderInternal& gb)
const = 0;
83 virtual Function import_symbolic(
const GraphBuilderInternal& gb,
84 const std::string& name) = 0;
87 virtual std::vector<uint8_t> export_symbolic(
const Function& f,
const Dict& opts) = 0;
90 const std::vector<uint8_t>& model_data()
const {
return model_data_; }
93 const char* plugin_name()
const override = 0;
96 static std::map<std::string, Plugin> solvers_;
98 #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
99 static std::mutex mutex_solvers_;
103 static const std::string infix_;
106 static std::string shortname() {
return "graphmodel"; }
110 std::vector<uint8_t> model_data_;
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.