WPILibC++ 2024.1.1-beta-4
wpi::detail Namespace Reference

Classes

class  AllocatorHolder
 
class  AllocatorHolder< Alloc & >
 
struct  ConstantLog2
 A tiny meta function to compute the log2 of a compile time constant. More...
 
struct  ConstantLog2< 1 >
 
struct  DenseMapPair
 
struct  FutureThen
 
struct  FutureThen< To, void >
 
struct  FutureThen< void, From >
 
struct  FutureThen< void, void >
 
struct  HasPointerLikeTypeTraits
 
struct  HasPointerLikeTypeTraits< T, decltype((sizeof(PointerLikeTypeTraits< T >)+sizeof(T)), void())>
 
struct  IsPointerLike
 
struct  IsPointerLike< T * >
 
class  PromiseFactoryBase
 
struct  PunnedPointer
 
class  SafeThreadOwnerBase
 Non-template owner base class for common owner code. More...
 
class  SafeThreadProxy
 A proxy for SafeThread. More...
 
class  SafeThreadProxyBase
 Non-template proxy base class for common proxy code. More...
 
union  trivial_helper
 
struct  TypesAreDistinct
 
struct  TypesAreDistinct< T >
 
class  UniqueFunctionBase
 
struct  WorkerThreadAsync
 
struct  WorkerThreadAsync< void >
 
struct  WorkerThreadRequest
 
class  WorkerThreadThread
 

Typedefs

template<typename OptionalDerived , typename Default >
using SelfType = std::conditional_t< std::is_same_v< OptionalDerived, void >, Default, OptionalDerived >
 A helper to derive the type to use with Self for cast traits, when the provided CRTP derived type is allowed to be void. More...
 
template<typename T >
using EnableIfTrivial = std::enable_if_t< std::is_trivially_move_constructible< T >::value &&std::is_trivially_destructible< T >::value >
 
template<typename CallableT , typename ThisT >
using EnableUnlessSameType = std::enable_if_t<!std::is_same< remove_cvref_t< CallableT >, ThisT >::value >
 
template<typename CallableT , typename Ret , typename... Params>
using EnableIfCallable = std::enable_if_t< std::disjunction< std::is_void< Ret >, std::is_same< decltype(std::declval< CallableT >()(std::declval< Params >()...)), Ret >, std::is_same< const decltype(std::declval< CallableT >()(std::declval< Params >()...)), Ret >, std::is_convertible< decltype(std::declval< CallableT >()(std::declval< Params >()...)), Ret > >::value >
 
template<typename RangeT >
using IterOfRange = decltype(adl_begin(std::declval< RangeT & >()))
 
template<typename RangeT >
using ValueOfRange = std::remove_reference_t< decltype(*adl_begin(std::declval< RangeT & >()))>
 

Functions

template<typename R , typename... T>
void RunWorkerThreadRequest (WorkerThreadThread< R, T... > &thr, WorkerThreadRequest< R, T... > &req)
 
template<typename... T>
void RunWorkerThreadRequest (WorkerThreadThread< void, T... > &thr, WorkerThreadRequest< void, T... > &req)
 
void DeleteProtobuf (google::protobuf::Message *msg)
 
bool ParseProtobuf (google::protobuf::Message *msg, std::span< const uint8_t > data)
 
bool SerializeProtobuf (wpi::SmallVectorImpl< uint8_t > &out, const google::protobuf::Message &msg)
 
bool SerializeProtobuf (std::vector< uint8_t > &out, const google::protobuf::Message &msg)
 
std::string GetTypeString (const google::protobuf::Message &msg)
 
void ForEachProtobufDescriptor (const google::protobuf::Message &msg, function_ref< bool(std::string_view filename)> wants, function_ref< void(std::string_view filename, std::span< const uint8_t > descriptor)> fn)
 
void swap (SafeThreadOwnerBase &lhs, SafeThreadOwnerBase &rhs) noexcept
 
static unsigned combineHashValue (unsigned a, unsigned b)
 Simplistic combination of 32-bit hash values into 32-bit hash values. More...
 
template<typename T >
bool isPresent (const T &t)
 
template<typename T >
decltype(auto) unwrapValue (T &t)
 
bool GetAsUnsignedInteger (std::string_view str, unsigned radix, unsigned long long &result) noexcept
 
bool GetAsSignedInteger (std::string_view str, unsigned radix, long long &result) noexcept
 
bool ConsumeUnsignedInteger (std::string_view &str, unsigned radix, unsigned long long &result) noexcept
 
bool ConsumeSignedInteger (std::string_view &str, unsigned radix, long long &result) noexcept
 

Typedef Documentation

◆ EnableIfCallable

template<typename CallableT , typename Ret , typename... Params>
using wpi::detail::EnableIfCallable = typedef std::enable_if_t<std::disjunction< std::is_void<Ret>, std::is_same<decltype(std::declval<CallableT>()(std::declval<Params>()...)), Ret>, std::is_same<const decltype(std::declval<CallableT>()( std::declval<Params>()...)), Ret>, std::is_convertible<decltype(std::declval<CallableT>()( std::declval<Params>()...)), Ret> >::value>

◆ EnableIfTrivial

template<typename T >
using wpi::detail::EnableIfTrivial = typedef std::enable_if_t<std::is_trivially_move_constructible<T>::value && std::is_trivially_destructible<T>::value>

◆ EnableUnlessSameType

template<typename CallableT , typename ThisT >
using wpi::detail::EnableUnlessSameType = typedef std::enable_if_t<!std::is_same<remove_cvref_t<CallableT>, ThisT>::value>

◆ IterOfRange

template<typename RangeT >
using wpi::detail::IterOfRange = typedef decltype(adl_begin(std::declval<RangeT &>()))

◆ SelfType

template<typename OptionalDerived , typename Default >
using wpi::detail::SelfType = typedef std::conditional_t<std::is_same_v<OptionalDerived, void>, Default, OptionalDerived>

A helper to derive the type to use with Self for cast traits, when the provided CRTP derived type is allowed to be void.

◆ ValueOfRange

template<typename RangeT >
using wpi::detail::ValueOfRange = typedef std::remove_reference_t<decltype(*adl_begin(std::declval<RangeT &>()))>

Function Documentation

◆ combineHashValue()

static unsigned wpi::detail::combineHashValue ( unsigned  a,
unsigned  b 
)
inlinestatic

Simplistic combination of 32-bit hash values into 32-bit hash values.

◆ ConsumeSignedInteger()

bool wpi::detail::ConsumeSignedInteger ( std::string_view str,
unsigned  radix,
long long &  result 
)
noexcept

◆ ConsumeUnsignedInteger()

bool wpi::detail::ConsumeUnsignedInteger ( std::string_view str,
unsigned  radix,
unsigned long long &  result 
)
noexcept

◆ DeleteProtobuf()

void wpi::detail::DeleteProtobuf ( google::protobuf::Message *  msg)

◆ ForEachProtobufDescriptor()

void wpi::detail::ForEachProtobufDescriptor ( const google::protobuf::Message &  msg,
function_ref< bool(std::string_view filename)>  wants,
function_ref< void(std::string_view filename, std::span< const uint8_t > descriptor)>  fn 
)

◆ GetAsSignedInteger()

bool wpi::detail::GetAsSignedInteger ( std::string_view  str,
unsigned  radix,
long long &  result 
)
noexcept

◆ GetAsUnsignedInteger()

bool wpi::detail::GetAsUnsignedInteger ( std::string_view  str,
unsigned  radix,
unsigned long long &  result 
)
noexcept

◆ GetTypeString()

std::string wpi::detail::GetTypeString ( const google::protobuf::Message &  msg)

◆ isPresent()

template<typename T >
bool wpi::detail::isPresent ( const T &  t)
inline

◆ ParseProtobuf()

bool wpi::detail::ParseProtobuf ( google::protobuf::Message *  msg,
std::span< const uint8_t >  data 
)

◆ RunWorkerThreadRequest() [1/2]

template<typename R , typename... T>
void wpi::detail::RunWorkerThreadRequest ( WorkerThreadThread< R, T... > &  thr,
WorkerThreadRequest< R, T... > &  req 
)

◆ RunWorkerThreadRequest() [2/2]

template<typename... T>
void wpi::detail::RunWorkerThreadRequest ( WorkerThreadThread< void, T... > &  thr,
WorkerThreadRequest< void, T... > &  req 
)

◆ SerializeProtobuf() [1/2]

bool wpi::detail::SerializeProtobuf ( std::vector< uint8_t > &  out,
const google::protobuf::Message &  msg 
)

◆ SerializeProtobuf() [2/2]

bool wpi::detail::SerializeProtobuf ( wpi::SmallVectorImpl< uint8_t > &  out,
const google::protobuf::Message &  msg 
)

◆ swap()

void wpi::detail::swap ( SafeThreadOwnerBase lhs,
SafeThreadOwnerBase rhs 
)
noexcept

◆ unwrapValue()

template<typename T >
decltype(auto) wpi::detail::unwrapValue ( T &  t)
inline