Audacity 3.2.0
Classes | Namespaces | Typedefs | Functions | Variables
TypeSwitch.h File Reference

Dispatch to one of a set of functions by the run-time type of an object. More...

#include "Callable.h"
#include "Tuple.h"
#include "TypeList.h"
#include <cassert>
Include dependency graph for TypeSwitch.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >
 Metafunction implementing TypeSwitch. More...
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::NoOp
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::NoOp::type
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::Transparent
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::Transparent::type
 No BaseClass of ArgumentType is acceptable to the first function. More...
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::CombineOp< BaseClass, NextBase >
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::CombineOp< BaseClass, NextBase >::Opaque
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::CombineOp< BaseClass, NextBase >::Wrapper
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::CombineOp< BaseClass, NextBase >::Dummy
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::CombineOp< BaseClass, NextBase >::Case1_
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::CombineOp< BaseClass, NextBase >::Case2
 
struct  TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::CombineOp< BaseClass, NextBase >::Default
 
struct  TypeSwitch::detail::Invoker< R, Exec, ObjectTypes >
 
struct  TypeSwitch::detail::Invoker< R, Exec, ObjectTypes >::Base
 
struct  TypeSwitch::detail::Invoker< R, Exec, ObjectTypes >::Op< ObjectType, Recur >
 
struct  TypeSwitch::detail::UsedCases< Executors >
 
struct  TypeSwitch::detail::TypeSwitcher< R, ObjectTypes, Functions, Args >
 

Namespaces

namespace  TypeSwitch
 
namespace  TypeSwitch::detail
 

Typedefs

template<typename... Functions>
using TypeSwitch::detail::FunctionTupleType = std::tuple< const Functions &... >
 
template<typename Functions >
using TypeSwitch::detail::FunctionTuple = Apply_t< FunctionTupleType, Functions >
 
template<typename R , typename ArgumentTypes , typename Functions , typename... Args>
using TypeSwitch::detail::Executor_t = typename Executor< R, ArgumentTypes, Functions, Args... >::type
 Synthesize a function appropriate for ArgumentType. More...
 
template<typename TypeList >
using TypeSwitch::detail::InheritanceCheck = NotAny< Bind2nd< std::is_base_of, Head_t< TypeList > >, Tail_t< TypeList > >
 

Functions

template<size_t... Is, typename TupleLike >
auto TypeSwitch::detail::MakeFunctionTuple (std::index_sequence< Is... >, const TupleLike &functions)
 
template<typename R = void, typename Types , class TupleLike , typename... Args>
auto TypeSwitch::Dispatch (Head_t< Types > &object, const TupleLike &functions, Args &&... args) -> std::enable_if_t< TypeListCheck_v< Types >, R >
 
template<typename R = void, typename Types , typename ... Functions>
auto TypeSwitch::VDispatch (Head_t< Types > &object, const Functions &...functions)
 

Variables

template<typename TypeList >
constexpr bool TypeSwitch::detail::RootTypeCheck_v
 
template<typename TypeList >
constexpr bool TypeSwitch::TypeListCheck_v
 

Detailed Description

Dispatch to one of a set of functions by the run-time type of an object.


Audacity: A Digital Audio Editor

Paul Licameli

Definition in file TypeSwitch.h.