RISA
risa::OnlineReceiverNotification Class Reference

This class implements the synchronization between the ReceiverModule class and the superior Receiver class. More...

#include <OnlineReceiverNotification.h>

Public Member Functions

 OnlineReceiverNotification (int size)
 
std::size_t fetch ()
 checks, if complete new sinogram is available More...
 
void notify (int receiverID, std::size_t index)
 This function inserts the new sinogram index in indeces_ and notifies the Receiver about the arrival. More...
 

Private Attributes

std::vector< std::size_t > indeces_
 
int size_
 
std::mutex mutex_
 
std::condition_variable cv_
 
std::size_t lastIndex_
 

Detailed Description

This class implements the synchronization between the ReceiverModule class and the superior Receiver class.

Definition at line 37 of file OnlineReceiverNotification.h.

Constructor & Destructor Documentation

risa::OnlineReceiverNotification::OnlineReceiverNotification ( int  size)
inline

Definition at line 40 of file OnlineReceiverNotification.h.

Member Function Documentation

std::size_t risa::OnlineReceiverNotification::fetch ( )
inline

checks, if complete new sinogram is available

Therefore, this function finds the minimum element in and returns it. For the minimum element, it can be guaranteed, that the sinogram is complete

Returns
the index of the last complete sinogram available in the buffers

Definition at line 53 of file OnlineReceiverNotification.h.

void risa::OnlineReceiverNotification::notify ( int  receiverID,
std::size_t  index 
)
inline

This function inserts the new sinogram index in indeces_ and notifies the Receiver about the arrival.

Parameters
[in]receiverIDthe id of the ReceiverModule, that received the sinogram
[in]indexthe index of the sinogram, that has just arrived

Definition at line 71 of file OnlineReceiverNotification.h.

Member Data Documentation

std::condition_variable risa::OnlineReceiverNotification::cv_
private

Definition at line 86 of file OnlineReceiverNotification.h.

std::vector<std::size_t> risa::OnlineReceiverNotification::indeces_
private

Definition at line 83 of file OnlineReceiverNotification.h.

std::size_t risa::OnlineReceiverNotification::lastIndex_
private

Definition at line 87 of file OnlineReceiverNotification.h.

std::mutex risa::OnlineReceiverNotification::mutex_
private

Definition at line 85 of file OnlineReceiverNotification.h.

int risa::OnlineReceiverNotification::size_
private

Definition at line 84 of file OnlineReceiverNotification.h.


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