libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
Miscellaneous

Description

Other utilities.

Enumerations

enum class  tcspc::emitted_as { tcspc::emitted_as::any_allowed , tcspc::emitted_as::same_as_fed , tcspc::emitted_as::always_lvalue , tcspc::emitted_as::always_rvalue }
 Value category to check emitted events against. More...
enum class  tcspc::feed_as { tcspc::feed_as::const_lvalue , tcspc::feed_as::rvalue }
 Value category used to feed an event via tcspc::feed_input. More...

Functions

template<typename Event>
auto tcspc::from_reversed_bytes (std::array< std::uint8_t, sizeof(Event)> bytes) noexcept
 Bit-cast an array of bytes to an event after reversing the order.
template<typename T>
auto tcspc::test_bucket (std::initializer_list< T > il) -> bucket< T >
 Create an ad-hoc tcspc::bucket<T> for testing, from a list of values.
template<typename T>
auto tcspc::test_bucket (std::span< T > s) -> bucket< T >
 Create an ad-hoc tcspc::bucket<T> for testing, from a span.

Enumeration Type Documentation

◆ emitted_as

enum class tcspc::emitted_as
strong

Value category to check emitted events against.

See also
tcspc::capture_output_checker
Enumerator
any_allowed 

Require const lvalue or rvalue, or non-const rvalue.

same_as_fed 

Require the same category as the events being fed.

always_lvalue 

Require const lvalue.

always_rvalue 

Require non-const rvalue.

◆ feed_as

enum class tcspc::feed_as
strong

Value category used to feed an event via tcspc::feed_input.

Enumerator
const_lvalue 

Feed as const lvalue.

rvalue 

Feed as non-const rvalue.

Function Documentation

◆ from_reversed_bytes()

template<typename Event>
auto tcspc::from_reversed_bytes ( std::array< std::uint8_t, sizeof(Event)> bytes)
inlinenoexcept

Bit-cast an array of bytes to an event after reversing the order.

This is a helper for writing more readable unit tests for raw device events that are specified in little-endian byte order.

The given array of bytes, which should be in big-endian order, is reversed and cast to the type Event (which must be trivial).

(There is no analogous be_event because device events specified in big-endian order have not been encountered.)

Note
It is not enforced that sizeof(Event) be a power of 2 (for which endianness makes sense).
Template Parameters
Eventthe returned event type
Parameters
bytesbytes constituting the event, in big-endian order

◆ test_bucket() [1/2]

template<typename T>
auto tcspc::test_bucket ( std::initializer_list< T > il) -> bucket< T >

Create an ad-hoc tcspc::bucket<T> for testing, from a list of values.

The returned bucket does not support storage extraction.

◆ test_bucket() [2/2]

template<typename T>
auto tcspc::test_bucket ( std::span< T > s) -> bucket< T >

Create an ad-hoc tcspc::bucket<T> for testing, from a span.

The returned bucket does not support storage extraction.