Vanetza
 
Loading...
Searching...
No Matches
vanetza::geonet::PendingPacket< PDU, Args > Class Template Reference

#include <pending_packet.hpp>

Inheritance diagram for vanetza::geonet::PendingPacket< PDU, Args >:

Public Types

using Packet = std::tuple< std::unique_ptr< PDU >, std::unique_ptr< DownPacket > >
 
using Function = std::function< void(Packet &&, Args &&...)>
 

Public Member Functions

 PendingPacket (Packet &&packet, const Function &fn)
 
template<typename... OtherArgs>
 PendingPacket (PendingPacket< PDU, OtherArgs... > &&other, std::function< void(PendingPacket< PDU, OtherArgs... > &&, Args &&...)> fn)
 
template<typename... OtherArgs, typename... T>
 PendingPacket (PendingPacket< PDU, OtherArgs... > &&other, T &&... ts)
 
void process (Args &&... args)
 
std::size_t length () const
 
Clock::duration reduce_lifetime (Clock::duration queuing_time)
 
const PDU & pdu () const
 
const DownPacketpayload () const
 
Function action () const
 
Packet packet () &&
 
PendingPacket duplicate ()
 

Private Attributes

Packet m_packet
 
Function m_function
 

Detailed Description

template<typename PDU, typename... Args>
class vanetza::geonet::PendingPacket< PDU, Args >

PendingPacket combines PDU, payload and custom action code for pending processing steps. This makes it easy to resume packet forwarding steps after buffering, for example.

Definition at line 22 of file pending_packet.hpp.

Member Typedef Documentation

◆ Function

template<typename PDU , typename... Args>
using vanetza::geonet::PendingPacket< PDU, Args >::Function = std::function<void(Packet&&, Args&&...)>

Definition at line 26 of file pending_packet.hpp.

◆ Packet

template<typename PDU , typename... Args>
using vanetza::geonet::PendingPacket< PDU, Args >::Packet = std::tuple<std::unique_ptr<PDU>, std::unique_ptr<DownPacket> >

Definition at line 25 of file pending_packet.hpp.

Constructor & Destructor Documentation

◆ PendingPacket() [1/3]

template<typename PDU , typename... Args>
vanetza::geonet::PendingPacket< PDU, Args >::PendingPacket ( Packet &&  packet,
const Function &  fn 
)
inline

Definition at line 30 of file pending_packet.hpp.

◆ PendingPacket() [2/3]

template<typename PDU , typename... Args>
template<typename... OtherArgs>
vanetza::geonet::PendingPacket< PDU, Args >::PendingPacket ( PendingPacket< PDU, OtherArgs... > &&  other,
std::function< void(PendingPacket< PDU, OtherArgs... > &&, Args &&...)>  fn 
)
inline

Definition at line 34 of file pending_packet.hpp.

◆ PendingPacket() [3/3]

template<typename PDU , typename... Args>
template<typename... OtherArgs, typename... T>
vanetza::geonet::PendingPacket< PDU, Args >::PendingPacket ( PendingPacket< PDU, OtherArgs... > &&  other,
T &&...  ts 
)
inline

Definition at line 44 of file pending_packet.hpp.

Member Function Documentation

◆ action()

template<typename PDU , typename... Args>
Function vanetza::geonet::PendingPacket< PDU, Args >::action ( ) const
inline

Definition at line 101 of file pending_packet.hpp.

◆ duplicate()

template<typename PDU , typename... Args>
PendingPacket vanetza::geonet::PendingPacket< PDU, Args >::duplicate ( )
inline

Definition at line 105 of file pending_packet.hpp.

◆ length()

template<typename PDU , typename... Args>
std::size_t vanetza::geonet::PendingPacket< PDU, Args >::length ( ) const
inline

Definition at line 61 of file pending_packet.hpp.

◆ packet()

template<typename PDU , typename... Args>
Packet vanetza::geonet::PendingPacket< PDU, Args >::packet ( ) &&
inline

Definition at line 103 of file pending_packet.hpp.

◆ payload()

template<typename PDU , typename... Args>
const DownPacket & vanetza::geonet::PendingPacket< PDU, Args >::payload ( ) const
inline

Definition at line 94 of file pending_packet.hpp.

◆ pdu()

template<typename PDU , typename... Args>
const PDU & vanetza::geonet::PendingPacket< PDU, Args >::pdu ( ) const
inline

Definition at line 87 of file pending_packet.hpp.

◆ process()

template<typename PDU , typename... Args>
void vanetza::geonet::PendingPacket< PDU, Args >::process ( Args &&...  args)
inline

Definition at line 54 of file pending_packet.hpp.

◆ reduce_lifetime()

template<typename PDU , typename... Args>
Clock::duration vanetza::geonet::PendingPacket< PDU, Args >::reduce_lifetime ( Clock::duration  queuing_time)
inline

Definition at line 68 of file pending_packet.hpp.

Member Data Documentation

◆ m_function

template<typename PDU , typename... Args>
Function vanetza::geonet::PendingPacket< PDU, Args >::m_function
private

Definition at line 120 of file pending_packet.hpp.

◆ m_packet

template<typename PDU , typename... Args>
Packet vanetza::geonet::PendingPacket< PDU, Args >::m_packet
private

Definition at line 119 of file pending_packet.hpp.


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