|
TEC
A lightweight C++ library enabling safe, efficient execution in multithreaded and concurrent systems.
|
Core type definitions and metadata for a lightweight binary serialization format. More...
#include <tec_nd_types.hpp>
Classes | |
| struct | ElemHeader |
| Per-element header describing the following data item. More... | |
| struct | Header |
| Global header placed at the start of every serialized buffer. More... | |
| struct | Meta |
| Bit-flag definitions for interpreting the Tag field. More... | |
| struct | Tags |
| Concrete tag values for all supported data types. More... | |
Public Types | |
| using | ID = uint16_t |
| Unique identifier type for serialized objects/messages. | |
| using | Tag = uint16_t |
| Tag type used to encode element kind and properties. | |
| using | Size = uint32_t |
| Size type for individual element payload (in bytes). | |
| using | Count = uint16_t |
| Count type for number of elements in sequences/containers. | |
| using | Bool = uint8_t |
| Boolean storage type (always 1 byte). | |
| using | String = std::string |
| String storage type. | |
Public Member Functions | |
| constexpr Count | to_count (size_t count) |
| Convert a size_t count to Count, clamping at maximum. | |
| ElemHeader | get_scalar_info (const char &) |
| Get element info for signed char. | |
| ElemHeader | get_scalar_info (const unsigned char &) |
| Get element info for unsigned char. | |
| ElemHeader | get_scalar_info (const short &) |
| Get element info for signed short. | |
| ElemHeader | get_scalar_info (const unsigned short &) |
| Get element info for unsigned short. | |
| ElemHeader | get_scalar_info (const int &) |
| Get element info for signed int. | |
| ElemHeader | get_scalar_info (const unsigned int &) |
| Get element info for unsigned int. | |
| ElemHeader | get_scalar_info (const long &) |
| Get element info for signed long. | |
| ElemHeader | get_scalar_info (const unsigned long &) |
| Get element info for unsigned long. | |
| ElemHeader | get_scalar_info (const long long &) |
| Get element info for signed long long. | |
| ElemHeader | get_scalar_info (const unsigned long long &) |
| Get element info for unsigned long long. | |
| ElemHeader | get_scalar_info (const bool &) |
| Get element info for bool. | |
| ElemHeader | get_scalar_info (const float &) |
| Get element info for float. | |
| ElemHeader | get_scalar_info (const double &) |
| Get element info for double. | |
| ElemHeader | get_scalar_info (const long double &) |
| Get element info for long double (platform-dependent size). | |
| ElemHeader | get_seq_info (const String &str) |
| Get element info for std::string (character sequence). | |
| ElemHeader | get_seq_info (const Blob &bytes) |
| Get element info for Blob (raw byte sequence). | |
| template<typename TContainer > | |
| ElemHeader | get_container_info (const TContainer &c) |
| Get element info for flat containers (vector, array, etc.). | |
| template<typename TMap > | |
| ElemHeader | get_map_info (const TMap &m) |
| Get element info for map-like containers. | |
| template<typename TObject > | |
| ElemHeader | get_object_info (const TObject &) |
| Get element info for user-defined serializable objects. | |
| template<typename T > | |
| ElemHeader | get_info (const T &val) |
| Generic dispatcher to determine ElemHeader for any supported type. | |
Core type definitions and metadata for a lightweight binary serialization format.
This structure defines tags, sizes, and helper functions used to describe serialized data elements in a compact, platform-independent way.
|
inline |
Get element info for flat containers (vector, array, etc.).
| TContainer | Container type. |
|
inline |
Generic dispatcher to determine ElemHeader for any supported type.
Uses compile-time trait checks to route to the appropriate specialization.
| T | Value type. |
| val | Reference to the value (used only for overload resolution). |
|
inline |
Get element info for map-like containers.
| TMap | Map type. |
|
inline |
Get element info for user-defined serializable objects.
| TObject | Serializable type. |
Convert a size_t count to Count, clamping at maximum.
| count | Original count. |