#include <fetch_stage.hh>

Public Types | |
| typedef transaction::gps_type | gps_type |
| GPS times. | |
| typedef transaction::chan_index | chan_index |
| CHannel index. | |
| typedef transaction::seg_index | seg_index |
| Channel index. | |
| typedef std::vector< chan_index > | chan_vect |
| Channel list. | |
Public Member Functions | |
| fetch_stage (int nThread, int nTrans) | |
| Stage template constructor. | |
| virtual | ~fetch_stage (void) |
| void | filter (transaction *trans) |
| Transaction filter for this stage. | |
| void | find_data (transaction *trans) |
| Search for a data source and read in data. | |
| void | read (const frame_loc &fl, const chan_vect &v, gps_type start, gps_type stop) |
| Read channels from a specified frame tpye. | |
| const char * | stage_name (void) const |
| Stage name. | |
The fetch_stage class provides a minimal template for a SEDA stage thread pool. It is based on the seda_stage class and provides a stage with no filter processing. The constructor, destructor and filter methods are implemented. The filter method immediately passes the transactions to its output queue (the input queue of the next stage in the pipeline.
GPS times.
Data type sused to represent GPS times.
CHannel index.
Data type use to represent indices into master channel list.
Channel index.
Data type use to represent indices into segment database.
| typedef std::vector<chan_index> sends::fetch_stage::chan_vect |
Channel list.
Channel index vector.
| sends::fetch_stage::fetch_stage | ( | int | nThread, | |
| int | nTrans | |||
| ) |
Stage template constructor.
Construct a fetch_stage object. The arguments indicate the number of threads in the pool and the number of input transactions that may be queue simultaneously (note that the pipline gets indigestion only after more than (nTrans + nThread) trasactions need to execute in this stage.
| nThread | Number of threads to run simultaneously in the pool. | |
| nTrans | Number of transactions that may be queued. |
| virtual sends::fetch_stage::~fetch_stage | ( | void | ) | [virtual] |
Stage template destructor is null by default. It is mostly useful to remove resources allocated by the stages.
| void sends::fetch_stage::filter | ( | transaction * | trans | ) | [virtual] |
Transaction filter for this stage.
The fetch_stage filter method detemines what actions must be taken for the transaction type. It then calls find_data or passes the transaction to the next stage as appropriate.
| trans | Pointer to the current transaction |
Implements sends::seda_stage.
| void sends::fetch_stage::find_data | ( | transaction * | trans | ) |
Search for a data source and read in data.
The find_data method loops over channels and reserves the data data needed by the specified request.
| trans | Pointer to the current transaction |
| void sends::fetch_stage::read | ( | const frame_loc & | fl, | |
| const chan_vect & | v, | |||
| gps_type | start, | |||
| gps_type | stop | |||
| ) |
Read channels from a specified frame tpye.
Read a list of channels from a single specified frame source into free data segments.
| fl | Frame location descriptor. | |
| v | Vector of channels (indices) to be read. | |
| start | Start GPS of data to be read | |
| stop | End GPS of data to be read |
| const char* sends::fetch_stage::stage_name | ( | void | ) | const [virtual] |
Stage name.
Return a constant pointer to a null-terminated character vector containing the name of the stage.
Implements sends::seda_stage.
1.5.5