Zakero's C++ Header Libraries
A collection of reusable C++ libraries
|
Public Member Functions | |
template<typename T > | |
const T & | as () const noexcept |
Convert to type T . More... | |
template<typename T > | |
T & | as () noexcept |
Convert to type T . More... | |
const messagepack::Array & | asArray () const noexcept |
Convert to an Array. More... | |
messagepack::Array & | asArray () noexcept |
Convert to an Array. More... | |
const std::vector< uint8_t > & | asBinary () const noexcept |
Convert to a std::vector<uint8_t>. More... | |
std::vector< uint8_t > & | asBinary () noexcept |
Convert to a std::vector<uint8_t>. More... | |
const messagepack::Ext & | asExt () const noexcept |
Convert to an Ext. More... | |
messagepack::Ext & | asExt () noexcept |
Convert to an Ext. More... | |
const messagepack::Map & | asMap () const noexcept |
Convert to a Map. More... | |
messagepack::Map & | asMap () noexcept |
Convert to a Map. More... | |
const std::string & | asString () const noexcept |
Convert to a std::string. More... | |
template<typename T > | |
constexpr bool | is () const noexcept |
Is Object of type T . More... | |
constexpr bool | isArray () const noexcept |
Is Object an Array? More... | |
constexpr bool | isBinary () const noexcept |
Is Object binary data? More... | |
constexpr bool | isExt () const noexcept |
Is Object an Ext? More... | |
constexpr bool | isMap () const noexcept |
Is Object a Map? More... | |
constexpr bool | isNull () const noexcept |
Does the Object represent a null ? More... | |
constexpr bool | isString () const noexcept |
Is Object a std::string? More... | |
The role of this object is to store all the data-types in the MessagePack specification. This is accomplish by using the std::variant
and a collection of helper methods to reduce the verbosity of templates.
std::monostate
is used to represent null
.Once an Object has been set to a type, it is an error to cast the object to any other type.
|
inlinenoexcept |
The Object will be converted so that it will be treated as the requested T
type.
T | The data-type to convert to. |
|
inlinenoexcept |
The Object will be converted so that it will be treated as the requested T
type.
T | The data-type to convert to. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
The same as: object.as<std::vector<uint8_t>>()
|
inlinenoexcept |
The same as: object.as<std::vector<uint8_t>>()
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
The Object will be checked to see if it is of type T
.
T | The data-type to check. |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |