user_single_integer_1.cpp 1.47 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// NOTE: This file was automatically generated from the dataformat declaration file
// 'user/single_integer/1.json'

#include "user_single_integer_1.h"
#include <beat.backend.cxx/dataformatfactory.h>

using namespace beat::backend::cxx;

dataformats::user::single_integer_1::single_integer_1()
{
}

//---------------------------------------------------------

size_t dataformats::user::single_integer_1::fixed_size()
{
    return sizeof(int32_t);
}

//---------------------------------------------------------

size_t dataformats::user::single_integer_1::size() const
{
    return dataformats::user::single_integer_1::fixed_size();
}

//---------------------------------------------------------

void dataformats::user::single_integer_1::pack(uint8_t** buffer) const
{
    beat::backend::cxx::pack(value, buffer);
}

//---------------------------------------------------------

void dataformats::user::single_integer_1::unpack(uint8_t** buffer)
{
    value = beat::backend::cxx::unpack_scalar<int32_t>(buffer);
}

//---------------------------------------------------------

Data* dataformats::user::single_integer_1::create()
{
    return new user::single_integer_1();
}

//---------------------------------------------------------

const char *dataformats::user::single_integer_1::getNameStatic()
{
    return "user/single_integer/1";
}

//---------------------------------------------------------

std::string dataformats::user::single_integer_1::toJson() const
{
return "{"
"\"field\":\"int32_t\""
"}";
}