| xCore-SDK 0.4.1 xCore SDK C# API

converter_cli.hpp
1#pragma once
2#ifndef XCORESDK_SRC_MANAGED_CONVERTER_CLI_HPP_
3#define XCORESDK_SRC_MANAGED_CONVERTER_CLI_HPP_
4
5#include <system_error>
6#include "data_types.h"
7#include "data_types_cli.hpp"
8
9 namespace rokae::clr {
10 template <size_t S>
11 array<double>^ convertArray(const std::array<double, S>& _in) {
12 auto ret = gcnew array<double>((int)_in.size());
13 for (int i = 0; i < (int)_in.size(); ++i) {
14 ret[i] = _in[i];
15 }
16 return ret;
17 }
18
19 template <size_t S>
20 std::array<double, S> convertArray(array<double>^ _in) {
21 std::array<double, S> _out{};
22 for (unsigned int i = 0; i < ((_in->Length < S) ? _in->Length : S); ++i) {
23 _out[i] = _in[i];
24 }
25 return _out;
26 }
27
28 void convertErrorCode(const std::error_code& _in, ErrorCode^% _out);
29 Load^ convertLoad(const rokae::Load& _in);
30
31
32 void convertLoad(Load^ in, rokae::Load& out);
33
34 rokae::Frame convertFrame(Frame^ frame);
35}
36
37#endif // XCORESDK_SRC_MANAGED_CONVERTER_CLI_HPP_