WPILibC++ 2024.3.2
Signal.h File Reference
#include <atomic>
#include <functional>
#include <memory>
#include <type_traits>
#include <utility>
#include "wpi/mutex.h"

Go to the source code of this file.

Classes

struct  wpi::sig::trait::typelist<... >
 represent a list of types More...
 
struct  wpi::sig::trait::detail::voider<... >
 
struct  wpi::sig::trait::detail::is_callable< typename, typename, typename, typename >
 
struct  wpi::sig::trait::detail::is_callable< F, P, typelist< T... >, void_t< decltype(((*std::declval< P >()).*std::declval< F >())(std::declval< T >()...))> >
 
struct  wpi::sig::trait::detail::is_callable< F, typelist< T... >, void_t< decltype(std::declval< F >()(std::declval< T >()...))> >
 
struct  wpi::sig::trait::detail::is_weak_ptr< T, typename >
 
struct  wpi::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::sig::trait::detail::is_weak_ptr_compatible< T, typename >
 
struct  wpi::sig::trait::detail::is_weak_ptr_compatible< T, void_t< decltype(to_weak(std::declval< T >()))> >
 
class  wpi::sig::detail::SlotState
 
class  wpi::sig::ConnectionBlocker
 ConnectionBlocker is a RAII object that blocks a connection until destruction. More...
 
class  wpi::sig::Connection
 A Connection object allows interaction with an ongoing slot connection. More...
 
class  wpi::sig::ScopedConnection
 ScopedConnection is a RAII version of Connection It disconnects the slot from the signal upon destruction. More...
 
class  wpi::sig::detail::SlotBase< Args >
 
class  wpi::sig::detail::Slot< typename,... >
 
class  wpi::sig::detail::Slot< Func, trait::typelist< Args... > >
 
class  wpi::sig::detail::Slot< Func, trait::typelist< Connection &, Args... > >
 
class  wpi::sig::detail::Slot< Pmf, Ptr, trait::typelist< Args... > >
 
class  wpi::sig::detail::Slot< Pmf, Ptr, trait::typelist< Connection &, Args... > >
 
class  wpi::sig::detail::SlotTracked< typename, typename,... >
 
class  wpi::sig::detail::SlotTracked< Func, WeakPtr, trait::typelist< Args... > >
 
class  wpi::sig::detail::SlotPmfTracked< typename, typename,... >
 
class  wpi::sig::detail::SlotPmfTracked< Pmf, WeakPtr, trait::typelist< Args... > >
 
struct  wpi::sig::detail::NullMutex
 
class  wpi::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::sig
 
namespace  wpi::sig::trait
 
namespace  wpi::sig::trait::detail
 
namespace  wpi::sig::detail
 

Typedefs

template<class... T>
using wpi::sig::trait::detail::void_t = typename detail::voider< T... >::type
 
template<typename... T>
using wpi::sig::detail::SlotPtr = std::shared_ptr< SlotBase< T... > >
 
template<typename... T>
using wpi::sig::Signal = SignalBase< detail::NullMutex, T... >
 Specialization of SignalBase to be used in single threaded contexts. More...
 
template<typename... T>
using wpi::sig::Signal_mt = SignalBase< mutex, T... >
 Specialization of SignalBase to be used in multi-threaded contexts. More...
 
template<typename... T>
using wpi::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. More...
 

Functions

template<typename T >
std::weak_ptr< T > wpi::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. More...
 
template<typename T >
std::weak_ptr< T > wpi::sig::trait::to_weak (std::shared_ptr< T > s)
 

Variables

template<typename P >
constexpr bool wpi::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 More...
 
template<typename L , typename... T>
constexpr bool wpi::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 More...