Project
Loading...
Searching...
No Matches
o2::header::Descriptor< N > Struct Template Reference

#include <DataHeader.h>

Public Types

using self_type = Descriptor< N >
 
using ItgType = typename internal::TraitsIntType< N >::Type
 
using ImplicitConversion = std::conditional_t<(size<=8), ItgType, std::string_view >
 

Public Member Functions

constexpr Descriptor ()
 
constexpr Descriptor (ItgType initializer)
 
constexpr Descriptor (const Descriptor &other)=default
 
Descriptor & operator= (const Descriptor &other)=default
 
 operator ImplicitConversion () const
 
template<std::size_t L>
constexpr Descriptor (const char(&in)[L])
 constructor from a compile-time string
 
void runtimeInit (std::string_view string)
 
void runtimeInit (const char *string)
 compatibility version for null-terminated strings
 
void runtimeInit (const char *buffer, size_t length)
 compatibility version for explicit length
 
bool operator== (const Descriptor &other) const
 
bool operator< (const Descriptor &other) const
 
bool operator!= (const Descriptor &other) const
 
template<typename T >
bool operator== (const T *) const =delete
 
template<typename T >
bool operator!= (const T *) const =delete
 
template<typename T >
requires (std::same_as<T, std::string>)
T as () const
 get the descriptor as std::string
 

Public Attributes

union { 
 
   char   str [N] 
 
   ItgType   itg [arraySize] 
 
};  
 

Static Public Attributes

static int constexpr size = N
 
static int constexpr bitcount = size * 8
 
static constexpr int arraySize = internal::ArraySize<uint64_t, size>()
 

Friends

bool operator== (const Descriptor &lhs, ImplicitConversion rhs)
 

Detailed Description

template<std::size_t N>
struct o2::header::Descriptor< N >

generic descriptor class faturing the union of a char and a uint element of the same size this is currently working only for up to 8 bytes aka uint64_t, the general solution is working also for multiples of 64 bit, but then the itg member needs to be an array for all. This has not been enabled yet, first the implications have to be studied.

Definition at line 206 of file DataHeader.h.

Member Typedef Documentation

◆ ImplicitConversion

template<std::size_t N>
using o2::header::Descriptor< N >::ImplicitConversion = std::conditional_t<(size <= 8), ItgType, std::string_view>

Definition at line 226 of file DataHeader.h.

◆ ItgType

template<std::size_t N>
using o2::header::Descriptor< N >::ItgType = typename internal::TraitsIntType<N>::Type

Definition at line 213 of file DataHeader.h.

◆ self_type

template<std::size_t N>
using o2::header::Descriptor< N >::self_type = Descriptor<N>

Definition at line 209 of file DataHeader.h.

Constructor & Destructor Documentation

◆ Descriptor() [1/4]

template<std::size_t N>
constexpr o2::header::Descriptor< N >::Descriptor ( )
inlineconstexpr

Definition at line 219 of file DataHeader.h.

◆ Descriptor() [2/4]

template<std::size_t N>
constexpr o2::header::Descriptor< N >::Descriptor ( ItgType  initializer)
inlineconstexpr

Definition at line 220 of file DataHeader.h.

◆ Descriptor() [3/4]

template<std::size_t N>
constexpr o2::header::Descriptor< N >::Descriptor ( const Descriptor< N > &  other)
constexprdefault

◆ Descriptor() [4/4]

template<std::size_t N>
template<std::size_t L>
constexpr o2::header::Descriptor< N >::Descriptor ( const char(&)  in[L])
inlineconstexpr

constructor from a compile-time string

Definition at line 245 of file DataHeader.h.

Member Function Documentation

◆ as()

template<std::size_t N>
template<typename T >
requires (std::same_as<T, std::string>)
T o2::header::Descriptor< N >::as ( ) const
inline

get the descriptor as std::string

Definition at line 304 of file DataHeader.h.

◆ operator ImplicitConversion()

template<std::size_t N>
o2::header::Descriptor< N >::operator ImplicitConversion ( ) const
inline

Definition at line 230 of file DataHeader.h.

◆ operator!=() [1/2]

template<std::size_t N>
bool o2::header::Descriptor< N >::operator!= ( const Descriptor< N > &  other) const
inline

Definition at line 289 of file DataHeader.h.

◆ operator!=() [2/2]

template<std::size_t N>
template<typename T >
bool o2::header::Descriptor< N >::operator!= ( const T *  ) const
delete

◆ operator<()

template<std::size_t N>
bool o2::header::Descriptor< N >::operator< ( const Descriptor< N > &  other) const
inline

Definition at line 288 of file DataHeader.h.

◆ operator=()

template<std::size_t N>
Descriptor & o2::header::Descriptor< N >::operator= ( const Descriptor< N > &  other)
default

◆ operator==() [1/2]

template<std::size_t N>
bool o2::header::Descriptor< N >::operator== ( const Descriptor< N > &  other) const
inline

Definition at line 287 of file DataHeader.h.

◆ operator==() [2/2]

template<std::size_t N>
template<typename T >
bool o2::header::Descriptor< N >::operator== ( const T *  ) const
delete

◆ runtimeInit() [1/3]

template<std::size_t N>
void o2::header::Descriptor< N >::runtimeInit ( const char *  buffer,
size_t  length 
)
inline

compatibility version for explicit length

Definition at line 282 of file DataHeader.h.

◆ runtimeInit() [2/3]

template<std::size_t N>
void o2::header::Descriptor< N >::runtimeInit ( const char *  string)
inline

compatibility version for null-terminated strings

Definition at line 276 of file DataHeader.h.

◆ runtimeInit() [3/3]

template<std::size_t N>
void o2::header::Descriptor< N >::runtimeInit ( std::string_view  string)
inline

Init descriptor from string at runtime In contrast to all other functions which are fixed at compile time, this is available at runtime and must be used with care

Note: no assignment operator operator=(const char*) as this potentially runs into trouble with this general pointer type.

Definition at line 260 of file DataHeader.h.

Friends And Related Symbol Documentation

◆ operator==

template<std::size_t N>
bool operator== ( const Descriptor< N > &  lhs,
ImplicitConversion  rhs 
)
friend

Definition at line 292 of file DataHeader.h.

Member Data Documentation

◆ [union]

union { ... } o2::header::Descriptor< N >

◆ arraySize

template<std::size_t N>
constexpr int o2::header::Descriptor< N >::arraySize = internal::ArraySize<uint64_t, size>()
staticconstexpr

Definition at line 212 of file DataHeader.h.

◆ bitcount

template<std::size_t N>
int constexpr o2::header::Descriptor< N >::bitcount = size * 8
staticconstexpr

Definition at line 211 of file DataHeader.h.

◆ itg

template<std::size_t N>
ItgType o2::header::Descriptor< N >::itg[arraySize]

Definition at line 217 of file DataHeader.h.

◆ size

template<std::size_t N>
int constexpr o2::header::Descriptor< N >::size = N
staticconstexpr

Definition at line 210 of file DataHeader.h.

◆ str

template<std::size_t N>
char o2::header::Descriptor< N >::str[N]

Definition at line 216 of file DataHeader.h.


The documentation for this struct was generated from the following file: