Files
2026-09-23 14:02:51 +03:00

59 lines
1.4 KiB
C++

#pragma once
#include <cstdint>
#include <cstddef>
struct SolverParameters{
double k1;
double k2;
double t_begin;
double t_end;
double step;
};
struct SolutionPoint{
double t;
double x1;
double x2;
double x3;
};
enum PluginType{
Solver,
Output
};
struct OutputParameters{
const char* solver_name;
const char* destination_path;
const SolutionPoint* points;
size_t point_count;
};
inline constexpr std::uint32_t PLUGIN_API_VERSION = 3;
#if defined(_WIN32) && defined(PLUGIN_BUILD)
#define PLUGIN_EXPORT extern "C" __declspec(dllexport)
#elif defined(_WIN32)
#define PLUGIN_EXPORT extern "C"
#else
#define PLUGIN_EXPORT extern "C" __attribute__((visibility("default")))
#endif
using plugin_api_version_fn = std::uint32_t (*)();
using plugin_type_fn = PluginType (*)();
using plugin_text_fn = const char* (*)();
using solver_run_fn = void (*)(
const SolverParameters*,
SolutionPoint*,
size_t
);
using output_write_fn = int (*)(const OutputParameters*);
inline constexpr const char* SYMBOL_API_VERSION = "plugin_api_version";
inline constexpr const char* SYMBOL_TYPE = "plugin_type";
inline constexpr const char* SYMBOL_NAME = "plugin_name";
inline constexpr const char* SYMBOL_DESCRIPTION = "plugin_description";
inline constexpr const char* SYMBOL_SOLVER = "solver";
inline constexpr const char* SYMBOL_WRITE_OUTPUT = "write_output";