ITCH 5.0 Market Data Handler 1.0.0
NASDAQ ITCH 5.0 Market Data Feed Handler
Loading...
Searching...
No Matches
Delegate.h File Reference

Implementation details for multi-signature Delegate. More...

Detailed Description

Implementation details for multi-signature Delegate.

This file contains the internal implementation mechanisms for the Delegate class. It provides:

  • Linear class hierarchy (LCH) for combining multiple callback signatures
  • Type-erased callback storage using function pointers
  • SFINAE-based compile-time signature matching
  • Invoker utilities for dispatching to the correct handler method

These are internal implementation details and should not be used directly. Use the Delegate class from Delegate.h instead.

Note
This is an implementation header - do not include directly
See also
Delegate
#include <type_traits>
#include <core/src/Utils.h>

Classes

struct  b2bits::delegate_detail::LCH< T, Args >
 Linear class hierarchy node (recursive case). More...
struct  b2bits::delegate_detail::LCH< T >
 Linear class hierarchy node (base case). More...
struct  b2bits::delegate_detail::ArgsPack< T, Args >
 Type list wrapper for function arguments. More...
struct  b2bits::delegate_detail::CallbackPtr< R, Args >
 Type-erased callback storage. More...
struct  b2bits::delegate_detail::MakePtr< R(Args...)>
 Specialization of MakePtr for function types. More...
struct  b2bits::delegate_detail::Callbacks< Args >
 Metafunction to create callbacks hierarchy from signatures. More...
struct  b2bits::delegate_detail::Invoker
 Invoker utility for dispatching calls to handler objects. More...
struct  b2bits::delegate_detail::ForEach< Callbacks >
 Recursively assign handler to all callbacks in hierarchy. More...
struct  b2bits::delegate_detail::ForEach< void >
 ForEach specialization for base case (void parent). More...
struct  b2bits::delegate_detail::Delete
 Sentinel type for handler destruction. More...

Namespaces

namespace  b2bits
namespace  b2bits::delegate_detail

Functions

template<class Callbacks, class Decl>
constexpr bool b2bits::delegate_detail::is_invocable ()
 Check if callbacks hierarchy supports a specific signature (compile-time).
template<class Decl, class Callbacks>
std::enable_if< is_invocable< Callbacks, Decl >(), bool >::type b2bits::delegate_detail::is_assigned (const Callbacks &cbs)
 Check if a callback is assigned for a specific signature (runtime).
template<class Decl, class Callbacks>
std::enable_if< is_invocable< Callbacks, Decl >(), void >::type b2bits::delegate_detail::clear (Callbacks &cbs)
 Clear (nullify) a callback for a specific signature.

Class Documentation

◆ b2bits::delegate_detail::ArgsPack

struct b2bits::delegate_detail::ArgsPack
template<typename T, typename... Args>
struct b2bits::delegate_detail::ArgsPack< T, Args >

Type list wrapper for function arguments.

Wraps a list of argument types for passing to template metaprogramming utilities. Used to carry function signature information through the type system.

Template Parameters
TFirst argument type
ArgsRemaining argument types

◆ b2bits::delegate_detail::MakePtr< R(Args...)>

struct b2bits::delegate_detail::MakePtr< R(Args...)>
template<class R, class... Args>
struct b2bits::delegate_detail::MakePtr< R(Args...)>

Specialization of MakePtr for function types.

Extracts return type and arguments from function signature and creates a CallbackPtr with void* prepended to arguments.

Template Parameters
RReturn type
ArgsArgument types
Class Members
typedef CallbackPtr< R, void *, Args... > type CallbackPtr<R, void*, Args...> CallbackPtr with void* prepended.

◆ b2bits::delegate_detail::Callbacks

struct b2bits::delegate_detail::Callbacks
template<class... Args>
struct b2bits::delegate_detail::Callbacks< Args >

Metafunction to create callbacks hierarchy from signatures.

Takes multiple function signatures and creates a linear class hierarchy (LCH) of CallbackPtr types, one for each signature.

Template Parameters
ArgsFunction signatures (e.g., void(int), void(string))
Class Members
typedef type... > type LCH<typename MakePtr<Args>::type...> LCH of all callbacks.

◆ b2bits::delegate_detail::Delete

struct b2bits::delegate_detail::Delete

Sentinel type for handler destruction.

Special empty type used as a signature for the destructor callback. The delegate uses void(Delete) as a signature to store a function that destroys the handler object.