WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
Signal.h File Reference
#include <atomic>
#include <functional>
#include <memory>
#include <type_traits>
#include <utility>
#include "wpi/util/mutex.hpp"

Go to the source code of this file.

Classes

struct  wpi::util::sig::trait::typelist<... >
 represent a list of types More...
struct  wpi::util::sig::trait::detail::voider<... >
struct  wpi::util::sig::trait::detail::is_callable< typename, typename, typename, typename >
struct  wpi::util::sig::trait::detail::is_callable< F, P, typelist< T... >, void_t< decltype(((*std::declval< P >()).*std::declval< F >())(std::declval< T >()...))> >
struct  wpi::util::sig::trait::detail::is_callable< F, typelist< T... >, void_t< decltype(std::declval< F >()(std::declval< T >()...))> >
struct  wpi::util::sig::trait::detail::is_weak_ptr< T, typename >
struct  wpi::util::sig::trait::detail::is_weak_ptr< T, void_t< decltype(std::declval< T >().expired()), decltype(std::declval< T >().lock()), decltype(std::declval< T >().reset())> >
struct  wpi::util::sig::trait::detail::is_weak_ptr_compatible< T, typename >
struct  wpi::util::sig::trait::detail::is_weak_ptr_compatible< T, void_t< decltype(to_weak(std::declval< T >()))> >
class  wpi::util::sig::detail::SlotState
class  wpi::util::sig::ConnectionBlocker
 ConnectionBlocker is a RAII object that blocks a connection until destruction. More...
class  wpi::util::sig::Connection
 A Connection object allows interaction with an ongoing slot connection. More...
class  wpi::util::sig::ScopedConnection
 ScopedConnection is a RAII version of Connection It disconnects the slot from the signal upon destruction. More...
class  wpi::util::sig::detail::SlotBase< Args >
class  wpi::util::sig::detail::Slot< typename,... >
class  wpi::util::sig::detail::Slot< Func, trait::typelist< Args... > >
class  wpi::util::sig::detail::Slot< Func, trait::typelist< Connection &, Args... > >
class  wpi::util::sig::detail::Slot< Pmf, Ptr, trait::typelist< Args... > >
class  wpi::util::sig::detail::Slot< Pmf, Ptr, trait::typelist< Connection &, Args... > >
class  wpi::util::sig::detail::SlotTracked< typename, typename,... >
class  wpi::util::sig::detail::SlotTracked< Func, WeakPtr, trait::typelist< Args... > >
class  wpi::util::sig::detail::SlotPmfTracked< typename, typename,... >
class  wpi::util::sig::detail::SlotPmfTracked< Pmf, WeakPtr, trait::typelist< Args... > >
struct  wpi::util::sig::detail::NullMutex
class  wpi::util::sig::SignalBase< Lockable, T >
 SignalBase is an implementation of the observer pattern, through the use of an emitting object and slots that are connected to the signal and called with supplied arguments when a signal is emitted. More...

Namespaces

namespace  wpi
namespace  wpi::util
namespace  wpi::util::sig
namespace  wpi::util::sig::trait
namespace  wpi::util::sig::trait::detail
namespace  wpi::util::sig::detail

Typedefs

template<class... T>
using wpi::util::sig::trait::detail::void_t = typename detail::voider<T...>::type
template<typename... T>
using wpi::util::sig::detail::SlotPtr = std::shared_ptr<SlotBase<T...>>
template<typename... T>
using wpi::util::sig::Signal = SignalBase<detail::NullMutex, T...>
 Specialization of SignalBase to be used in single threaded contexts.
template<typename... T>
using wpi::util::sig::Signal_mt = SignalBase<mutex, T...>
 Specialization of SignalBase to be used in multi-threaded contexts.
template<typename... T>
using wpi::util::sig::Signal_r = SignalBase<recursive_mutex, T...>
 Specialization of SignalBase to be used in multi-threaded contexts, allowing for recursive signal emission and emission cycles.

Functions

template<typename T>
std::weak_ptr< T > wpi::util::sig::trait::to_weak (std::weak_ptr< T > w)
 Pointers that can be converted to a weak pointer concept for tracking purpose must implement the to_weak() function in order to make use of ADL to convert that type and make it usable.
template<typename T>
std::weak_ptr< T > wpi::util::sig::trait::to_weak (std::shared_ptr< T > s)

Variables

template<typename P>
constexpr bool wpi::util::sig::trait::is_weak_ptr_compatible_v = detail::is_weak_ptr_compatible<std::decay_t<P>>::value
 determine if a pointer is convertible into a "weak" pointer
template<typename L, typename... T>
constexpr bool wpi::util::sig::trait::is_callable_v = detail::is_callable<T..., L>::value
 determine if a type T (Callable or Pmf) is callable with supplied arguments in L