ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Utilities

Detailed Description

Auxiliary functions and classes used throughout ACTS.

Classes

class  Acts::AnyBase< SbSize, Copyable, Base >
 Small opaque type-erased type with configurable small buffer optimization. More...
class  Acts::AnyBaseAll
 Base class for all instances of AnyBase regarfless of SBO size. More...

Typedefs

using Acts::Any = AnyBase<sizeof(void*), true>
 A type-safe container for single values of any type.
using Acts::AnyMoveOnly = AnyBase<sizeof(void*), false>
 Move-only variant that can store move-only types (e.g.
template<typename Base, std::size_t SbSize = sizeof(void*)>
using Acts::AnyOf = AnyBase<SbSize, true, Base>
 Typed type-erased value over a common polymorphic base.

Typedef Documentation

◆ Any

using Acts::Any = AnyBase<sizeof(void*), true>

A type-safe container for single values of any type.

This is a custom implementation similar to std::any but optimized for small types that can fit into a pointer-sized buffer. Values larger than a pointer are stored on the heap.

◆ AnyMoveOnly

using Acts::AnyMoveOnly = AnyBase<sizeof(void*), false>

Move-only variant that can store move-only types (e.g.

std::unique_ptr)

Same as Any but copy constructor and copy assignment are deleted. Use when storing types that are not copyable.

◆ AnyOf

template<typename Base, std::size_t SbSize = sizeof(void*)>
using Acts::AnyOf = AnyBase<SbSize, true, Base>

Typed type-erased value over a common polymorphic base.

Stores any value of a type T convertible to Base* (i.e. publicly and unambiguously derived from Base) and hands it back as Base& / Base* through AnyBase::asBase, AnyBase::operator* and AnyBase::operator-> without naming T. The concrete type can still be recovered with AnyBase::as / AnyBase::asPtr. Copyable; values up to SbSize bytes are stored inline, larger ones on the heap.

Template Parameters
BaseCommon base class exposed by the accessors
SbSizeSize of the small-buffer-optimization storage