-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,4 +327,3 @@ int main() | |
on_policy(w, policies, start); | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#if USING_BOOST_SERIALIZATION | ||
#include <boost/serialization/serialization.hpp> | ||
#include <boost/serialization/access.hpp> | ||
#include <boost/serialization/unordered_map.hpp> | ||
|
||
template <class state_class> | ||
struct state_wrapper : private state_class | ||
{ | ||
state_wrapper(); | ||
operator state_class() const; | ||
}; | ||
|
||
template <class action_class> | ||
struct action_wrapper : private action_class | ||
{ | ||
action_wrapper(); | ||
operator action_class() const; | ||
}; | ||
|
||
template <class state_class> | ||
struct cast_state | ||
{ | ||
state_wrapper<state_class> operator()(const state_class arg) const; | ||
}; | ||
|
||
template <class action_class> | ||
struct cast_action | ||
{ | ||
action_wrapper<action_class> operator()(const action_class arg) const; | ||
}; | ||
|
||
template <class state_class> | ||
struct hasher<state_wrapper<state_class>> | ||
{ | ||
std::size_t operator()(const state_wrapper<state_class> & arg) const; | ||
}; | ||
|
||
template <class action_class> | ||
struct hasher<action_wrapper<action_class>> | ||
{ | ||
std::size_t operator()(const action_wrapper<action_class> & arg) const; | ||
}; | ||
|
||
template <class action_class, | ||
typename value_type> | ||
struct hasher<std::unordered_map<action_class,value_type>> | ||
{ | ||
std::size_t operator()(const std::unordered_map<action_class,value_type> &arg) const; | ||
}; | ||
|
||
template <class action_class, | ||
typename value_type> | ||
struct hasher<std::unordered_map<action_wrapper<action_class>,value_type>> | ||
{ | ||
std::size_t operator()(const std::unordered_map<action_wrapper<action_class>, | ||
value_type> &arg) const; | ||
}; | ||
|
||
|
||
/// TODO: implement those methods above | ||
|
||
#endif |