WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
wpi::detail Namespace Reference

These are wrappers over isa* function that allow them to be used in generic algorithms such as wpi:all_of, wpi::none_of, etc. More...

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  IsaAndPresentCheckPredicate
 
struct  IsaCheckPredicate
 
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
 

Concepts

concept  Validatable
 

Typedefs

template<typename OptionalDerived , typename Default >
using SelfType
 A helper to derive the type to use with Self for cast traits, when the provided CRTP derived type is allowed to be void.
 
template<typename T >
using EnableIfTrivial
 
template<typename CallableT , typename ThisT >
using EnableUnlessSameType
 
template<typename CallableT , typename Ret , typename... Params>
using EnableIfCallable
 
template<typename RangeT >
using IterOfRange = decltype(adl_begin(std::declval<RangeT &>()))
 
template<typename RangeT >
using ValueOfRange
 
using SmallVectorType = wpi::SmallVectorImpl<uint8_t>
 
using StdVectorType = std::vector<uint8_t>
 

Functions

template<Validatable T>
constexpr bool ValidateType (pb_type_t type)
 
template<typename T >
bool isPresent (const T &t)
 
template<typename T >
decltype(auto) unwrapValue (T &t)
 
unsigned combineHashValue (unsigned a, unsigned b)
 Simplistic combination of 32-bit hash values into 32-bit hash values.
 
void swap (SafeThreadOwnerBase &lhs, SafeThreadOwnerBase &rhs)
 
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)
 
bool WriteFromSmallVector (pb_ostream_t *stream, const pb_byte_t *buf, size_t count)
 
bool WriteFromStdVector (pb_ostream_t *stream, const pb_byte_t *buf, size_t count)
 
bool WriteSubmessage (pb_ostream_t *stream, const pb_msgdesc_t *desc, const void *msg)
 
std::string GetTypeString (const pb_msgdesc_t *msg)
 
void ForEachProtobufDescriptor (const pb_msgdesc_t *msg, function_ref< bool(std::string_view filename)> wants, function_ref< void(std::string_view filename, std::span< const uint8_t > descriptor)> fn)
 
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
 

Detailed Description

These are wrappers over isa* function that allow them to be used in generic algorithms such as wpi:all_of, wpi::none_of, etc.

This is accomplished by exposing the isa* functions through function objects with a generic function call operator.

Typedef Documentation

◆ EnableIfCallable

template<typename CallableT , typename Ret , typename... Params>
using wpi::detail::EnableIfCallable
Initial value:
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
Initial value:
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
Initial value:
std::enable_if_t<!std::is_same<remove_cvref_t<CallableT>, ThisT>::value>

◆ IterOfRange

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

◆ SelfType

template<typename OptionalDerived , typename Default >
using wpi::detail::SelfType
Initial value:
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.

◆ SmallVectorType

◆ StdVectorType

using wpi::detail::StdVectorType = std::vector<uint8_t>

◆ ValueOfRange

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

Function Documentation

◆ combineHashValue()

unsigned wpi::detail::combineHashValue ( unsigned a,
unsigned b )
inline

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

◆ ForEachProtobufDescriptor()

void wpi::detail::ForEachProtobufDescriptor ( const pb_msgdesc_t * 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 pb_msgdesc_t * msg)

◆ isPresent()

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

◆ 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 )

◆ swap()

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

◆ unwrapValue()

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

◆ ValidateType()

template<Validatable T>
bool wpi::detail::ValidateType ( pb_type_t type)
constexpr

◆ WriteFromSmallVector()

bool wpi::detail::WriteFromSmallVector ( pb_ostream_t * stream,
const pb_byte_t * buf,
size_t count )

◆ WriteFromStdVector()

bool wpi::detail::WriteFromStdVector ( pb_ostream_t * stream,
const pb_byte_t * buf,
size_t count )

◆ WriteSubmessage()

bool wpi::detail::WriteSubmessage ( pb_ostream_t * stream,
const pb_msgdesc_t * desc,
const void * msg )