state_wrapper.hpp File Reference
#include <atria/xform/state_traits.hpp>
#include <tuple>

Go to the source code of this file.

Classes

struct  no_tag
 Default tag for state_wrapper. More...
 
struct  state_wrapper< TagT, StateT, DataT >
 A decorator for the accumulator of a reduction. More...
 
struct  is_state_wrapper< StateT, DecayedT >
 Metafunction returning whether StateT is a, or reference to, a state_wrapper instantiation. More...
 
struct  is_state_wrapper< _, state_wrapper< T, S, D > >
 
struct  state_traits< state_wrapper< TagT, StateT, DataT > >
 State traits specialization for state_wrapper. More...
 

Namespaces

 atria
 C++ amazing templates and reusable implementations awesomeness.
 
 atria::xform
 Efficient and flexible C++ implementation of transducers.
 

Functions

template<typename TagT = no_tag, typename StateT , typename DataT = TagT>
auto wrap_state (StateT &&next, DataT &&data=DataT{}) -> state_wrapper< TagT, estd::decay_t< StateT >, estd::decay_t< DataT > >
 Given a tag TagT and a state next and associated data, returns a state_wrapper instance. More...
 
template<typename TagT , typename T >
auto state_wrapper_complete (TagT, T &&s) -> decltype(state_complete(state_unwrap(std::forward< T >(s))))
 Utility function for easy overloading of state_traits::complete for state wrappers with a specific tag. More...
 
template<typename TagT , typename T >
auto state_wrapper_unwrap (TagT, T &&s) -> decltype(std::get< 0 >(std::forward< T >(s)))
 Utility function for easy overloading of state_traits::unwrap for state wrappers with a specific tag. More...
 
template<typename TagT , typename T >
auto state_wrapper_unwrap_all (TagT, T &&s) -> decltype(state_unwrap_all(state_unwrap(std::forward< T >(s))))
 Utility function for easy overloading of state_traits::unwrap_all for state wrappers with a specific tag. More...
 
template<typename TagT , typename T , typename U >
auto state_wrapper_rewrap (TagT, T &&s, U &&x) -> decltype(wrap_state< TagT >( state_rewrap(state_unwrap(std::forward< T >(s)), x), state_wrapper_data(std::forward< T >(s))))
 Utility function for easy overloading of state_traits::rewrap for state wrappers with a specific tag. More...
 
template<typename TagT , typename T , typename D >
auto state_wrapper_data (TagT tag, T &&s, D &&) -> decltype(state_wrapper_data(tag, std::forward< T >(s)))
 Utility function for easy overloading of state_traits::data for state wrappers with a specific tag. More...
 
template<typename T >
auto state_wrapper_data (T &&s) -> decltype(state_wrapper_data(typename estd::decay_t< T >::tag
 
template<typename TagT , typename T >
auto state_wrapper_data (TagT, T &&s) -> decltype(std::get< 1 >(std::forward< T >(s)))
 
template<typename TagT , typename DataT >
bool state_wrapper_data_is_reduced (TagT, DataT &&)
 Utility function that returns whether the DataT associated with a state wrapper with tag TagT is reduced – i.e. More...
 
template<typename TagT , typename T >
bool state_wrapper_is_reduced (TagT tag, T &&s)
 Utility function for easy overloading of state_traits::is_reduced for state wrappers with a specific tag. More...
 
Fork me on GitHub