1#ifndef INT_X_HPP_RW3TJBBI
2#define INT_X_HPP_RW3TJBBI
4#include <vanetza/common/byte_buffer.hpp>
5#include <vanetza/security/v2/serialization.hpp>
6#include <boost/operators.hpp>
7#include <boost/optional.hpp>
19 public boost::equality_comparable<IntX>,
20 public boost::equality_comparable<IntX, std::uintmax_t>
23 using integer_type = std::uintmax_t;
24 constexpr IntX() : m_value(0) {}
25 constexpr explicit IntX(integer_type x) : m_value(x) {}
27 void set(integer_type x);
28 constexpr integer_type get()
const {
return m_value; }
30 constexpr bool operator==(
const IntX& other)
const
32 return m_value == other.m_value;
35 constexpr bool operator==(integer_type other)
const
37 return m_value == other;
40 ByteBuffer encode()
const;
41 static boost::optional<IntX> decode(
const ByteBuffer&);
IntX specified in TS 103 097 v1.2.1, section 4.2.1.