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

Description

Event types representing a type-safe union of event types.

Variant events can be used to treat a number of event types as a single type, for example to allow buffering of a stream of more than one type of event.

The type tcspc::variant_event is a thin wrapper around std::variant. In generic code working with an unknown set of event types, the type alias tcspc::variant_or_single_event is useful to avoid the overhead of std::variant when there is only one event type.

An equivalent to std::visit for use with tcspc::variant_or_single_event is provided: tcspc::visit_variant_or_single_event().

Topics

 Visiting a variant-or-single event
 Equivalent of std::visit for tcspc::variant_or_single_event.

Classes

class  tcspc::variant_event< EventList >
 Variant event. More...

Typedefs

template<typename EventList>
using tcspc::variant_or_single_event
 Select the plain event if single, otherwise tcspc::variant_event.

Typedef Documentation

◆ variant_or_single_event

template<typename EventList>
using tcspc::variant_or_single_event
Initial value:
typename internal::variant_or_single_event_impl<
typename unique_type_list< TypeList >::type unique_type_list_t
Helper type for tcspc::unique_type_list.
Definition type_list.hpp:299

Select the plain event if single, otherwise tcspc::variant_event.

When EventList contains a single event type, resolves to that event. Otherwise resolves to tcspc::variant_event<EventList>.

See also
Visiting a variant-or-single event