libe3 0.6.1
C++ library for E3AP RAN vendor integration
Loading...
Searching...
No Matches
libe3::Pdu Struct Reference

Generic E3AP PDU structure. More...

#include <types.hpp>

Public Member Functions

 Pdu ()
 SetupRequest-typed PDU with a default-constructed message and a fresh timestamp.
 Pdu (PduType t)
template<typename T>
 Pdu (PduType t, T &&data)
template<typename T>
T * get_if () noexcept
 Get PDU data with type checking.
template<typename T>
const T * get_if () const noexcept
 Get PDU data with type checking.

Public Attributes

PduType type {PduType::SETUP_REQUEST}
 Which alternative of choice is set.
PduChoice choice
 The message itself.
uint32_t message_id {0}
 Unique message identifier.
uint64_t enqueue_seq {0}
 Set by queue_outbound; keys the [latrec] L-stage records.
uint64_t timestamp {0}
 Producer timestamp, in nanoseconds since the Unix epoch.

Detailed Description

Generic E3AP PDU structure.

Definition at line 448 of file types.hpp.

Constructor & Destructor Documentation

◆ Pdu() [1/3]

libe3::Pdu::Pdu ( )
inline

SetupRequest-typed PDU with a default-constructed message and a fresh timestamp.

Definition at line 469 of file types.hpp.

◆ Pdu() [2/3]

libe3::Pdu::Pdu ( PduType t)
inlineexplicit

PDU of type t with a default-constructed message and a fresh timestamp.

Parameters
tPDU type

Definition at line 473 of file types.hpp.

◆ Pdu() [3/3]

template<typename T>
libe3::Pdu::Pdu ( PduType t,
T && data )
inline

PDU of type t that holds data, with a fresh timestamp.

Parameters
tPDU type; it must match the type of data
dataThe message

Definition at line 479 of file types.hpp.

Member Function Documentation

◆ get_if() [1/2]

template<typename T>
const T * libe3::Pdu::get_if ( ) const
inlinenoexcept

Get PDU data with type checking.

Template Parameters
TMessage type to look for
Returns
The message, or nullptr when the PDU holds another type

Definition at line 498 of file types.hpp.

◆ get_if() [2/2]

template<typename T>
T * libe3::Pdu::get_if ( )
inlinenoexcept

Get PDU data with type checking.

Template Parameters
TMessage type to look for
Returns
The message, or nullptr when the PDU holds another type

Definition at line 488 of file types.hpp.

Member Data Documentation

◆ choice

PduChoice libe3::Pdu::choice

The message itself.

Definition at line 450 of file types.hpp.

◆ enqueue_seq

uint64_t libe3::Pdu::enqueue_seq {0}

Set by queue_outbound; keys the [latrec] L-stage records.

Definition at line 452 of file types.hpp.

◆ message_id

uint32_t libe3::Pdu::message_id {0}

Unique message identifier.

Definition at line 451 of file types.hpp.

◆ timestamp

uint64_t libe3::Pdu::timestamp {0}

Producer timestamp, in nanoseconds since the Unix epoch.

Stamped from the realtime clock (see now_realtime_ns) when the PDU is constructed, so a caller gets one for free. Zero means "no producer reference": every encoding transmits it as an absent field and decodes an absent field back to zero, so the clock read is opt-out and a PDU without a timestamp is a normal message rather than a malformed one.

Warning
Realtime, not monotonic. Never subtract it from a monotonic reading.

Definition at line 466 of file types.hpp.

◆ type

PduType libe3::Pdu::type {PduType::SETUP_REQUEST}

Which alternative of choice is set.

Definition at line 449 of file types.hpp.


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