diff options
| author | a1xd <[email protected]> | 2021-04-01 01:51:31 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2021-04-01 01:51:31 -0400 |
| commit | 14bde56daf188bfc027dc8ead5b45ec0aa1109d6 (patch) | |
| tree | 6c674efea62c4e945e4d8ed3e947189742486015 /wrapper/wrapper_io.cpp | |
| parent | refactor lut/motivity (diff) | |
| download | rawaccel-14bde56daf188bfc027dc8ead5b45ec0aa1109d6.tar.xz rawaccel-14bde56daf188bfc027dc8ead5b45ec0aa1109d6.zip | |
update rest
grapher is still broken
refactored io / error handling a bit
Diffstat (limited to 'wrapper/wrapper_io.cpp')
| -rw-r--r-- | wrapper/wrapper_io.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/wrapper/wrapper_io.cpp b/wrapper/wrapper_io.cpp deleted file mode 100644 index 4b77174..0000000 --- a/wrapper/wrapper_io.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include <rawaccel-io.hpp> -#include "wrapper_io.hpp" - -auto with_managed_ex = [](auto fn) { - try - { - fn(); - } - catch (const install_error&) - { - throw gcnew DriverNotInstalledException(); - } - catch (const std::system_error& e) - { - throw gcnew DriverIOException(gcnew String(e.what())); - } -}; - -void wrapper_io::writeToDriver(const settings& args) -{ - with_managed_ex([&] { - write(args); - }); -} - -void wrapper_io::readFromDriver(settings& args) -{ - with_managed_ex([&] { - args = read(); - }); -} - -void wrapper_io::getDriverVersion(version_t& ver) -{ - with_managed_ex([&] { - ver = get_version(); - }); -} |