Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

gr_test Class Reference
[Signal Processing Blocks]

#include <gr_test.h>

Inheritance diagram for gr_test:

Inheritance graph
[legend]
Collaboration diagram for gr_test:

Collaboration graph
[legend]
List of all members.

Detailed Description

Test class for testing runtime system (setting up buffers and such.).

This block does not do any usefull actual data processing. It just exposes setting all standard block parameters using the contructor or public methods.

This block can be usefull when testing the runtime system. You can force this block to have a large history, decimation factor and/or large output_multiple. The runtime system should detect this and create large enough buffers all through the signal chain.


Public Member Functions

 ~gr_test ()
int general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 compute output items from input items
void forecast (int noutput_items, gr_vector_int &ninput_items_required)
 Estimate input requirements given output request.
void set_check_topology (bool check_topology)
 Force check topology to return true or false.
bool check_topology (int ninputs, int noutputs)
 Confirm that ninputs and noutputs is an acceptable combination.
int fixed_rate_ninput_to_noutput (int ninput)
 Given ninput samples, return number of output samples that will be produced. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this.
int fixed_rate_noutput_to_ninput (int noutput)
 Given noutput samples, return number of input samples required to produce noutput. N.B. this is only defined if fixed_rate returns true.
void set_fixed_rate_public (bool fixed_rate)
 Set if fixed rate should return true. N.B. This is normally a private method but we make it available here as public.
void set_consume_type (gr_consume_type_t cons_type)
 Set the consume pattern.
void set_consume_limit (unsigned int limit)
 Set the consume limit.
void set_produce_type (gr_produce_type_t prod_type)
 Set the produce pattern.
void set_produce_limit (unsigned int limit)
 Set the produce limit.

Protected Member Functions

 gr_test (const std::string &name, int min_inputs, int max_inputs, unsigned int sizeof_input_item, int min_outputs, int max_outputs, unsigned int sizeof_output_item, unsigned int history, unsigned int output_multiple, double relative_rate, bool fixed_rate, gr_consume_type_t cons_type, gr_produce_type_t prod_type)

Protected Attributes

unsigned int d_sizeof_input_item
unsigned int d_sizeof_output_item
bool d_check_topology
char d_temp
gr_consume_type_t d_consume_type
int d_min_consume
int d_max_consume
gr_produce_type_t d_produce_type
int d_min_produce
int d_max_produce

Friends

gr_test_sptr gr_make_test (const std::string &name, int min_inputs, int max_inputs, unsigned int sizeof_input_item, int min_outputs, int max_outputs, unsigned int sizeof_output_item, unsigned int history, unsigned int output_multiple, double relative_rate, bool fixed_rate, gr_consume_type_t cons_type, gr_produce_type_t prod_type)


Constructor & Destructor Documentation

gr_test::~gr_test  )  [inline]
 

gr_test::gr_test const std::string &  name,
int  min_inputs,
int  max_inputs,
unsigned int  sizeof_input_item,
int  min_outputs,
int  max_outputs,
unsigned int  sizeof_output_item,
unsigned int  history,
unsigned int  output_multiple,
double  relative_rate,
bool  fixed_rate,
gr_consume_type_t  cons_type,
gr_produce_type_t  prod_type
[protected]
 


Member Function Documentation

bool gr_test::check_topology int  ninputs,
int  noutputs
[inline, virtual]
 

Confirm that ninputs and noutputs is an acceptable combination.

Parameters:
ninputs number of input streams connected
noutputs number of output streams connected
Returns:
true if this is a valid configuration for this block.
This function is called by the runtime system whenever the topology changes. Most classes do not need to override this. This check is in addition to the constraints specified by the input and output gr_io_signatures.

Reimplemented from gr_block.

int gr_test::fixed_rate_ninput_to_noutput int  ninput  )  [inline, virtual]
 

Given ninput samples, return number of output samples that will be produced. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this.

Reimplemented from gr_block.

int gr_test::fixed_rate_noutput_to_ninput int  noutput  )  [inline, virtual]
 

Given noutput samples, return number of input samples required to produce noutput. N.B. this is only defined if fixed_rate returns true.

Reimplemented from gr_block.

void gr_test::forecast int  noutput_items,
gr_vector_int ninput_items_required
[inline, virtual]
 

Estimate input requirements given output request.

Parameters:
noutput_items number of output items to produce
ninput_items_required number of input items required on each input stream
Given a request to product noutput_items, estimate the number of data items required on each input stream. The estimate doesn't have to be exact, but should be close.

Reimplemented from gr_block.

int gr_test::general_work int  noutput_items,
gr_vector_int ninput_items,
gr_vector_const_void_star input_items,
gr_vector_void_star output_items
[virtual]
 

compute output items from input items

Parameters:
noutput_items number of output items to write on each output stream
ninput_items number of input items available on each input stream
input_items vector of pointers to the input items, one entry per input stream
output_items vector of pointers to the output items, one entry per output stream
Returns:
number of items actually written to each output stream, or -1 on EOF. It is OK to return a value less than noutput_items. -1 <= return value <= noutput_items
general_work must call consume or consume_each to indicate how many items were consumed on each input stream.

Implements gr_block.

void gr_test::set_check_topology bool  check_topology  )  [inline]
 

Force check topology to return true or false.

Parameters:
check_topology value to return when check_topology is called (true or false) default check_topology returns true

void gr_test::set_consume_limit unsigned int  limit  )  [inline]
 

Set the consume limit.

Parameters:
limit min or maximum items to consume (depending on consume_type)

void gr_test::set_consume_type gr_consume_type_t  cons_type  )  [inline]
 

Set the consume pattern.

Parameters:
cons_type which consume pattern to use

void gr_test::set_fixed_rate_public bool  fixed_rate  )  [inline]
 

Set if fixed rate should return true. N.B. This is normally a private method but we make it available here as public.

void gr_test::set_produce_limit unsigned int  limit  )  [inline]
 

Set the produce limit.

Parameters:
limit min or maximum items to produce (depending on produce_type)

void gr_test::set_produce_type gr_produce_type_t  prod_type  )  [inline]
 

Set the produce pattern.

Parameters:
prod_type which produce pattern to use


Friends And Related Function Documentation

gr_test_sptr gr_make_test const std::string &  name,
int  min_inputs,
int  max_inputs,
unsigned int  sizeof_input_item,
int  min_outputs,
int  max_outputs,
unsigned int  sizeof_output_item,
unsigned int  history,
unsigned int  output_multiple,
double  relative_rate,
bool  fixed_rate,
gr_consume_type_t  cons_type,
gr_produce_type_t  prod_type
[friend]
 


Member Data Documentation

bool gr_test::d_check_topology [protected]
 

gr_consume_type_t gr_test::d_consume_type [protected]
 

int gr_test::d_max_consume [protected]
 

int gr_test::d_max_produce [protected]
 

int gr_test::d_min_consume [protected]
 

int gr_test::d_min_produce [protected]
 

gr_produce_type_t gr_test::d_produce_type [protected]
 

unsigned int gr_test::d_sizeof_input_item [protected]
 

unsigned int gr_test::d_sizeof_output_item [protected]
 

char gr_test::d_temp [protected]
 


The documentation for this class was generated from the following files:
Generated on Sat Jul 8 17:14:31 2006 for GNU Radio 2.x by  doxygen 1.4.1