pupene
0.2.0
|
Functions | |
template<typename P , typename T > | |
PupPolicy | begin (Pupper< P > &p, T &value, const Meta &meta) |
Called when a new object is encountered; an object is any type which is not floating point, integer or std::string. More... | |
template<typename P > | |
void | end (Pupper< P > &p, const Meta &meta) |
The opposite of pupene::fns::begin(p, value, meta). More... | |
template<typename P , typename Container , typename = void, typename = enable_if_puppable_container<Container>> | |
void | pup (Pupper< P > &p, Container &container, const Meta &meta) |
Pups STL-like sequential containers, but not std::string . More... | |
template<typename P , template< typename ... > typename Map, typename K , typename V , typename = enable_if_puppable_map<Map<K, V>>> | |
void | pup (Pupper< P > &p, Map< K, V > &map, const Meta &meta) |
Pups STL-like associative maps. More... | |
template<typename P , typename T , typename = enable_if_puppable<T>> | |
void | pup (Pupper< P > &p, T &value, const Meta &meta) |
Forwards value to the Pupper. More... | |
template<typename P , typename K , typename V > | |
void | pup (Pupper< P > &p, std::pair< K, V > &pair, const Meta &meta) |
Pups std::pair, used for pupping associative maps. More... | |
template<typename P , typename Iterable , typename = enable_if_pup_iterable<Iterable>> | |
void | pup_iterable (Pupper< P > &p, Iterable &container, const Meta &meta) |
Pups most STL-like containers, including strings. More... | |
template<typename P , typename T , typename Fn > | |
void | pup_object (Pupper< P > &p, T &object, const Meta &meta, Fn &&body_fn) |
Describes a type by enumerating its members, used in conjunction with pup() implementations. More... | |
template<typename P , typename Iterable , typename BodyFn > | |
void | pup_object_container (Pupper< P > &p, Iterable container, const Meta &meta, BodyFn &&body_fn) |
A pup_object() for dealing with iterable types. More... | |
PupPolicy pupene::fns::begin | ( | Pupper< P > & | p, |
T & | value, | ||
const Meta & | meta | ||
) |
Called when a new object is encountered; an object is any type which is not floating point, integer or std::string.
Forwards to Pupper::begin(). If the Pupper returns PupPolicy::consume_object, the Pupper deals with the object without invoking its associated pup
function(s).
value | Passed to pupper. |
Definition at line 22 of file pup-pupper.h.
The opposite of pupene::fns::begin(p, value, meta).
The meta
object is the same as was sent in when the corresponding begin(Pupper<P>, T&, Meta&)
.
Definition at line 48 of file pup-pupper.h.
void pupene::fns::pup | ( | Pupper< P > & | p, |
Container & | container, | ||
const Meta & | meta | ||
) |
Pups STL-like sequential containers, but not std::string
.
void pupene::fns::pup | ( | Pupper< P > & | p, |
Map< K, V > & | map, | ||
const Meta & | meta | ||
) |
Pups STL-like associative maps.
Definition at line 36 of file pup.h.
References pupene::Meta::Meta(), and pupene::Meta::Object.
void pupene::fns::pup | ( | Pupper< P > & | p, |
T & | value, | ||
const Meta & | meta | ||
) |
Forwards value to the Pupper.
T | Matches std::string, integer and floating point types. |
value | Passed to pupper. |
Definition at line 39 of file pup-pupper.h.
void pupene::fns::pup_iterable | ( | Pupper< P > & | p, |
Iterable & | container, | ||
const Meta & | meta | ||
) |
Pups most STL-like containers, including strings.
This function should only be called by pupper implementations.
Puppers commonly deal in formats where strings are considered fundamental/built-in types - if this is not the case, the pupper must specialize on std::string
, and pup to this function, e.g.:
The container
object is encoded as size
(element count) followed by its contents.
DebugPupper output:
Definition at line 145 of file pup-core.h.
void pupene::fns::pup_object | ( | Pupper< P > & | p, |
T & | object, | ||
const Meta & | meta, | ||
Fn && | body_fn | ||
) |
Describes a type by enumerating its members, used in conjunction with pup() implementations.
pup
for glm's vec2 typebody_fn
is not invoked if begin() returns PupPolicy::consume_object.
Fn | has signature [](auto&&) |
body_fn | invoked with [](auto& v, const Meta& meta) , where v is a member of object |
Definition at line 39 of file pup-core.h.
References pupene::Meta::Meta(), pupene::Meta::name, pupene::Meta::Object, pupene::pup_object, pupene::Meta::type, and pupene::Meta::Value.
void pupene::fns::pup_object_container | ( | Pupper< P > & | p, |
Iterable | container, | ||
const Meta & | meta, | ||
BodyFn && | body_fn | ||
) |
A pup_object() for dealing with iterable types.
Encodes container
as size
followed by the contents.
BodyFn | has signature [](auto&&, uint32_t size) |
body_fn | invoked with [](auto& v, const Meta& meta) , where v is a member of object |
Definition at line 68 of file pup-core.h.
References pupene::Meta::Array, and pupene::Meta::Meta().