Agora  1.2.0
Agora project
TxRxWorker Class Referenceabstract

#include <txrx_worker.h>

Inheritance diagram for TxRxWorker:
Collaboration diagram for TxRxWorker:

Public Member Functions

 TxRxWorker (size_t core_offset, size_t tid, size_t interface_count, size_t interface_offset, size_t channels_per_interface, Config *const config, size_t *rx_frame_start, moodycamel::ConcurrentQueue< EventData > *event_notify_q, moodycamel::ConcurrentQueue< EventData > *tx_pending_q, moodycamel::ProducerToken &tx_producer, moodycamel::ProducerToken &notify_producer, std::vector< RxPacket > &rx_memory, std::byte *const tx_memory, std::mutex &sync_mutex, std::condition_variable &sync_cond, std::atomic< bool > &can_proceed)
 
 TxRxWorker ()=delete
 
virtual ~TxRxWorker ()
 
virtual void Start ()
 
virtual void Stop ()
 
virtual void DoTxRx ()=0
 
size_t Id () const
 
bool Started () const
 
bool Running () const
 

Static Public Attributes

static constexpr bool kDebugTxMemory = false
 

Protected Member Functions

void WaitSync ()
 Using a latch might be better but adds c++20 requirement. More...
 
ConfigConfiguration ()
 
bool NotifyComplete (const EventData &complete_event)
 
std::vector< EventDataGetPendingTxEvents (size_t max_events=0)
 
RxPacketGetRxPacket ()
 
void ReturnRxPacket (RxPacket &unused_packet)
 
PacketGetTxPacket (size_t frame, size_t symbol, size_t ant)
 
PacketGetUlTxPacket (size_t frame, size_t symbol, size_t ant)
 

Protected Attributes

const size_t tid_
 
const size_t core_offset_
 
const size_t num_interfaces_
 
const size_t interface_offset_
 
const size_t channels_per_interface_
 
size_t *const rx_frame_start_
 
bool running_
 
std::mutex & mutex_
 Owned by the parent TxRx object for sync. More...
 
std::condition_variable & cond_
 
std::atomic< bool > & can_proceed_
 

Private Attributes

Config *const cfg_
 
std::thread thread_
 
size_t rx_memory_idx_
 
std::vector< RxPacket > & rx_memory_
 
std::byte *const tx_memory_
 
moodycamel::ConcurrentQueue< EventData > * event_notify_q_
 
moodycamel::ConcurrentQueue< EventData > * tx_pending_q_
 
moodycamel::ProducerTokentx_producer_token_
 
moodycamel::ProducerTokennotify_producer_token_
 
bool started_
 

Constructor & Destructor Documentation

◆ TxRxWorker() [1/2]

TxRxWorker::TxRxWorker ( size_t  core_offset,
size_t  tid,
size_t  interface_count,
size_t  interface_offset,
size_t  channels_per_interface,
Config *const  config,
size_t *  rx_frame_start,
moodycamel::ConcurrentQueue< EventData > *  event_notify_q,
moodycamel::ConcurrentQueue< EventData > *  tx_pending_q,
moodycamel::ProducerToken tx_producer,
moodycamel::ProducerToken notify_producer,
std::vector< RxPacket > &  rx_memory,
std::byte *const  tx_memory,
std::mutex &  sync_mutex,
std::condition_variable &  sync_cond,
std::atomic< bool > &  can_proceed 
)

◆ TxRxWorker() [2/2]

TxRxWorker::TxRxWorker ( )
delete

◆ ~TxRxWorker()

TxRxWorker::~TxRxWorker ( )
virtual
Here is the call graph for this function:

Member Function Documentation

◆ Configuration()

Config* TxRxWorker::Configuration ( )
inlineprotected
Here is the caller graph for this function:

◆ DoTxRx()

virtual void TxRxWorker::DoTxRx ( )
pure virtual

Implemented in TxRxWorkerHw, TxRxWorkerClientHw, TxRxWorkerDpdk, TxRxWorkerClientSim, TxRxWorkerSim, and TxRxWorkerUsrp.

Here is the caller graph for this function:

◆ GetPendingTxEvents()

std::vector< EventData > TxRxWorker::GetPendingTxEvents ( size_t  max_events = 0)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRxPacket()

RxPacket & TxRxWorker::GetRxPacket ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTxPacket()

Packet * TxRxWorker::GetTxPacket ( size_t  frame,
size_t  symbol,
size_t  ant 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUlTxPacket()

Packet * TxRxWorker::GetUlTxPacket ( size_t  frame,
size_t  symbol,
size_t  ant 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Id()

size_t TxRxWorker::Id ( ) const
inline

◆ NotifyComplete()

bool TxRxWorker::NotifyComplete ( const EventData complete_event)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReturnRxPacket()

void TxRxWorker::ReturnRxPacket ( RxPacket unused_packet)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Running()

bool TxRxWorker::Running ( ) const
inline
Here is the caller graph for this function:

◆ Start()

void TxRxWorker::Start ( )
virtual

Reimplemented in TxRxWorkerDpdk.

Here is the call graph for this function:

◆ Started()

bool TxRxWorker::Started ( ) const
inline

◆ Stop()

void TxRxWorker::Stop ( )
virtual

Reimplemented in TxRxWorkerDpdk.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WaitSync()

void TxRxWorker::WaitSync ( )
protected

Using a latch might be better but adds c++20 requirement.

Here is the caller graph for this function:

Member Data Documentation

◆ can_proceed_

std::atomic<bool>& TxRxWorker::can_proceed_
protected

◆ cfg_

Config* const TxRxWorker::cfg_
private

◆ channels_per_interface_

const size_t TxRxWorker::channels_per_interface_
protected

◆ cond_

std::condition_variable& TxRxWorker::cond_
protected

◆ core_offset_

const size_t TxRxWorker::core_offset_
protected

◆ event_notify_q_

moodycamel::ConcurrentQueue<EventData>* TxRxWorker::event_notify_q_
private

◆ interface_offset_

const size_t TxRxWorker::interface_offset_
protected

◆ kDebugTxMemory

constexpr bool TxRxWorker::kDebugTxMemory = false
staticconstexpr

◆ mutex_

std::mutex& TxRxWorker::mutex_
protected

Owned by the parent TxRx object for sync.

◆ notify_producer_token_

moodycamel::ProducerToken& TxRxWorker::notify_producer_token_
private

◆ num_interfaces_

const size_t TxRxWorker::num_interfaces_
protected

◆ running_

bool TxRxWorker::running_
protected

◆ rx_frame_start_

size_t* const TxRxWorker::rx_frame_start_
protected

◆ rx_memory_

std::vector<RxPacket>& TxRxWorker::rx_memory_
private

◆ rx_memory_idx_

size_t TxRxWorker::rx_memory_idx_
private

◆ started_

bool TxRxWorker::started_
private

◆ thread_

std::thread TxRxWorker::thread_
private

◆ tid_

const size_t TxRxWorker::tid_
protected

◆ tx_memory_

std::byte* const TxRxWorker::tx_memory_
private

◆ tx_pending_q_

moodycamel::ConcurrentQueue<EventData>* TxRxWorker::tx_pending_q_
private

◆ tx_producer_token_

moodycamel::ProducerToken& TxRxWorker::tx_producer_token_
private

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