103 static constexpr Tag Container{
'C'};
104 static constexpr Tag Map{
'M'};
107 static constexpr Tag Object{
'O'};
136 static constexpr uint32_t
kMagic{0x00041b00};
253 return ((count > __UINT16_MAX__) ? __UINT16_MAX__ :
static_cast<Count>(count));
308 template <
typename TContainer>
315 template <
typename TMap>
322 template <
typename TObject>
334 template <
typename T>
336 if constexpr (is_serializable_v<T>) {
339 else if constexpr (std::is_arithmetic_v<T>) {
343 std::is_same_v<T, String> ||
344 std::is_same_v<T, Blob>
348 else if constexpr (is_map_v<T>) {
351 else if constexpr (is_container_v<T>) {
A byte buffer class with stream-like read/write semantics.
Definition tec_memfile.hpp:50
size_t size() const noexcept
Returns the logical size of the data in the buffer.
Definition tec_memfile.hpp:304
Definition tec_compression.hpp:34
Core type definitions and metadata for a lightweight binary serialization format.
Definition tec_nd_types.hpp:56
ElemHeader get_scalar_info(const bool &)
Get element info for bool.
Definition tec_nd_types.hpp:287
ElemHeader get_scalar_info(const short &)
Get element info for signed short.
Definition tec_nd_types.hpp:263
uint16_t ID
Unique identifier type for serialized objects/messages.
Definition tec_nd_types.hpp:59
ElemHeader get_container_info(const TContainer &c)
Get element info for flat containers (vector, array, etc.).
Definition tec_nd_types.hpp:309
ElemHeader get_scalar_info(const double &)
Get element info for double.
Definition tec_nd_types.hpp:293
ElemHeader get_map_info(const TMap &m)
Get element info for map-like containers.
Definition tec_nd_types.hpp:316
ElemHeader get_scalar_info(const unsigned long &)
Get element info for unsigned long.
Definition tec_nd_types.hpp:278
ElemHeader get_scalar_info(const unsigned long long &)
Get element info for unsigned long long.
Definition tec_nd_types.hpp:284
ElemHeader get_scalar_info(const int &)
Get element info for signed int.
Definition tec_nd_types.hpp:269
ElemHeader get_seq_info(const Blob &bytes)
Get element info for Blob (raw byte sequence).
Definition tec_nd_types.hpp:302
uint8_t Bool
Boolean storage type (always 1 byte).
Definition tec_nd_types.hpp:63
ElemHeader get_scalar_info(const long long &)
Get element info for signed long long.
Definition tec_nd_types.hpp:281
std::string String
String storage type.
Definition tec_nd_types.hpp:64
ElemHeader get_scalar_info(const long &)
Get element info for signed long.
Definition tec_nd_types.hpp:275
uint32_t Size
Size type for individual element payload (in bytes).
Definition tec_nd_types.hpp:61
ElemHeader get_scalar_info(const unsigned short &)
Get element info for unsigned short.
Definition tec_nd_types.hpp:266
ElemHeader get_object_info(const TObject &)
Get element info for user-defined serializable objects.
Definition tec_nd_types.hpp:323
constexpr Count to_count(size_t count)
Convert a size_t count to Count, clamping at maximum.
Definition tec_nd_types.hpp:252
ElemHeader get_scalar_info(const char &)
Get element info for signed char.
Definition tec_nd_types.hpp:257
uint16_t Count
Count type for number of elements in sequences/containers.
Definition tec_nd_types.hpp:62
ElemHeader get_scalar_info(const float &)
Get element info for float.
Definition tec_nd_types.hpp:290
ElemHeader get_scalar_info(const long double &)
Get element info for long double (platform-dependent size).
Definition tec_nd_types.hpp:296
ElemHeader get_seq_info(const String &str)
Get element info for std::string (character sequence).
Definition tec_nd_types.hpp:299
uint16_t Tag
Tag type used to encode element kind and properties.
Definition tec_nd_types.hpp:60
ElemHeader get_info(const T &val)
Generic dispatcher to determine ElemHeader for any supported type.
Definition tec_nd_types.hpp:335
ElemHeader get_scalar_info(const unsigned int &)
Get element info for unsigned int.
Definition tec_nd_types.hpp:272
ElemHeader get_scalar_info(const unsigned char &)
Get element info for unsigned char.
Definition tec_nd_types.hpp:260
Generic container and map traits.
Common definitions and utilities for the tec namespace.
A byte buffer class with stream-like read/write semantics.
The base interface for serializable objects.