Importer internal class. More...
#include <importer_internal.hpp>
Extra doc: https://github.com/casadi/casadi/wiki/L_218
Id | Type | Description | Used in |
---|---|---|---|
verbose | OT_BOOL | Verbose evaluation – for debugging | casadi::ImporterInternal |
Definition at line 44 of file importer_internal.hpp.
Classes | |
struct | Exposed |
Public Types | |
typedef ImporterInternal *(* | Creator) (const std::string &name) |
using | weak_ref_type = WeakRefInternal |
typedef int(* | RegFcn) (Plugin *plugin) |
Public Member Functions | |
ImporterInternal (const std::string &name) | |
Constructor. More... | |
~ImporterInternal () override | |
Destructor. More... | |
std::string | class_name () const override |
Get type name. More... | |
void | disp (std::ostream &stream, bool more) const override |
Print. More... | |
void | construct (const Dict &opts) |
Construct. More... | |
virtual void | init (const Dict &opts) |
Initialize. More... | |
virtual void | finalize () |
const char * | plugin_name () const override |
Queery plugin name. More... | |
virtual signal_t | get_function (const std::string &symname) |
Get a function pointer for numerical evaluation. More... | |
bool | has_function (const std::string &symname) const |
Get a function pointer for numerical evaluation. More... | |
bool | has_meta (const std::string &cmd, casadi_int ind=-1) const |
Does an entry exist? More... | |
std::string | get_meta (const std::string &cmd, casadi_int ind=-1) const |
Get entry as a text. More... | |
void | read_meta (std::istream &file, casadi_int &offset) |
Get meta information. More... | |
void | read_external (const std::string &sym, bool inlined, std::istream &file, casadi_int &offset) |
Get an external function declaration. More... | |
bool | inlined (const std::string &symname) const |
std::string | body (const std::string &symname) const |
Get the function body, if inlined. More... | |
virtual std::string | library () const |
Get library name. More... | |
virtual bool | can_have_meta () const |
Can meta information be read? More... | |
std::string | to_text (const std::string &cmd, casadi_int ind=-1) const |
Get entry as a text. More... | |
void | serialize (SerializingStream &s) const |
virtual void | serialize_type (SerializingStream &s) const |
virtual void | serialize_body (SerializingStream &s) const |
casadi_int | getCount () const |
Get the reference count. More... | |
std::string | debug_repr (const SharedObjectInternal *) const |
GenericWeakRef< SharedObject, SharedObjectInternal > * | weak () |
Get a weak reference to the object. More... | |
Static Public Member Functions | |
static std::string | shortname () |
Short name. More... | |
static std::string | indexed (const std::string &cmd, casadi_int ind) |
static ImporterInternal * | deserialize (DeserializingStream &s) |
static bool | has_plugin (const std::string &pname, bool verbose=false) |
Check if a plugin is available or can be loaded. More... | |
static const Options & | plugin_options (const std::string &pname) |
Get the plugin options. More... | |
static Deserialize | plugin_deserialize (const std::string &pname) |
Get the plugin deserialize_map. More... | |
static Plugin | pluginFromRegFcn (RegFcn regfcn) |
Instantiate a Plugin struct from a factory function. More... | |
static Plugin | load_plugin (const std::string &pname, bool register_plugin=true, bool needs_lock=true) |
Load a plugin dynamically. More... | |
static handle_t | load_library (const std::string &libname, std::string &resultpath, bool global) |
Load a library dynamically. More... | |
static void | registerPlugin (const Plugin &plugin, bool needs_lock=true) |
Register an integrator in the factory. More... | |
static void | registerPlugin (RegFcn regfcn, bool needs_lock=true) |
Register an integrator in the factory. More... | |
static Plugin & | getPlugin (const std::string &pname) |
Load and get the creator function. More... | |
static ImporterInternal * | instantiate (const std::string &fname, const std::string &pname, Problem problem) |
Public Attributes | |
std::string | name_ |
C filename. More... | |
std::map< std::string, std::pair< casadi_int, std::string > > | meta_ |
Meta data. More... | |
std::map< std::string, std::pair< bool, std::string > > | external_ |
External functions. More... | |
bool | verbose_ |
Verbose – for debugging purposes. More... | |
Static Public Attributes | |
static std::map< std::string, Plugin > | solvers_ |
Collection of solvers. More... | |
static const std::string | infix_ = "importer" |
Infix. More... | |
Protected Member Functions | |
ImporterInternal (DeserializingStream &s) | |
void | initSingleton () |
void | destroySingleton () |
B | shared_from_this () |
Get a shared object from the current internal object. More... | |
const B | shared_from_this () const |
Get a shared object from the current internal object. More... | |
static const Options | options_ |
Options. More... | |
virtual const Options & | get_options () const |
Options. More... | |
typedef ImporterInternal*(* casadi::ImporterInternal::Creator) (const std::string &name) |
Definition at line 66 of file importer_internal.hpp.
|
inherited |
Definition at line 73 of file plugin_interface.hpp.
|
inherited |
Definition at line 152 of file shared_object.hpp.
|
explicit |
Definition at line 31 of file importer_internal.cpp.
References verbose_.
|
override |
Definition at line 35 of file importer_internal.cpp.
|
explicitprotected |
Definition at line 325 of file importer_internal.cpp.
References external_, meta_, name_, casadi::DeserializingStream::unpack(), and casadi::DeserializingStream::version().
std::string casadi::ImporterInternal::body | ( | const std::string & | symname | ) | const |
|
inlinevirtual |
Reimplemented in casadi::DllLibrary.
Definition at line 142 of file importer_internal.hpp.
Referenced by init().
|
inlineoverridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_219
Implements casadi::SharedObjectInternal.
Reimplemented in casadi::ShellCompiler, casadi::ClangCompiler, and casadi::DllLibrary.
Definition at line 58 of file importer_internal.hpp.
Referenced by deserialize(), and serialize_type().
void casadi::ImporterInternal::construct | ( | const Dict & | opts | ) |
Prepares the function for evaluation
Extra doc: https://github.com/casadi/casadi/wiki/L_21b
Definition at line 57 of file importer_internal.cpp.
References casadi::Options::check(), finalize(), get_options(), init(), casadi::Options::is_sane(), and casadi::Options::sanitize().
Referenced by casadi::Importer::create().
|
inherited |
Definition at line 62 of file generic_shared_internal.hpp.
|
static |
Definition at line 332 of file importer_internal.cpp.
References class_name(), casadi::DllLibrary::deserialize(), and casadi::DeserializingStream::unpack().
Referenced by casadi::Importer::deserialize().
|
inlineprotectedinherited |
Called in the destructor of singletons
Definition at line 77 of file generic_shared_internal.hpp.
|
overridevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_21a
Implements casadi::SharedObjectInternal.
Definition at line 38 of file importer_internal.cpp.
|
inlinevirtual |
Reimplemented in casadi::DllLibrary.
Definition at line 88 of file importer_internal.hpp.
Referenced by construct().
|
inlinevirtual |
Reimplemented in casadi::ShellCompiler, casadi::ClangCompiler, and casadi::DllLibrary.
Definition at line 110 of file importer_internal.hpp.
Referenced by has_function().
std::string casadi::ImporterInternal::get_meta | ( | const std::string & | cmd, |
casadi_int | ind = -1 |
||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_21f
Definition at line 283 of file importer_internal.cpp.
References has_meta(), indexed(), and meta_.
|
inlinevirtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_21c
Reimplemented in casadi::ShellCompiler, and casadi::ClangCompiler.
Definition at line 80 of file importer_internal.hpp.
Referenced by construct().
|
inherited |
Definition at line 60 of file generic_shared_internal.hpp.
|
staticinherited |
Definition at line 102 of file plugin_interface.hpp.
bool casadi::ImporterInternal::has_function | ( | const std::string & | symname | ) | const |
Definition at line 214 of file importer_internal.cpp.
References external_, and get_function().
bool casadi::ImporterInternal::has_meta | ( | const std::string & | cmd, |
casadi_int | ind = -1 |
||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_21e
Definition at line 289 of file importer_internal.cpp.
References indexed(), and meta_.
Referenced by get_meta().
|
staticinherited |
Definition at line 76 of file plugin_interface.hpp.
|
inlinestatic |
Convert indexed command
Definition at line 150 of file importer_internal.hpp.
Referenced by get_meta(), and has_meta().
|
virtual |
Extra doc: https://github.com/casadi/casadi/wiki/L_21d
Reimplemented in casadi::ShellCompiler, and casadi::ClangCompiler.
Definition at line 74 of file importer_internal.cpp.
References can_have_meta(), inlined(), name_, read_external(), read_meta(), and verbose_.
Referenced by construct(), casadi::ClangCompiler::init(), and casadi::ShellCompiler::init().
|
inlineprotectedinherited |
Called in the constructor of singletons to avoid that the counter reaches zero
Definition at line 71 of file generic_shared_internal.hpp.
bool casadi::ImporterInternal::inlined | ( | const std::string & | symname | ) | const |
Definition at line 294 of file importer_internal.cpp.
References external_.
Referenced by init(), and read_external().
|
staticinherited |
Definition at line 106 of file plugin_interface.hpp.
|
virtual |
Reimplemented in casadi::ShellCompiler, and casadi::DllLibrary.
Definition at line 305 of file importer_internal.cpp.
|
staticinherited |
Definition at line 92 of file plugin_interface.hpp.
|
staticinherited |
Definition at line 88 of file plugin_interface.hpp.
|
staticinherited |
Definition at line 82 of file plugin_interface.hpp.
|
inlineoverridevirtual |
Implements casadi::PluginInterface< ImporterInternal >.
Reimplemented in casadi::ShellCompiler, and casadi::ClangCompiler.
Definition at line 107 of file importer_internal.hpp.
|
staticinherited |
Definition at line 79 of file plugin_interface.hpp.
|
staticinherited |
Definition at line 85 of file plugin_interface.hpp.
void casadi::ImporterInternal::read_external | ( | const std::string & | sym, |
bool | inlined, | ||
std::istream & | file, | ||
casadi_int & | offset | ||
) |
Definition at line 179 of file importer_internal.cpp.
References external_, and inlined().
Referenced by init().
void casadi::ImporterInternal::read_meta | ( | std::istream & | file, |
casadi_int & | offset | ||
) |
|
staticinherited |
Definition at line 96 of file plugin_interface.hpp.
|
staticinherited |
Definition at line 99 of file plugin_interface.hpp.
void casadi::ImporterInternal::serialize | ( | SerializingStream & | s | ) | const |
Definition at line 309 of file importer_internal.cpp.
References serialize_body(), and serialize_type().
|
virtual |
Definition at line 318 of file importer_internal.cpp.
References external_, meta_, name_, casadi::SerializingStream::pack(), and casadi::SerializingStream::version().
Referenced by serialize().
|
virtual |
Definition at line 314 of file importer_internal.cpp.
References class_name(), and casadi::SerializingStream::pack().
Referenced by serialize().
|
inlineprotectedinherited |
Definition at line 83 of file generic_shared_internal.hpp.
|
inlineprotectedinherited |
Definition at line 92 of file generic_shared_internal.hpp.
|
inlinestatic |
Definition at line 104 of file importer_internal.hpp.
std::string casadi::ImporterInternal::to_text | ( | const std::string & | cmd, |
casadi_int | ind = -1 |
||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_21g
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ai
Definition at line 67 of file generic_shared_internal.hpp.
std::map<std::string, std::pair<bool, std::string> > casadi::ImporterInternal::external_ |
Definition at line 163 of file importer_internal.hpp.
Referenced by body(), has_function(), ImporterInternal(), inlined(), read_external(), and serialize_body().
|
static |
Definition at line 101 of file importer_internal.hpp.
std::map<std::string, std::pair<casadi_int, std::string> > casadi::ImporterInternal::meta_ |
Definition at line 160 of file importer_internal.hpp.
Referenced by get_meta(), has_meta(), ImporterInternal(), read_meta(), and serialize_body().
std::string casadi::ImporterInternal::name_ |
Definition at line 157 of file importer_internal.hpp.
Referenced by ImporterInternal(), init(), casadi::ClangCompiler::init(), casadi::ShellCompiler::init(), casadi::DllLibrary::init_handle(), casadi::DllLibrary::library(), and serialize_body().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_21c
Definition at line 79 of file importer_internal.hpp.
|
static |
Definition at line 94 of file importer_internal.hpp.
bool casadi::ImporterInternal::verbose_ |
Extra doc: https://github.com/casadi/casadi/wiki/L_21h
Definition at line 168 of file importer_internal.hpp.
Referenced by ImporterInternal(), init(), and casadi::ShellCompiler::init().