Seastar
High performance C++ framework for concurrent servers
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Classes | Functions | Variables
Utilities

Detailed Description

Classes

class  seastar::bool_class< Tag >
 Type-safe boolean. More...
 
class  seastar::reference_wrapper< T >
 
struct  seastar::tuple_map_types< MapClass, Tuple >
 

Functions

template<typename T >
reference_wrapper< T > seastar::ref (T &object) noexcept
 Wraps reference in a reference_wrapper.
 
template<typename T >
reference_wrapper< const T > seastar::cref (const T &object) noexcept
 Wraps constant reference in a reference_wrapper.
 
template<template< typename > class FilterClass, typename... Elements>
auto seastar::tuple_filter_by_type (const std::tuple< Elements... > &t)
 
template<template< typename > class FilterClass, typename... Elements>
auto seastar::tuple_filter_by_type (std::tuple< Elements... > &&t)
 
template<typename Function , typename... Elements>
auto seastar::tuple_map (const std::tuple< Elements... > &t, Function &&f)
 
template<typename Function , typename... Elements>
auto seastar::tuple_map (std::tuple< Elements... > &&t, Function &&f)
 
template<typename Function , typename... Elements>
void seastar::tuple_for_each (const std::tuple< Elements... > &t, Function &&f)
 
template<typename Function , typename... Elements>
void seastar::tuple_for_each (std::tuple< Elements... > &t, Function &&f)
 
template<typename Function , typename... Elements>
void seastar::tuple_for_each (std::tuple< Elements... > &&t, Function &&f)
 
template<typename... Args>
auto seastar::make_visitor (Args &&... args)
 
template<typename Variant , typename... Args>
auto seastar::visit (Variant &&variant, Args &&... args)
 
template<typename... Args>
internal::castable_variant< Args... > seastar::variant_cast (std::variant< Args... > &&var)
 
template<typename... Args>
internal::castable_variant< Args... > seastar::variant_cast (const std::variant< Args... > &var)
 

Variables

static const bool_class seastar::bool_class< Tag >::yes { true }
 
static const bool_class seastar::bool_class< Tag >::no { false }
 

Class Documentation

◆ seastar::tuple_map_types

struct seastar::tuple_map_types

Function Documentation

◆ make_visitor()

template<typename... Args>
auto seastar::make_visitor ( Args &&...  args)

Creates a visitor from function objects.

Returns a visitor object comprised of the provided function objects. Can be used with std::variant or any other custom variant implementation.

Parameters
argsfunction objects each accepting one or some types stored in the variant as input

◆ tuple_filter_by_type()

template<template< typename > class FilterClass, typename... Elements>
auto seastar::tuple_filter_by_type ( const std::tuple< Elements... > &  t)

Filters elements in tuple by their type

Returns a tuple containing only those elements which type T caused expression FilterClass<T>::value to be true.

Template Parameters
FilterClassclass template having an element value set to true for elements that should be present in the result
Parameters
ttuple to filter
Returns
a tuple contaning elements which type passed the test

◆ tuple_for_each()

template<typename Function , typename... Elements>
void seastar::tuple_for_each ( const std::tuple< Elements... > &  t,
Function &&  f 
)

Iterate over all elements in tuple

Iterates over given tuple and calls the specified function for each of it elements.

Parameters
ta tuple to iterate over
ffunction to call for each tuple element

◆ tuple_map()

template<typename Function , typename... Elements>
auto seastar::tuple_map ( const std::tuple< Elements... > &  t,
Function &&  f 
)

Applies function to all elements in tuple

Applies given function to all elements in the tuple and returns a tuple of results.

Parameters
toriginal tuple
ffunction to apply
Returns
tuple of results returned by f for each element in t

◆ visit()

template<typename Variant , typename... Args>
auto seastar::visit ( Variant &&  variant,
Args &&...  args 
)
inline

Applies a static visitor comprised of supplied lambdas to a variant. Note that the lambdas should cover all the types that the variant can possibly hold.

Returns the common type of return types of all lambdas.

Template Parameters
Variantthe type of a variant
Argstypes of lambda objects
Parameters
variantthe variant object
argslambda objects each accepting one or some types stored in the variant as input
Returns