Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
schema_impl.hpp File Reference
#include "schema_name.hpp"
#include <array>
#include <concepts>
#include <memory>
#include <string>

Go to the source code of this file.

Classes

struct  MsgpackSchemaPacker
 

Namespaces

namespace  msgpack_concepts
 

Concepts

concept  msgpack_concepts::SchemaPackable
 

Functions

template<typename T >
void _msgpack_schema_pack (MsgpackSchemaPacker &packer, const T &obj)
 Helper method for better error reporting. Clang does not give the best errors for argument lists.
 
void _schema_pack_map_content (MsgpackSchemaPacker &)
 
template<typename Value , typename... Rest>
void _schema_pack_map_content (MsgpackSchemaPacker &packer, std::string key, const Value &value, const Rest &... rest)
 
template<typename T >
requires (!msgpack_concepts::HasMsgPackSchema<T> && !msgpack_concepts::HasMsgPack<T>)
void msgpack_schema_pack (MsgpackSchemaPacker &packer, T const &obj)
 
template<msgpack_concepts::HasMsgPackSchema T>
void msgpack_schema_pack (MsgpackSchemaPacker &packer, T const &obj)
 
template<msgpack_concepts::HasMsgPack T>
requires (!msgpack_concepts::HasMsgPackSchema<T>)
void msgpack_schema_pack (MsgpackSchemaPacker &packer, T const &object)
 Encode a type that defines msgpack based on its key value pairs.
 
template<typename... Args>
void msgpack_schema_pack (MsgpackSchemaPacker &packer, std::tuple< Args... > const &)
 
template<typename K , typename V >
void msgpack_schema_pack (MsgpackSchemaPacker &packer, std::map< K, V > const &)
 
template<typename T >
void msgpack_schema_pack (MsgpackSchemaPacker &packer, std::optional< T > const &)
 
template<typename T >
void msgpack_schema_pack (MsgpackSchemaPacker &packer, std::vector< T > const &)
 
template<typename... Args>
void msgpack_schema_pack (MsgpackSchemaPacker &packer, std::variant< Args... > const &)
 
template<typename T >
void msgpack_schema_pack (MsgpackSchemaPacker &packer, std::shared_ptr< T > const &)
 
template<typename T , std::size_t N>
void msgpack_schema_pack (MsgpackSchemaPacker &packer, std::array< T, N > const &)
 
std::string msgpack_schema_to_string (const auto &obj)
 Print's an object's derived msgpack schema as a string.
 

Function Documentation

◆ _msgpack_schema_pack()

template<typename T >
void _msgpack_schema_pack ( MsgpackSchemaPacker packer,
const T &  obj 
)
inline

Helper method for better error reporting. Clang does not give the best errors for argument lists.

Definition at line 160 of file schema_impl.hpp.

◆ _schema_pack_map_content() [1/2]

void _schema_pack_map_content ( MsgpackSchemaPacker )
inline

Definition at line 99 of file schema_impl.hpp.

◆ _schema_pack_map_content() [2/2]

template<typename Value , typename... Rest>
void _schema_pack_map_content ( MsgpackSchemaPacker packer,
std::string  key,
const Value &  value,
const Rest &...  rest 
)
inline

Definition at line 111 of file schema_impl.hpp.

◆ msgpack_schema_pack() [1/10]

template<typename T , std::size_t N>
void msgpack_schema_pack ( MsgpackSchemaPacker packer,
std::array< T, N > const &   
)
inline

Definition at line 199 of file schema_impl.hpp.

◆ msgpack_schema_pack() [2/10]

template<typename K , typename V >
void msgpack_schema_pack ( MsgpackSchemaPacker packer,
std::map< K, V > const &   
)
inline

Definition at line 172 of file schema_impl.hpp.

◆ msgpack_schema_pack() [3/10]

template<typename T >
void msgpack_schema_pack ( MsgpackSchemaPacker packer,
std::optional< T > const &   
)
inline

Definition at line 177 of file schema_impl.hpp.

◆ msgpack_schema_pack() [4/10]

template<typename T >
void msgpack_schema_pack ( MsgpackSchemaPacker packer,
std::shared_ptr< T > const &   
)
inline

Definition at line 192 of file schema_impl.hpp.

◆ msgpack_schema_pack() [5/10]

template<typename... Args>
void msgpack_schema_pack ( MsgpackSchemaPacker packer,
std::tuple< Args... > const &   
)
inline

Definition at line 167 of file schema_impl.hpp.

◆ msgpack_schema_pack() [6/10]

template<typename... Args>
void msgpack_schema_pack ( MsgpackSchemaPacker packer,
std::variant< Args... > const &   
)
inline

Definition at line 187 of file schema_impl.hpp.

◆ msgpack_schema_pack() [7/10]

template<typename T >
void msgpack_schema_pack ( MsgpackSchemaPacker packer,
std::vector< T > const &   
)
inline

Definition at line 182 of file schema_impl.hpp.

◆ msgpack_schema_pack() [8/10]

template<typename T >
requires (!msgpack_concepts::HasMsgPackSchema<T> && !msgpack_concepts::HasMsgPack<T>)
void msgpack_schema_pack ( MsgpackSchemaPacker packer,
T const &  obj 
)
inline

Definition at line 126 of file schema_impl.hpp.

◆ msgpack_schema_pack() [9/10]

void msgpack_schema_pack ( MsgpackSchemaPacker packer,
T const &  obj 
)
inline

Schema pack base case for types with no special msgpack method.

Template Parameters
Tthe type.
Parameters
packerthe schema packer.

Definition at line 137 of file schema_impl.hpp.

◆ msgpack_schema_pack() [10/10]

void msgpack_schema_pack ( MsgpackSchemaPacker packer,
T const &  object 
)
inline

Encode a type that defines msgpack based on its key value pairs.

Template Parameters
Tthe msgpack()'able type
Parameters
packerOur special packer.
objectThe object in question.

Definition at line 151 of file schema_impl.hpp.

◆ msgpack_schema_to_string()

std::string msgpack_schema_to_string ( const auto &  obj)
inline

Print's an object's derived msgpack schema as a string.

Parameters
objThe object to print schema of.
Returns
std::string The schema as a string.

Definition at line 218 of file schema_impl.hpp.