fun_ofdm  1.0
802.11a Physical Layer for USRP
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
fun::block< I, O > Class Template Referenceabstract

The block class template. More...

#include <block.h>

Inheritance diagram for fun::block< I, O >:
fun::block_base

Public Member Functions

 block (std::string block_name)
 constructor More...
 
virtual void work ()=0
 The main work function. More...
 
- Public Member Functions inherited from fun::block_base
 block_base (std::string block_name)
 block_base constructor More...
 

Public Attributes

std::vector< I > input_buffer
 input_buffer contains new input items to be consumed More...
 
std::vector< O > output_buffer
 output_buffer is where the output items of the block should be placed More...
 
- Public Attributes inherited from fun::block_base
std::string name
 the public name of the block More...
 

Detailed Description

template<typename I, typename O>
class fun::block< I, O >

The block class template.

This class is a template class for the blocks in the receiver chain. This class contains the input and output buffers

Definition at line 69 of file block.h.

Constructor & Destructor Documentation

template<typename I, typename O>
fun::block< I, O >::block ( std::string  block_name)
inline

constructor

Reserves BUFFER_MAX * sizeof(size_type) for the input and output buffers.

Parameters
block_namethe name of the block as a std::string

Definition at line 79 of file block.h.

79  :
80  block_base(block_name)
81  {
82  input_buffer.reserve(BUFFER_MAX);
83  output_buffer.reserve(BUFFER_MAX);
84  }

Member Function Documentation

template<typename I, typename O>
virtual void fun::block< I, O >::work ( )
pure virtual

The main work function.

This function is purely virtual. This function must consume input_buffer and fill output_buffer. In doing so it should be sure to resize the output_buffer accordingly and carryover any items from the input_buffer that it might need on its next call.

Implements fun::block_base.

Implemented in fun::frame_decoder, fun::frame_detector, fun::channel_est, fun::timing_sync, fun::fft_symbols, and fun::phase_tracker.

Member Data Documentation

template<typename I, typename O>
std::vector<I> fun::block< I, O >::input_buffer

input_buffer contains new input items to be consumed

Contains new input items of type I. There is no guarantee on the number of items passed to the input_buffer for each call to work except that it must be less than BUFFER_MAX.

Definition at line 103 of file block.h.

Referenced by fun::block< tagged_vector< 64 >, tagged_vector< 48 > >::block(), and fun::receiver_chain::process_samples().

template<typename I, typename O>
std::vector<O> fun::block< I, O >::output_buffer

output_buffer is where the output items of the block should be placed

There is no restriction on the number of output items a block must produce on each call except that it must be less than BUFFER_MAX.

Definition at line 111 of file block.h.

Referenced by fun::block< tagged_vector< 64 >, tagged_vector< 48 > >::block(), and fun::receiver_chain::process_samples().


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