framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions
framework Namespace Reference

Framework namespace. More...

Namespaces

 protocol_buffers
 Protocol buffers namespace.
 
 serializable
 Serializable namespace.
 

Classes

struct  pack_container
 Variadic pack container. More...
 
struct  type_string
 Type string. More...
 

Typedefs

template<typename T >
using is_pack_container = typename detail::is_pack_container< T >::type
 
template<typename... Packs>
using merge_packs = typename detail::merge_packs_impl< Packs...>::type
 Merge parameter packs. More...
 
template<typename Pack , template< typename > class Matcher>
using filter_pack = typename detail::filter_pack_impl< Pack, Matcher >::type
 Parameter pack filter. More...
 
template<typename Values , template< typename > class Matcher>
using unique_filter_pack = typename detail::unique_filter_pack_impl< filter_pack< Values, Matcher >>::type
 Unique parameter pack filter. More...
 
template<typename Pack , template< typename > class Matcher, std::size_t Position = 0>
using find_pack = std::integral_constant< std::size_t, detail::find_pack_impl< Pack, Matcher, Position >::value >
 Find type. More...
 
template<typename Lhs , typename Rhs >
using value_less_than = typename detail::value_less_than_impl< Lhs, Rhs >::type
 Value less than. More...
 
template<typename Pack , template< typename, typename > class LessThan = value_less_than>
using sort_pack = typename detail::sort_pack_impl< Pack, LessThan >::type
 Sort pack. More...
 
template<typename Type , std::size_t Size>
using make_values = typename detail::make_values_impl< Type, Size >::type
 Basic case container constructor. More...
 
template<std::size_t Size>
using make_indices = typename detail::make_values_impl< std::size_t, Size >::type
 Index container constructor. More...
 
template<typename T >
using is_type_string = typename detail::is_type_string_impl< T >::type
 
template<char... Array>
using make_type_string = typename detail::make_type_string_impl< Array...>::type
 Make type string. More...
 
template<typename... Strings>
using merge_strings = typename detail::merge_strings_impl< Strings...>::type
 Merge type strings.
 

Enumerations

enum  byte_order
 Byte order alias. More...
 

Functions

template<typename T >
FRAMEWORK_ALWAYS_INLINEbswap16 (T &&in)
 Common 16-bit byte swap implementation.
 
template<typename T >
FRAMEWORK_ALWAYS_INLINEbswap32 (T &&in)
 Common 32-bit byte swap implementation.
 
template<typename T >
FRAMEWORK_ALWAYS_INLINEbswap64 (T &&in)
 Common 64-bit byte swap implementation.
 
template<typename CaseList , typename Handler , typename Index , typename... Args>
FRAMEWORK_ALWAYS_INLINE void variadic_switch_fallthrough (Handler &&handler, Index &&index, Args &&...args)
 Variadic switch (fall-through). More...
 
template<typename CaseList , typename Handler , typename Index , typename... Args>
FRAMEWORK_ALWAYS_INLINE auto variadic_switch_return (Handler &&handler, Index &&index, Args &&...args) -> decltype(handler(std::forward< Args >(args)...))
 Variadic switch (return). More...
 
template<typename T >
FRAMEWORK_ALWAYS_INLINEwswap32 (T &&in)
 Common 32-bit word swap implementation.
 
template<typename T >
FRAMEWORK_ALWAYS_INLINEwswap64 (T &&in)
 Common 64-bit word swap implementation.
 

Detailed Description

Framework namespace.

Typedef Documentation

template<typename Pack , template< typename > class Matcher>
using framework::filter_pack = typedef typename detail::filter_pack_impl <Pack, Matcher>::type

Parameter pack filter.

Constructs a pack_container of elements T of Pack satisfying

Matcher <T>::value == true

storing the result int type. For example, the following are equivalent:

using results = filter_pack <pack_container <int, float, short, double, int>, std::is_integral>;
using results = pack_container <int, short, int>;
template<typename Pack , template< typename > class Matcher, std::size_t Position = 0>
using framework::find_pack = typedef std::integral_constant <std::size_t, detail::find_pack_impl <Pack, Matcher, Position>::value>

Find type.

Obtains the index of the first element of Pack satisfying:

index >= Position && Matcher <T>::value == true

storing the result in value. If no such element exists, std::basic_string::npos is returned instead.

template<typename T >
using framework::is_pack_container = typedef typename detail::is_pack_container <T>::type

Type trait testing whether or not T is a pack_container.

template<typename T >
using framework::is_type_string = typedef typename detail::is_type_string_impl <T>::type

Type trait testing whether or not T is a type_string.

template<std::size_t Size>
using framework::make_indices = typedef typename detail::make_values_impl <std::size_t, Size>::type

Index container constructor.

Creates an index_container containing the elements [0, Size). The following are equivalent:

using result = make_indices <3>;
using result = make_values <std::size_t, 3>;
template<char... Array>
using framework::make_type_string = typedef typename detail::make_type_string_impl <Array...>::type

Make type string.

Constructs a type string from a '\0' terminated sequence of input characters, providing a reduced type string in type. The following are equivalent:

using result = make_type_string <'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '!', '\0', '\0'>;
using result = type_string <'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '!'>;
template<typename Type , std::size_t Size>
using framework::make_values = typedef typename detail::make_values_impl <Type, Size>::type

Basic case container constructor.

Creates a value_container containing the elements [0, Size). The following are equivalent:

using result = make_values <std::size_t, 3>;
using result = pack_container <
integral_constant <std::size_t, 0>,
integral_constant <std::size_t, 1>,
integral_constant <std::size_t, 2>>;
template<typename... Packs>
using framework::merge_packs = typedef typename detail::merge_packs_impl <Packs...>::type

Merge parameter packs.

Constructs a parameter pack containing all elements of the pack containers provided in Packs, in the order they appear. For example, the following are equivalent:

using results = merge_packs <pack_container <int, float>, pack_container <double>>;
using results = pack_container <int, float, double>;
Template Parameters
Packsinput pack_container types
template<typename Pack , template< typename, typename > class LessThan = value_less_than>
using framework::sort_pack = typedef typename detail::sort_pack_impl <Pack, LessThan>::type

Sort pack.

Sorts the pack using the provided less than operator.

template<typename Values , template< typename > class Matcher>
using framework::unique_filter_pack = typedef typename detail::unique_filter_pack_impl <filter_pack <Values, Matcher>>::type

Unique parameter pack filter.

Obtains the unique element T of Pack satisfying

Match <T>::value == true

storing the result in type. For example, the following are equivalent:

using result = unique_filter_pack <pack_container <short, double, int, long>, std::is_floating_point>;
using result = double;
template<typename Lhs , typename Rhs >
using framework::value_less_than = typedef typename detail::value_less_than_impl <Lhs, Rhs>::type

Value less than.

The following are equivalent:

enum{ result = value_less_than <Lhs, Rhs>::value };
enum{ result = Lhs::value < Rhs::value ? true : false };

Enumeration Type Documentation

enum framework::byte_order
strong

Byte order alias.

Provides a series of enum values that may be used in place of the preprocessor definitions above.

Function Documentation

template<typename CaseList , typename Handler , typename Index , typename... Args>
FRAMEWORK_ALWAYS_INLINE void framework::variadic_switch_fallthrough ( Handler &&  handler,
Index &&  index,
Args &&...  args 
)

Variadic switch (fall-through).

Expands a variadic case list into a switch statement in groups of FRAMEWORK_VARIADIC_SWITCH_LIMIT elements. This variant falls-through subsequent cases on success - for example, given a limit of 5 or higher, the following call to variadic_switch_fallthrough:

variadic_switch_fallthrough <make_indices <5>> (f, i);

is equivalent to the following switch statement:

switch (i)
{
case 0: f.operator() <0> ();
case 1: f.operator() <1> ();
case 2: f.operator() <2> ();
case 3: f.operator() <3> ();
case 4: f.operator() <4> ();
break;
default: f();
}
Template Parameters
CaseListswitch case list
Handlerhandler functor type
Argsargument types
Parameters
indexswitch statement index
handlerhandler functor
argsfunctor arguments
template<typename CaseList , typename Handler , typename Index , typename... Args>
FRAMEWORK_ALWAYS_INLINE auto framework::variadic_switch_return ( Handler &&  handler,
Index &&  index,
Args &&...  args 
) -> decltype(handler(std::forward <Args> (args)...))

Variadic switch (return).

Expands a variadic case list into a switch statement in groups of FRAMEWORK_VARIADIC_SWITCH_LIMIT elements. This variant returns the result of the appropriate function call on success - for example, given a limit of 2 the following call to variadic_switch_return:

return variadic_switch_return <make_indices <5>> (f, i);

is equivalent to the following series of switch statements:

switch (i)
{
case 0: return f.operator() <0> ();
case 1: return f.operator() <1> ();
default:
switch (i)
{
case 2: return f.operator() <2> ();
case 3: return f.operator() <3> ();
default:
switch (i)
{
case 4: return f.operator <4> ();
default: return f();
}
}
}
Template Parameters
CaseListswitch case list
Handlerhandler functor type
Argsargument types
Parameters
indexswitch statement index
handlerhandler functor
argsfunctor arguments