21 #include "SQLamarr/db_functions.h"
22 #include "SQLamarr/BaseSqlInterface.h"
23 #include "SQLamarr/Transformer.h"
66 const std::string& library,
68 const std::string& function_name,
70 const std::string& select_query,
74 const std::string& output_table,
76 const std::vector<std::string> outputs,
80 const std::vector<std::string> reference_keys = {
"ref_id"}
99 const std::string m_library;
100 const std::string m_function_name;
101 const std::string m_select_query;
102 const std::string m_output_table;
103 const std::vector<std::string> m_outputs;
104 const std::vector<std::string> m_refkeys;
109 std::vector<std::string> get_column_names()
const;
110 std::string compose_delete_query();
111 std::string compose_create_query();
112 std::string compose_insert_query();
116 template <
typename Func_t> Func_t
load_func (
const std::string& fname);
121 template <
typename Func_t>
124 Func_t ret = Func_t(dlsym(m_handle, fname.c_str()));
128 std::cerr <<
"Failure while loading " << fname << std::endl;
129 throw std::runtime_error(
"Failed loading function");
Interface to dynamically linked parametrizations.
Func_t load_func(const std::string &fname)
Load a generic-typed function from an external library.
BasePlugin(BasePlugin &)=delete
void execute() override
Execute the external function and copies the output in a new table.
BasePlugin(SQLite3DB &db, const std::string &library, const std::string &function_name, const std::string &select_query, const std::string &output_table, const std::vector< std::string > outputs, const std::vector< std::string > reference_keys={"ref_id"})
Constructor.
virtual void eval_parametrization(float *output, const float *input)=0
Evaluate the external parametrization.
Abstract interface with helper functions to access an SQLite DB.
A database connection handler easying sharing the DB between C++ and Python.