|
CIRCT 24.0.0git
|
Classes | |
| class | PollingBuffer |
| Shared queue/promise helper for polling-style read APIs. More... | |
| struct | has_type_deserializer |
| struct | has_type_deserializer< T, std::void_t< typename T::TypeDeserializer > > |
| class | PODTypeDeserializer |
| Default deserializer for simple 1:1 typed reads. More... | |
| struct | DeserializerSelector |
| struct | DeserializerSelector< T, std::void_t< typename T::TypeDeserializer > > |
Typedefs | |
| template<typename T> | |
| using | TypedReadOwnedCallback = std::function<bool(std::unique_ptr<T> &)> |
| Owning callback used by typed read deserializers. | |
| template<typename T> | |
| using | DeserializerFor = typename DeserializerSelector<T>::type |
| template<typename T> | |
| using | DeserializerOutputCallback = typename DeserializerFor<T>::OutputCallback |
Functions | |
| template<typename Storage, std::size_t BitOffset, std::size_t Width> | |
| constexpr Storage | readUnsignedBits (const uint8_t *bytes) |
| Read Width bits starting at BitOffset (LSB-first within bytes) and return them zero-extended in Storage. | |
| template<typename Signed, std::size_t BitOffset, std::size_t Width> | |
| constexpr Signed | readSignedBits (const uint8_t *bytes) |
| Read Width bits starting at BitOffset (LSB-first) and sign-extend into the signed integer type Signed. | |
| template<typename Storage, std::size_t BitOffset, std::size_t Width> | |
| constexpr void | writeUnsignedBits (uint8_t *bytes, Storage value) |
| Write the low Width bits of value into bytes starting at BitOffset (LSB-first). | |
| template<typename Signed, std::size_t BitOffset, std::size_t Width> | |
| constexpr void | writeSignedBits (uint8_t *bytes, Signed value) |
| Convenience overload for signed values. | |
| template<std::size_t BitOffset, std::size_t Width> | |
| constexpr void | copyBitsIn (const uint8_t *src, uint8_t *dst) |
| Copy Width bits out of src starting at BitOffset into dst packed LSB-first from bit 0. | |
| template<std::size_t BitOffset, std::size_t Width> | |
| constexpr void | copyBitsOut (uint8_t *dst, const uint8_t *src) |
| Inverse of copyBitsIn: take Width bits packed LSB-first from bit 0 of src and write them into dst starting at BitOffset. | |
| template<typename Storage> | |
| Storage | readUnsignedBitsDyn (const uint8_t *bytes, std::size_t bitOffset, std::size_t width) |
| Runtime-offset form of readUnsignedBits. | |
| template<typename Signed> | |
| Signed | readSignedBitsDyn (const uint8_t *bytes, std::size_t bitOffset, std::size_t width) |
| Runtime-offset form of readSignedBits. | |
| template<typename Storage> | |
| void | writeUnsignedBitsDyn (uint8_t *bytes, Storage value, std::size_t bitOffset, std::size_t width) |
| Runtime-offset form of writeUnsignedBits. | |
| template<typename Signed> | |
| void | writeSignedBitsDyn (uint8_t *bytes, Signed value, std::size_t bitOffset, std::size_t width) |
| Runtime-offset form of writeSignedBits. | |
| void | copyBitsInDyn (const uint8_t *src, std::size_t srcBitOffset, uint8_t *dst, std::size_t width) |
| Runtime-offset form of copyBitsIn. | |
| void | copyBitsOutDyn (uint8_t *dst, std::size_t dstBitOffset, const uint8_t *src, std::size_t width) |
| Runtime-offset form of copyBitsOut. | |
| template<typename T> | |
| const MessageData & | getMessageDataRef (const SegmentedMessageData &msg, MessageData &scratch) |
| ChannelPort::ConnectOptions | typedFunctionConnectOptions () |
| Standard ConnectOptions for typed function ports: untranslated frames so the deserializer can see raw frame boundaries. | |
| template<typename T> | |
| std::future< T > | awaitDecoded (std::future< std::unique_ptr< T > > inner) |
| Convert a std::future<std::unique_ptr<T>> (as returned by TypedReadPort::readAsync()) into a std::future<T>. | |
| void | throwNullFunction () |
| Throw the standard "null Function pointer" error used by every TypedFunction specialization. | |
| void | throwNotConnected () |
| Throw a clear "not connected" error from call() paths. | |
| void | throwAlreadyConnected () |
| Throw a clear "already connected" error from connect() paths. | |
| void | throwNullCallback () |
| Throw the standard "null Callback pointer" error used by every TypedCallback specialization. | |
| void | throwCallbackAlreadyConnected () |
| Throw a clear "already connected" error from TypedCallback connect() paths. | |
Variables | |
| template<typename T> | |
| constexpr bool | has_type_deserializer_v = has_type_deserializer<T>::value |
| using esi::detail::DeserializerFor = typename DeserializerSelector<T>::type |
Definition at line 225 of file TypedPorts.h.
| using esi::detail::DeserializerOutputCallback = typename DeserializerFor<T>::OutputCallback |
Definition at line 228 of file TypedPorts.h.
| using esi::detail::TypedReadOwnedCallback = std::function<bool(std::unique_ptr<T> &)> |
Owning callback used by typed read deserializers.
Returning false means the callee did not accept the object and wants the exact same owned value retried later.
Definition at line 139 of file TypedPorts.h.
| std::future< T > esi::detail::awaitDecoded | ( | std::future< std::unique_ptr< T > > | inner | ) |
Convert a std::future<std::unique_ptr<T>> (as returned by TypedReadPort::readAsync()) into a std::future<T>.
Uses a deferred async so .get() blocks only when the caller actually waits for the value, preserving the per-call FIFO ordering of the underlying polling buffer. A null unique_ptr from a misbehaving deserializer is reported as a runtime error rather than dereferenced.
Definition at line 998 of file TypedPorts.h.
Referenced by esi::TypedFunction< ArgT, ResultT, SkipTypeCheck >::call(), and esi::TypedFunction< void, ResultT, SkipTypeCheck >::call().
|
inlineconstexpr |
Copy Width bits out of src starting at BitOffset into dst packed LSB-first from bit 0.
Used to embed an aggregate (struct, union, or array) at an arbitrary bit position inside a parent wire buffer: the inner type already stores its bits LSB-first in dst, so the destination bits land at the same positions they'd occupy if the inner was read out at byte alignment. dst must be zero-initialised on entry (the helper only sets 1 bits) and must hold at least ceil(Width / 8) bytes.
Definition at line 124 of file BitAccess.h.
|
inline |
Runtime-offset form of copyBitsIn.
dst must be zero-initialised on entry (only 1 bits are set) and hold at least ceil(width / 8) bytes.
Definition at line 225 of file BitAccess.h.
|
inlineconstexpr |
Inverse of copyBitsIn: take Width bits packed LSB-first from bit 0 of src and write them into dst starting at BitOffset.
Other bits in the affected bytes of dst are preserved.
Definition at line 137 of file BitAccess.h.
|
inline |
Runtime-offset form of copyBitsOut.
Bits outside the written range in the affected bytes of dst are preserved.
Definition at line 236 of file BitAccess.h.
| const MessageData & esi::detail::getMessageDataRef | ( | const SegmentedMessageData & | msg, |
| MessageData & | scratch ) |
Definition at line 152 of file TypedPorts.h.
References esi::SegmentedMessageData::toMessageData().
Referenced by esi::SerialListTypeDeserializer< T >::decode(), SerialCoordOutputBatch::TypeDeserializer::decode(), and esi::detail::PODTypeDeserializer< T >::push().
|
inlineconstexpr |
Read Width bits starting at BitOffset (LSB-first) and sign-extend into the signed integer type Signed.
Signed must be at least Width bits wide.
Definition at line 62 of file BitAccess.h.
References readUnsignedBits().
|
inline |
Runtime-offset form of readSignedBits.
Definition at line 181 of file BitAccess.h.
References readUnsignedBitsDyn().
|
inlineconstexpr |
Read Width bits starting at BitOffset (LSB-first within bytes) and return them zero-extended in Storage.
Storage must be an unsigned integer type wide enough to hold Width bits.
Definition at line 43 of file BitAccess.h.
Referenced by readSignedBits().
|
inline |
Runtime-offset form of readUnsignedBits.
Definition at line 166 of file BitAccess.h.
Referenced by readSignedBitsDyn().
|
inline |
Throw a clear "already connected" error from connect() paths.
Definition at line 1024 of file TypedPorts.h.
Referenced by esi::TypedFunction< ArgT, ResultT, SkipTypeCheck >::connect(), esi::TypedFunction< ArgT, void, SkipTypeCheck >::connect(), esi::TypedFunction< void, ResultT, SkipTypeCheck >::connect(), and esi::TypedFunction< void, void, SkipTypeCheck >::connect().
|
inline |
Throw a clear "already connected" error from TypedCallback connect() paths.
Definition at line 1278 of file TypedPorts.h.
Referenced by esi::TypedCallback< ArgT, ResultT, SkipTypeCheck >::connect(), esi::TypedCallback< ArgT, void, SkipTypeCheck >::connect(), esi::TypedCallback< void, ResultT, SkipTypeCheck >::connect(), and esi::TypedCallback< void, void, SkipTypeCheck >::connect().
|
inline |
Throw a clear "not connected" error from call() paths.
Definition at line 1018 of file TypedPorts.h.
Referenced by esi::TypedFunction< ArgT, ResultT, SkipTypeCheck >::call(), esi::TypedFunction< ArgT, void, SkipTypeCheck >::call(), esi::TypedFunction< void, ResultT, SkipTypeCheck >::call(), and esi::TypedFunction< void, void, SkipTypeCheck >::call().
|
inline |
Throw the standard "null Callback pointer" error used by every TypedCallback specialization.
Definition at line 1271 of file TypedPorts.h.
Referenced by esi::TypedCallback< ArgT, ResultT, SkipTypeCheck >::connect(), esi::TypedCallback< ArgT, void, SkipTypeCheck >::connect(), esi::TypedCallback< void, ResultT, SkipTypeCheck >::connect(), and esi::TypedCallback< void, void, SkipTypeCheck >::connect().
|
inline |
Throw the standard "null Function pointer" error used by every TypedFunction specialization.
Definition at line 1012 of file TypedPorts.h.
Referenced by esi::TypedFunction< ArgT, ResultT, SkipTypeCheck >::connect(), esi::TypedFunction< ArgT, void, SkipTypeCheck >::connect(), esi::TypedFunction< void, ResultT, SkipTypeCheck >::connect(), and esi::TypedFunction< void, void, SkipTypeCheck >::connect().
|
inline |
Standard ConnectOptions for typed function ports: untranslated frames so the deserializer can see raw frame boundaries.
Definition at line 986 of file TypedPorts.h.
Referenced by esi::TypedCallback< ArgT, ResultT, SkipTypeCheck >::connect(), esi::TypedCallback< ArgT, void, SkipTypeCheck >::connect(), esi::TypedCallback< void, ResultT, SkipTypeCheck >::connect(), esi::TypedCallback< void, void, SkipTypeCheck >::connect(), esi::TypedFunction< ArgT, ResultT, SkipTypeCheck >::connect(), esi::TypedFunction< ArgT, void, SkipTypeCheck >::connect(), esi::TypedFunction< void, ResultT, SkipTypeCheck >::connect(), and esi::TypedFunction< void, void, SkipTypeCheck >::connect().
|
inlineconstexpr |
Convenience overload for signed values.
Reinterprets the value as unsigned (two's complement) and writes the low Width bits.
Definition at line 104 of file BitAccess.h.
References writeUnsignedBits().
|
inline |
Runtime-offset form of writeSignedBits.
Definition at line 214 of file BitAccess.h.
References writeUnsignedBitsDyn().
|
inlineconstexpr |
Write the low Width bits of value into bytes starting at BitOffset (LSB-first).
Other bits in the affected bytes are preserved.
Definition at line 84 of file BitAccess.h.
Referenced by writeSignedBits().
|
inline |
Runtime-offset form of writeUnsignedBits.
Definition at line 197 of file BitAccess.h.
Referenced by writeSignedBitsDyn().
|
inlineconstexpr |
Definition at line 149 of file TypedPorts.h.
Referenced by esi::TypedReadPort< T, SkipTypeCheck >::emplaceDeserializer(), and esi::TypedReadPort< T, SkipTypeCheck >::prepareConnect().