3.0.0
Freundlich's C++ toolkit
Classes | Typedefs | Functions
fcppt::record Namespace Reference

Classes

struct  element
 An element of a record. More...
 
struct  element< Type, Tag >>
 
struct  is_element
 Tests if a type is an fcppt::record::element. More...
 
struct  is_label
 Tests if a type is an fcppt::record::label. More...
 
struct  is_object
 Tests if a type is an fcppt::record::object. More...
 
struct  label
 A type identifying an element of a record. More...
 
struct  label< Tag >>
 
class  object
 A generic struct that identifies elements by types. More...
 
struct  object< Types >>
 

Typedefs

template<typename Records >
using all_disjoint = std::is_same< ::brigand::size< ::brigand::fold< Records, ::brigand::set<>, ::brigand::bind< fcppt::brigand::set_union, ::brigand::bind< fcppt::record::label_set, ::brigand::_element >, ::brigand::_state > > >, ::brigand::size< ::brigand::flatten< ::brigand::transform< Records, ::brigand::bind< ::brigand::as_list, ::brigand::bind< fcppt::record::label_set, ::brigand::_1 > > > > > >
 Tests if multiple records have disjoint label sets. More...
 
template<typename RecordL , typename RecordR >
using are_disjoint = std::is_same< fcppt::brigand::set_intersection< fcppt::record::label_set< RecordL >, fcppt::record::label_set< RecordR > >, ::brigand::set<> >
 Tests if two records have disjoint label sets. More...
 
template<typename Record1 , typename Record2 >
using are_equivalent = ::brigand::and_< std::is_same< fcppt::brigand::set_symmetric_difference< fcppt::record::label_set< Record1 >, fcppt::record::label_set< Record2 > >, ::brigand::set<> >, ::brigand::all< fcppt::record::label_set< Record1 >, std::is_same< ::brigand::bind< ::brigand::lookup, ::brigand::pin< fcppt::record::element_map< Record1 > >, ::brigand::_1 >, ::brigand::bind< ::brigand::lookup, ::brigand::pin< fcppt::record::element_map< Record2 > >, ::brigand::_1 > > > >
 Tests if two records have the same element maps. More...
 
template<typename RecordL , typename RecordR >
using disjoint_product = typename fcppt::record::detail::disjoint_product< RecordL, RecordR >::type
 The product of two disjoint records. More...
 
template<typename Record >
using element_map = ::brigand::fold< fcppt::record::element_vector< Record >, ::brigand::map<>, ::brigand::bind< ::brigand::insert, ::brigand::_state, ::brigand::bind< ::brigand::pair, ::brigand::bind< fcppt::record::element_to_label, ::brigand::_element >, ::brigand::bind< fcppt::record::element_to_type, ::brigand::_element > > > >
 A metafunction computing the element map of a record. More...
 
template<typename Record >
using element_tag_tuple = ::brigand::as_tuple< ::brigand::transform< fcppt::record::element_vector< Record >, ::brigand::bind< fcppt::tag, ::brigand::_1 > > >
 A metafunction returning the elements of record as a std::tuple of fcppt::tag types. More...
 
template<typename Element >
using element_to_label = typename fcppt::record::detail::element_to_label< Element >::type
 Extracts the type of an fcppt::record::element. More...
 
template<typename Element >
using element_to_type = typename fcppt::record::detail::element_to_type< std::remove_cv_t< Element > >::type
 Extracts the label of an element. More...
 
template<typename Record >
using element_vector = typename fcppt::record::detail::element_vector< Record >::type
 A metafunction returning the elements of record as an MPL vector. More...
 
template<typename Record , typename Label >
using has_label = ::brigand::has_key< fcppt::record::label_set< Record >, Label >
 Tests if a record has an fcppt::record::label. More...
 
template<typename Record >
using label_set = ::brigand::as_set< fcppt::record::detail::label_list< fcppt::record::element_vector< Record > > >
 The set of labels of a record. More...
 
template<typename Record , typename Label >
using label_value_type = fcppt::record::element_to_type< fcppt::record::detail::find_element< fcppt::record::element_vector< Record >, Label > >
 Metafunction that computes the value type of a label inside a record. More...
 
template<typename Record , typename Function >
using map_elements = fcppt::record::object< ::brigand::transform< fcppt::record::element_vector< Record >, ::brigand::bind< fcppt::record::element, ::brigand::bind< fcppt::record::element_to_label, ::brigand::_1 >, Function > > >
 Maps the elements of a vector using a metafunction. More...
 
template<typename Record , typename Function >
using map_result = fcppt::record::map_elements< Record, ::brigand::bind< fcppt::record::detail::map_result, Function, ::brigand::_1 > >
 The result of mapping a record. More...
 
template<typename... Types>
using variadic = fcppt::record::object< ::brigand::list< Types... > >
 Declares a record using a parameter pack. More...
 

Functions

template<typename Types1 , typename Types2 >
bool operator== (fcppt::record::object< Types1 > const &_record1, fcppt::record::object< Types2 > const &_record2)
 Compares two records for equality. More...
 
template<typename Types1 , typename Types2 >
bool operator!= (fcppt::record::object< Types1 > const &_record1, fcppt::record::object< Types2 > const &_record2)
 Compares two records for inequality. More...
 
template<typename Label , typename Types >
fcppt::record::label_value_type< fcppt::record::object< Types >, Label > const & get (fcppt::record::object< Types > const &_arg)
 Gets an element from a record. More...
 
template<typename Label , typename Types >
fcppt::record::label_value_type< fcppt::record::object< Types >, Label > & get (fcppt::record::object< Types > &_arg)
 Gets an element from a record. More...
 
template<typename Result , typename Function >
Result init (Function const &_function)
 Initializes a record using a function. More...
 
template<typename Label >
std::string label_name ()
 Returns the name of a label as a string. More...
 
template<typename Record , typename Function >
fcppt::record::map_result< Record, Function > map (Record &&_record, Function const &_function)
 Maps a record using a function. More...
 
template<typename Record1 , typename Record2 >
fcppt::record::disjoint_product< fcppt::type_traits::remove_cv_ref_t< Record1 >, fcppt::type_traits::remove_cv_ref_t< Record2 >> multiply_disjoint (Record1 &&_record1, Record2 &&_record2)
 Creates the disjoint product of two records. More...
 
template<typename Ch , typename Traits , typename Types >
std::basic_ostream< Ch, Traits > & operator<< (std::basic_ostream< Ch, Traits > &_stream, fcppt::record::object< Types > const &_record)
 Outputs a record to a stream. More...
 
template<typename Result , typename Arg >
Result permute (Arg &&_arg)
 Permutes one record into another. More...
 
template<typename Label , typename Types >
void set (fcppt::record::object< Types > &_arg, fcppt::record::label_value_type< fcppt::record::object< Types >, Label > const &_value)
 Sets an element in a record by copy. More...
 
template<typename Label , typename Types >
void set (fcppt::record::object< Types > &_arg, fcppt::record::label_value_type< fcppt::record::object< Types >, Label > &&_value)
 Sets an element in a record by move. More...