pclass: Define bit integers as primitive types on TypeSystem

This commit is contained in:
Joshua Scott 2018-10-26 15:03:18 +01:00
parent a6e7ba11df
commit 1fbfaee8cb
2 changed files with 22 additions and 1 deletions

View File

@ -75,7 +75,7 @@ namespace ki
m_value = 0; m_value = 0;
} }
BitInteger(BitInteger<N, Unsigned> &cp) BitInteger(const BitInteger<N, Unsigned> &cp)
{ {
m_value = cp.m_value; m_value = cp.m_value;
} }

View File

@ -7,6 +7,16 @@
define_primitive<st>("signed " n); \ define_primitive<st>("signed " n); \
define_primitive<ut>("unsigned " n) define_primitive<ut>("unsigned " n)
#define DEFINE_BI_PRIMITIVE(n) \
define_primitive< bi<n> >("bi" #n)
#define DEFINE_BUI_PRIMITIVE(n) \
define_primitive< bui<n> >("bui" #n)
#define DEFINE_BIT_INTEGER_PRIMITIVE(n) \
DEFINE_BI_PRIMITIVE(n); \
DEFINE_BUI_PRIMITIVE(n)
namespace ki namespace ki
{ {
namespace pclass namespace pclass
@ -44,6 +54,17 @@ namespace pclass
define_primitive<uint64_t>("uint64_t"); define_primitive<uint64_t>("uint64_t");
define_primitive<uint64_t>("gid"); define_primitive<uint64_t>("gid");
// Define bit-integer types
DEFINE_BIT_INTEGER_PRIMITIVE(1);
DEFINE_BIT_INTEGER_PRIMITIVE(2);
DEFINE_BIT_INTEGER_PRIMITIVE(3);
DEFINE_BIT_INTEGER_PRIMITIVE(4);
DEFINE_BIT_INTEGER_PRIMITIVE(5);
DEFINE_BIT_INTEGER_PRIMITIVE(6);
DEFINE_BIT_INTEGER_PRIMITIVE(7);
define_primitive<bi<24>>("s24");
define_primitive<bui<24>>("u24");
// TODO: Define bit integer types // TODO: Define bit integer types
// TODO: Define floating point types // TODO: Define floating point types
// TODO: Define bit floating point types // TODO: Define bit floating point types