ForSyDe::sub_signal Class Reference

The sub-signal type used to construct a CT signal. More...

#include <sub_signal.hpp>

Public Types

typedef std::function< CTTYPE(const sc_time &)> functype
 

Public Member Functions

 sub_signal (const sc_time &st, const sc_time &et, const functype &f)
 The constructor used for sub-signal definition. More...
 
 sub_signal ()
 A dummy constructor used for sub-signal definition without initialization.
 
 sub_signal (const sub_signal &ss)
 The copy constructor. More...
 
sub_signaloperator= (const sub_signal &ss)
 The assignment operator. More...
 
CTTYPE operator() (const sc_time &valAt) const
 The overloaded () operator makes the sub-signal a function object. More...
 

Friends

sc_time get_start_time (const sub_signal &ss)
 A helper function used to get the beginning of the range.
 
sc_time get_end_time (const sub_signal &ss)
 A helper function used to get the end of the range.
 
std::function< CTTYPE(const sc_time &)> get_function (const sub_signal &ss)
 A helper function used to get the functions in range.
 
void set_range (sub_signal &ss, sc_time st, sc_time et)
 A helper function used to set the start and end of the range.
 
void set_function (sub_signal &ss, const std::function< CTTYPE(const sc_time &)> &f)
 A helper function used to set the function in the range.
 
std::ostream & operator<< (std::ostream &os, sub_signal &subSig)
 

Detailed Description

The sub-signal type used to construct a CT signal.

This class is used to build a sub-signal which is a function that is valid on a range. A consecutive stream of tokens of type sub_signal forms a CT signal.

The range is defined by a start time and and end time of type sc_time. The supplied fuction can be a function pointer, a function object or a C++11 lambda function.

Constructor & Destructor Documentation

ForSyDe::sub_signal::sub_signal ( const sc_time &  st,
const sc_time &  et,
const functype &  f 
)
inline

The constructor used for sub-signal definition.

Parameters
stBeginning of the range
etEnd of the range
fThe function over the range
ForSyDe::sub_signal::sub_signal ( const sub_signal ss)
inline

The copy constructor.

Parameters
ssObject to be copied

Member Function Documentation

CTTYPE ForSyDe::sub_signal::operator() ( const sc_time &  valAt) const
inline

The overloaded () operator makes the sub-signal a function object.

It allows to sample the signal with a convinient syntax. Additionally, it checks the sampling time validity with respect to the range.

sub_signal& ForSyDe::sub_signal::operator= ( const sub_signal ss)
inline

The assignment operator.

Parameters
ssObject to be assigned

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