hyumo / fmilibpp

Single header C++17 wrapper for FMILibrary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fmilib++

Build status

A header only modern c++ wrapper for FMILibrary. Still WIP.

C++17 compiler is required.

How to use

Just copy and paste fmilib.hpp file into your project then include it.

#include "fmilib.hpp"

int main()
{
    std::string fmu_path = "C:/CoupledClutches.fmu";
    std::string temp_dir = "C:/temp";
    fmi2_callback_functions_t fmu_cb
        = {fmi2_log_forwarding, calloc, free, nullptr, nullptr};
    jm_callbacks jm_cb
        = {malloc, calloc, realloc, free, jm_default_logger, jm_log_level_debug,
           nullptr};

    fmilib::fmi2_me_t m(fmu_path, temp_dir, fmu_cb, jm_cb);
    std::cout << m.model_name() << '\n';
    std::cout << m.GUID() << '\n';
}

About

Single header C++17 wrapper for FMILibrary

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:C++ 97.8%Language:CMake 2.2%