8 #ifndef Sawyer_Cached_H
9 #define Sawyer_Cached_H
11 #include <Sawyer/Sawyer.h>
12 #include <Sawyer/Optional.h>
13 #include <boost/serialization/access.hpp>
14 #include <boost/serialization/nvp.hpp>
51 friend class boost::serialization::access;
54 void serialize(S &s,
const unsigned ) {
55 s & BOOST_SERIALIZATION_NVP(value_);
T Value
Type of stored value.
const Cached & operator=(const Value &x) const
Assign a new value.
const Value & get() const
Return the cached value.
const Sawyer::Optional< Value > & getOptional() const
Return cached value or nothing.
bool isCached() const
Cached state.
Name space for the entire library.
const Value & get() const
Dereference to obtain value.
void set(const Value &x) const
Assign a new value.
Value & get()
Return the cached value.
void clear() const
Remove cached value.
Implements cache data members.