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

an example data header containing a name of an object as a null terminated char arr. this is a template! at instantiation the template parameter determines the size of the held string array. a caveat with decoding is (if length of string is not known) you have to use header::get<NameHeader<0>>(buffer) to get it out of a buffer. May improve in the future if enough people complain. If the compiler decides to pad the end of struct, the length of padding is stored in the last byte More...

#include <NameHeader.h>

Inherits o2::header::BaseHeader.

Public Member Functions

 NameHeader ()
 
template<size_t S>
 NameHeader (const char(&in)[S])
 
const chargetName () const
 
size_t getNameLength () const
 
const o2::header::HeaderType sHeaderType
 
const o2::header::HeaderType sHeaderType
 
- Public Member Functions inherited from o2::header::BaseHeader
 BaseHeader ()=delete
 dont construct directly
 
 BaseHeader (const BaseHeader &)=default
 
constexpr BaseHeader (uint32_t mySize, HeaderType desc, SerializationMethod ser, uint32_t version)
 Special ctor for initialization in derived types.
 
constexpr uint32_t size () const noexcept
 
const std::byte * data () const noexcept
 
const BaseHeadernext () const noexcept
 get the next header if any (const version)
 
BaseHeadernext () noexcept
 get the next header if any (non-const version)
 
bool sanityCheck (uint32_t expectedVersion) const
 
void throwInconsistentStackError () const
 

Static Public Attributes

static const uint32_t sVersion = 1
 
static const o2::header::HeaderType sHeaderType = "NameHead"
 
static const o2::header::SerializationMethod sSerializationMethod = gSerializationMethodNone
 
- Static Public Attributes inherited from o2::header::BaseHeader
static constexpr uint32_t sMagicString {String2<uint32_t>("O2O2")}
 
static const uint32_t sVersion = o2::header::gInvalidToken32
 
static const o2::header::HeaderType sHeaderType = o2::header::gInvalidToken64
 
static const o2::header::SerializationMethod sSerializationMethod = o2::header::gInvalidToken64
 

Additional Inherited Members

- Static Public Member Functions inherited from o2::header::BaseHeader
static const BaseHeaderget (const std::byte *b, size_t=0)
 access header in buffer
 
static BaseHeaderget (std::byte *b, size_t=0)
 access header in buffer
 
- Public Attributes inherited from o2::header::BaseHeader
union { 
 
   char   magicString [gSizeMagicString
 
   uint32_t   magicStringInt 
 
};  
 a magic string, used to identify an O2 header in a raw stream of bytes
 
uint32_t headerSize
 
union { 
 
   uint32_t   flags 
 
   struct { 
 
      uint32_t   flagsNextHeader: 1 
 
      uint32_t   flagsReserved: 15 
 
      uint32_t   flagsDerivedHeader: 16 
 
   }  
 
};  
 flags, first bit indicates that a sub header follows
 
uint32_t headerVersion
 version of the entire header, set by the derived header
 
o2::header::HeaderType description
 header type description, set by derived header
 
o2::header::SerializationMethod serialization
 header serialization method, set by derived header
 

Detailed Description

template<size_t N>
struct o2::header::NameHeader< N >

an example data header containing a name of an object as a null terminated char arr. this is a template! at instantiation the template parameter determines the size of the held string array. a caveat with decoding is (if length of string is not known) you have to use header::get<NameHeader<0>>(buffer) to get it out of a buffer. May improve in the future if enough people complain. If the compiler decides to pad the end of struct, the length of padding is stored in the last byte

Definition at line 39 of file NameHeader.h.

Constructor & Destructor Documentation

◆ NameHeader() [1/2]

template<size_t N>
o2::header::NameHeader< N >::NameHeader ( )
inline

Definition at line 43 of file NameHeader.h.

◆ NameHeader() [2/2]

template<size_t N>
template<size_t S>
o2::header::NameHeader< N >::NameHeader ( const char(&)  in[S])
inline

Definition at line 55 of file NameHeader.h.

Member Function Documentation

◆ getName()

template<size_t N>
const char * o2::header::NameHeader< N >::getName ( ) const
inline

Definition at line 68 of file NameHeader.h.

◆ getNameLength()

template<size_t N>
size_t o2::header::NameHeader< N >::getNameLength ( ) const
inline

Definition at line 69 of file NameHeader.h.

◆ sHeaderType() [1/2]

Definition at line 88 of file NameHeader.h.

◆ sHeaderType() [2/2]

Definition at line 16 of file NameHeader.cxx.

Member Data Documentation

◆ sHeaderType

template<size_t N>
const o2::header::HeaderType o2::header::NameHeader< N >::sHeaderType = "NameHead"
static

Definition at line 41 of file NameHeader.h.

◆ sSerializationMethod

template<size_t N>
const SerializationMethod o2::header::NameHeader< N >::sSerializationMethod = gSerializationMethodNone
static

Definition at line 42 of file NameHeader.h.

◆ sVersion

template<size_t N>
const uint32_t o2::header::NameHeader< N >::sVersion = 1
static

Definition at line 40 of file NameHeader.h.


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