6#include <bond/core/config.h>
9#include "bonded_void.h"
10#include "detail/double_pass.h"
14#include <bond/core/bond_reflection.h>
22template <
typename Protocols,
typename Transform,
typename T,
typename Reader>
23typename boost::disable_if<need_double_pass<Transform>,
bool>::type
inline
26 return bonded.template _Apply<Protocols>(transform);
31template <
typename Protocols,
typename Transform,
typename T,
typename Reader>
33ApplyTransform(
const Transform& transform,
const value<T, Reader>& value)
35 value.template _Apply<Protocols>(transform);
41template <
typename Protocols,
typename Transform,
typename T>
42typename boost::disable_if<need_double_pass<Transform>,
bool>::type
inline
43ApplyTransform(
const Transform& transform,
const T& value)
45 return StaticParser<const T&>(value).Apply(transform,
typename schema<T>::type());
50template <
typename Protocols,
typename Transform,
typename T>
51typename boost::enable_if<is_modifying_transform<Transform>,
bool>::type
inline
52ApplyTransform(
const Transform& transform, T& value)
54 return StaticParser<T&>(value).Apply(transform,
typename schema<T>::type());
59template <
typename Protocols,
typename Transform,
typename T,
typename Reader>
60typename boost::enable_if<need_double_pass<Transform>,
bool>::type
inline
63 if (transform.NeedPass0())
64 return DoublePassApply<Protocols>(transform,
bonded);
66 return bonded.template _Apply<Protocols>(transform);
70template <
typename Protocols,
typename Transform,
typename T>
71typename boost::enable_if<need_double_pass<Transform>,
bool>::type
inline
72ApplyTransform(
const Transform& transform,
const T& value)
74 if (transform.NeedPass0())
75 return DoublePassApply<Protocols>(transform, value);
77 return StaticParser<const T&>(value).Apply(transform,
typename schema<T>::type());
83template <
typename Protocols,
typename Transform,
typename T,
typename boost::enable_if<is_modifying_transform<Transform> >::type*>
84bool Apply(
const Transform& transform, T& value)
86 return detail::ApplyTransform<Protocols>(transform, value);
89template <
typename Protocols,
typename Transform,
typename T>
90bool Apply(
const Transform& transform,
const T& value)
92 return detail::ApplyTransform<Protocols>(transform, value);
97template <
typename T,
typename Transform>
98bool Apply(
const Transform& transform)
101 return SchemaReader::Parser{ input }.Apply(transform,
typename schema<T>::type{});
106template <
typename Transform>
110 return SchemaReader::Parser{ input }.Apply(transform, schema);
Represents runtime schema See User's Manual
Definition: runtime_schema.h:26
Represents data for a struct T known at compile-time.
Definition: bonded.h:63
namespace bond
Definition: apply.h:17