6#ifndef LIMA_COMMON_STDBITSET
7#define LIMA_COMMON_STDBITSET
24 std::bitset<LC_WIDTH> base;
26 static std::hash<std::bitset<LC_WIDTH>> hash_fn;
30 inline std::string toString_()
const
33 char *p = chars + (
LC_WIDTH / N + 1);
40 unsigned char c = n.
lsb() & ((1 << N) - 1);
45 return std::string(p);
48 inline std::size_t hash()
const
54 : base((
unsigned long long)(val))
72 const char *p = str.c_str();
73 const char *e = p + str.
size();
94 static std::size_t
size() noexcept
137 return toString_<4>();
142 return toString_<3>();
147 return toString_<1>();
157 inline unsigned char lsb()
175 std::deque<char> chars;
180 unsigned c = (n.
lsb() & 0x7F) << 1;
185 for (std::deque<char>::size_type i=chars.size()-1;i>0;i--)
202 while((c & 0x1) && is.good())
204 is.read((
char*)&c,
sizeof(
char));
254 return base == other.base;
259 return base != other.base;
291 return lhs.hash() < rhs.hash();
296 return lhs.hash() > rhs.hash();
312 if (!std::isspace(c))
321 if (!std::isdigit(c))
338#define L_NONE Lima::LinguisticCode::ZERO
339#define NONE_1 Lima::LinguisticCode::ZERO
#define LIMA_COMMON_EXPORT
std::string toString() const
LinguisticCode operator>>=(std::size_t pos) noexcept
bool operator!=(const LinguisticCode &other) const noexcept
bool toBool() const noexcept
LinguisticCode operator<<=(std::size_t pos) noexcept
static LinguisticCode fromString(const std::string &str)
friend LinguisticCode operator|(const LinguisticCode &lhs, const LinguisticCode &rhs) noexcept
std::string toHexString() const
friend LinguisticCode operator&(const LinguisticCode &lhs, const LinguisticCode &rhs) noexcept
static LIMA_COMMON_EXPORT LinguisticCode fromDecString(const std::string &str)
static LIMA_COMMON_EXPORT const LinguisticCode ZERO
friend bool operator>(const LinguisticCode &lhs, const LinguisticCode &rhs)
LinguisticCode operator<<(std::size_t pos) const noexcept
LinguisticCode operator~() const noexcept
std::string toOctString() const
static std::size_t size() noexcept
static LinguisticCode fromUInt(uint64_t v)
static LinguisticCode fromOctString(const std::string &str)
static std::ostream & encodeToBinary(std::ostream &os, const LinguisticCode &value)
friend LinguisticCode operator^(const LinguisticCode &lhs, const LinguisticCode &rhs) noexcept
LIMA_COMMON_EXPORT std::string toDecString() const
LinguisticCode() noexcept
friend bool operator<(const LinguisticCode &lhs, const LinguisticCode &rhs)
static LinguisticCode decodeFromBinary(std::istream &is)
LinguisticCode operator^=(const LinguisticCode &other) noexcept
LinguisticCode operator&=(const LinguisticCode &other) noexcept
bool operator==(const LinguisticCode &other) const noexcept
LinguisticCode operator>>(std::size_t pos) const noexcept
LinguisticCode operator|=(const LinguisticCode &other) noexcept
std::string toBinString() const
bool operator!() const noexcept
static LinguisticCode decodeFromBinary(unsigned char *&p)
bool operator<(const LinguisticCode &lhs, const LinguisticCode &rhs)
std::ostream & operator<<(ostream &os, const Node &node)
bool operator>(const LinguisticCode &lhs, const LinguisticCode &rhs)
LinguisticCode operator|(const LinguisticCode &lhs, const LinguisticCode &rhs) noexcept
LinguisticCode operator^(const LinguisticCode &lhs, const LinguisticCode &rhs) noexcept
LIMA_COMMON_EXPORT std::istream & operator>>(std::istream &is, uint128_t &value)
LinguisticCode operator&(const LinguisticCode &lhs, const LinguisticCode &rhs) noexcept