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
 
Descriptoroperator= (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 (const char *string, short length=-1)
 
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 >
std::enable_if_t< std::is_same< T, std::string >::value==true, 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 207 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 227 of file DataHeader.h.

◆ ItgType

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

Definition at line 214 of file DataHeader.h.

◆ self_type

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

Definition at line 210 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 220 of file DataHeader.h.

◆ Descriptor() [2/4]

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

Definition at line 221 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 246 of file DataHeader.h.

Member Function Documentation

◆ as()

template<std::size_t N>
template<typename T >
std::enable_if_t< std::is_same< T, std::string >::value==true, T > o2::header::Descriptor< N >::as ( ) const
inline

get the descriptor as std::string

Definition at line 301 of file DataHeader.h.

◆ operator ImplicitConversion()

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

Definition at line 231 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 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

◆ operator<()

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

Definition at line 286 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 285 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()

template<std::size_t N>
void o2::header::Descriptor< N >::runtimeInit ( const char string,
short  length = -1 
)
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 261 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 290 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 213 of file DataHeader.h.

◆ bitcount

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

Definition at line 212 of file DataHeader.h.

◆ itg

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

Definition at line 218 of file DataHeader.h.

◆ size

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

Definition at line 211 of file DataHeader.h.

◆ str

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

Definition at line 217 of file DataHeader.h.


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