piranha
0.10
|
Wrapper for the serialization of keys via Boost. More...
#include <piranha/s11n.hpp>
Public Member Functions | |
boost_s11n_key_wrapper (Key &k, const symbol_fset &ss) | |
Constructor from key and piranha::symbol_fset. More... | |
boost_s11n_key_wrapper (const Key &k, const symbol_fset &ss) | |
Constructor from const key and piranha::symbol_fset. More... | |
Key & | key () |
Reference to the key. More... | |
const Key & | key () const |
Const reference to the key. More... | |
const symbol_fset & | ss () const |
Const reference to the symbol set. More... | |
Wrapper for the serialization of keys via Boost.
This is a simple struct that stores a reference to a key (possibly const-qualified) and a const reference to a piranha::symbol_fset. The Boost serialization routines of piranha::series will save/load keys via this wrapper rather than trying to save/load keys directly. The reason for this is that keys might need external information (in the form of the series' piranha::symbol_fset) in order for the (de)serialization to be successful.
Consequently, rather that implementing specialisations of piranha::boost_save_impl and piranha::boost_load_impl for key types, specialisations of piranha::boost_save_impl and piranha::boost_load_impl for this wrapper structure should be provided instead.
This class requires Key
to satisfy piranha::is_key, otherwise a compile-time error will be produced.
|
inlineexplicit |
Constructor from key and piranha::symbol_fset.
k | the input key. |
ss | the reference piranha::symbol_fset. |
|
inlineexplicit |
Constructor from const key and piranha::symbol_fset.
k | the input key. |
ss | the reference piranha::symbol_fset. |
|
inline |
Reference to the key.
This method will return a mutable reference to the key used as a construction argument. If this
was constructed from a const key instance, calling this method will raise an exception.
std::runtime_error | if this was constructed from a const key instance. |
|
inline |
|
inline |
Const reference to the symbol set.