AFF3CT
A Fast Forward Error Correction Tool!
 All Classes Files Functions Variables Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Monitor_i< B > Class Template Referenceabstract

Monitors the simulated frames, tells if there is a frame errors and counts the number of bit errors. More...

#include <Monitor.hpp>

Inheritance diagram for Monitor_i< B >:
Module SC_Monitor< B > Monitor_std< B > Monitor_reduction< B >

Public Member Functions

 Monitor_i (const int &K, const int &N, const int &n_frames=1, const std::string name="Monitor_i")
 Constructor. More...
 
virtual ~Monitor_i ()
 Destructor.
 
int get_N () const
 Gets the frame size. More...
 
int get_K () const
 Gets the number of information bits in a frame. More...
 
virtual int get_n_be () const =0
 Gets the number of bit errors. More...
 
virtual int get_n_fe () const =0
 Gets the number of frame errors. More...
 
virtual float get_ber () const =0
 Gets the bit error rate. More...
 
virtual float get_fer () const =0
 Gets the frame error rate. More...
 
virtual unsigned long long get_n_analyzed_fra () const =0
 Gets the number of analyzed frames (analyzed in the Monitor_i::check_errors method). More...
 
virtual int get_fe_limit () const =0
 Gets the frame errors limit (maximal number of frame errors to simulate). More...
 
virtual bool fe_limit_achieved ()=0
 Tells if the frame errors limit is achieved (in this case the current computations should stop). More...
 
virtual void check_errors (const mipp::vector< B > &U, const mipp::vector< B > &V)=0
 Compares two messages and counts the number of frame errors and bit errors. More...
 
- Public Member Functions inherited from Module
 Module (const int n_frames=1, const std::string name="Module")
 Constructor. More...
 
virtual ~Module ()
 Destructor.
 
virtual void set_n_frames (const int n_frames)
 Set the number of frames. More...
 
virtual int get_n_frames () const
 Get the number of frames. More...
 
void rename (const std::string name)
 Rename the Module. More...
 

Static Public Member Functions

static bool is_interrupt ()
 Tells if the user asked for stopping the current computations. More...
 
static bool is_over ()
 Tells if the user asked for stopping the whole simulation. More...
 

Protected Attributes

const int K
 
const int N
 
- Protected Attributes inherited from Module
int n_frames
 
std::string name
 

Static Protected Attributes

static bool interrupt = false
 
static bool first_interrupt = true
 
static bool over = false
 
static std::chrono::time_point
< std::chrono::steady_clock,
std::chrono::nanoseconds > 
t_last_interrupt
 
static std::chrono::nanoseconds d_delta_interrupt = std::chrono::nanoseconds(0)
 

Detailed Description

template<typename B>
class Monitor_i< B >

Monitors the simulated frames, tells if there is a frame errors and counts the number of bit errors.

Template Parameters
Btype of the bits in the frames to compare.

Please use Monitor for inheritance (instead of Monitor_i).

Constructor & Destructor Documentation

template<typename B >
Monitor_i< B >::Monitor_i ( const int &  K,
const int &  N,
const int &  n_frames = 1,
const std::string  name = "Monitor_i< B >" 
)
inline

Constructor.

Registers the SIGINT (signal interrupt or ctrl+C) interruption.

Parameters
Knumber of information bits in the frame.
Nsize of one frame.
n_framesnumber of frames to process in the Monitor.
nameMonitor's name.

Member Function Documentation

template<typename B >
virtual void Monitor_i< B >::check_errors ( const mipp::vector< B > &  U,
const mipp::vector< B > &  V 
)
pure virtual

Compares two messages and counts the number of frame errors and bit errors.

Typically this method is called at the very end of a communication chain.

Parameters
Uthe original message (from the Source or the CRC).
Vthe decoded message (from the Decoder).

Implemented in Monitor_std< B >.

template<typename B >
virtual bool Monitor_i< B >::fe_limit_achieved ( )
pure virtual

Tells if the frame errors limit is achieved (in this case the current computations should stop).

Returns
true if the frame errors limit is achieved.

Implemented in Monitor_std< B >.

template<typename B >
virtual float Monitor_i< B >::get_ber ( ) const
pure virtual

Gets the bit error rate.

Returns
the bit error rate.

Implemented in Monitor_std< B >.

template<typename B >
virtual int Monitor_i< B >::get_fe_limit ( ) const
pure virtual

Gets the frame errors limit (maximal number of frame errors to simulate).

Returns
the frame errors limit.

Implemented in Monitor_std< B >.

template<typename B >
virtual float Monitor_i< B >::get_fer ( ) const
pure virtual

Gets the frame error rate.

Returns
the frame error rate.

Implemented in Monitor_std< B >.

template<typename B >
int Monitor_i< B >::get_K ( ) const
inline

Gets the number of information bits in a frame.

Returns
the number of information bits.
template<typename B >
int Monitor_i< B >::get_N ( ) const
inline

Gets the frame size.

Returns
the frame size.
template<typename B >
virtual unsigned long long Monitor_i< B >::get_n_analyzed_fra ( ) const
pure virtual

Gets the number of analyzed frames (analyzed in the Monitor_i::check_errors method).

Returns
the number of analyzed frames.

Implemented in Monitor_std< B >, and Monitor_reduction< B >.

template<typename B >
virtual int Monitor_i< B >::get_n_be ( ) const
pure virtual

Gets the number of bit errors.

Returns
the number of bit errors.

Implemented in Monitor_std< B >, and Monitor_reduction< B >.

template<typename B >
virtual int Monitor_i< B >::get_n_fe ( ) const
pure virtual

Gets the number of frame errors.

Returns
the number of frame errors.

Implemented in Monitor_std< B >, and Monitor_reduction< B >.

template<typename B >
static bool Monitor_i< B >::is_interrupt ( )
inlinestatic

Tells if the user asked for stopping the current computations.

Returns
true if the SIGINT (ctrl+c) is called.
template<typename B >
static bool Monitor_i< B >::is_over ( )
inlinestatic

Tells if the user asked for stopping the whole simulation.

Returns
true if the SIGINT (ctrl+c) is called twice.

Member Data Documentation

template<typename B >
std::chrono::nanoseconds Monitor_i< B >::d_delta_interrupt = std::chrono::nanoseconds(0)
staticprotected

Delta time.

template<typename B >
bool Monitor_i< B >::first_interrupt = true
staticprotected

True if this is the first time that SIGIN is called.

template<typename B >
bool Monitor_i< B >::interrupt = false
staticprotected

True if there is a SIGINT signal (ctrl+C).

template<typename B >
const int Monitor_i< B >::K
protected

Number of information bits in one frame

template<typename B >
const int Monitor_i< B >::N
protected

Size of one frame (= number of bits in one frame)

template<typename B >
bool Monitor_i< B >::over = false
staticprotected

True if SIGINT is called twice in the Monitor_i::d_delta_interrupt time

template<typename B >
std::chrono::time_point< std::chrono::steady_clock, std::chrono::nanoseconds > Monitor_i< B >::t_last_interrupt
staticprotected

Time point of the last call to SIGINT


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