WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::util::detail Namespace Reference

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

Classes

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

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.
using SmallVectorType = wpi::util::SmallVectorImpl<uint8_t>
using StdVectorType = std::vector<uint8_t>
template<typename RangeT>
using IterOfRange = decltype(adl_begin(std::declval<RangeT &>()))
template<typename RangeT>
using ValueOfRange
template<typename T>
using EnableIfTrivial
template<typename CallableT, typename ThisT>
using EnableUnlessSameType
template<typename CallableT, typename Ret, typename... Params>
using EnableIfCallable

Functions

void swap (SafeThreadOwnerBase &lhs, SafeThreadOwnerBase &rhs)
template<typename T>
bool isPresent (const T &t)
template<typename T>
decltype(auto) unwrapValue (T &t)
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)
template<Validatable T>
constexpr bool ValidateType (pb_type_t type)
constexpr double ceil_int (double x, double x_whole) noexcept
constexpr double ceil (double x) noexcept
unsigned combineHashValue (unsigned a, unsigned b)
 Simplistic combination of 32-bit hash values into 32-bit hash values.

Variables

template<typename CallableT, typename CalledAsT, typename Enable>
UniqueFunctionBase< R, P... >::NonTrivialCallbacks UniqueFunctionBase< R, P... >::CallbacksHolder< CallableT, CalledAsT, Enable >::Callbacks
template<typename CallableT, typename CalledAsT>
UniqueFunctionBase< R, P... >::TrivialCallback UniqueFunctionBase< R, P... >::CallbacksHolder< CallableT, CalledAsT, EnableIfTrivial< CallableT > >::Callbacks

Detailed Description

These are wrappers over isa* function that allow them to be used in generic algorithms such as wpi::util:all_of, wpi::util::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::util::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::util::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::util::detail::EnableUnlessSameType
Initial value:
std::enable_if_t<!std::is_same<remove_cvref_t<CallableT>, ThisT>::value>

◆ IterOfRange

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

◆ SelfType

template<typename OptionalDerived, typename Default>
using wpi::util::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::util::detail::StdVectorType = std::vector<uint8_t>

◆ ValueOfRange

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

Function Documentation

◆ ceil()

double wpi::util::detail::ceil ( double x)
constexprnoexcept

◆ ceil_int()

double wpi::util::detail::ceil_int ( double x,
double x_whole )
constexprnoexcept

◆ combineHashValue()

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

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

◆ ForEachProtobufDescriptor()

void wpi::util::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 )

◆ GetTypeString()

std::string wpi::util::detail::GetTypeString ( const pb_msgdesc_t * msg)

◆ isPresent()

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

◆ swap()

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

◆ unwrapValue()

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

◆ ValidateType()

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

◆ WriteFromSmallVector()

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

◆ WriteFromStdVector()

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

◆ WriteSubmessage()

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

Variable Documentation

◆ UniqueFunctionBase< R, P... >::CallbacksHolder< CallableT, CalledAsT, Enable >::Callbacks

template<typename CallableT, typename CalledAsT, typename Enable>
UniqueFunctionBase<R,P...>::NonTrivialCallbacks wpi::util::detail::UniqueFunctionBase< R, P... >::CallbacksHolder< CallableT, CalledAsT, Enable >::Callbacks
Initial value:
= {
&CallImpl<CalledAsT>, &MoveImpl<CallableT>, &DestroyImpl<CallableT>}

◆ UniqueFunctionBase< R, P... >::CallbacksHolder< CallableT, CalledAsT, EnableIfTrivial< CallableT > >::Callbacks

template<typename CallableT, typename CalledAsT>
UniqueFunctionBase<R,P...>::TrivialCallback wpi::util::detail::UniqueFunctionBase< R, P... >::CallbacksHolder< CallableT, CalledAsT, EnableIfTrivial< CallableT > >::Callbacks
Initial value:
{
&CallImpl<CalledAsT>}