#include <transaction.hh>
Public Types | |
| enum | command_code { kNoop, kGetStatus, kGetData, kGetServerStatus, kGetChannels, kQuit, kCommandCount } |
| Server command ennumeration. More... | |
| typedef chan_list::chan_index | chan_index |
| Channel index. | |
| typedef unsigned long | gps_type |
| GPS times. | |
| typedef std::vector< chan_stat > | cinx_vect |
| typedef seg_db::seg_index | seg_index |
| Segment list index. | |
| typedef std::vector< seg_index > | seg_vect |
| Reserved segment list type. | |
Public Member Functions | |
| transaction (tran_queue &retQ) | |
| Transaction constructor. | |
| ~transaction (void) | |
| long | block_seq (void) |
| get block sequence number. | |
| void | add_channel (chan_index inx) |
| Add a channel. | |
| void | clear (void) |
| void | clear_channels (void) |
| Clear the channel list. | |
| command_code | command (void) const |
| std::ostream & | dump (std::ostream &out) const |
| Dump out the transaction. | |
| gps_type | getChanFill (int i) const |
| Get fill point. | |
| chan_index | getChanIndex (int i) const |
| Get ith channel index. | |
| bool | getChanReady (int i) const |
| Test if channel is ready. | |
| int | getNChan (void) const |
| Get number of channels. | |
| long | get_stage (void) const |
| Get the last stage to have processed this transaction. | |
| gps_type | getStartGPS (void) const |
| Get start time. | |
| gps_type | getStopGPS (void) const |
| Get end time. | |
| gps_type | getStrideEnd (void) const |
| Get stride end time. | |
| long | ident (void) const |
| Transaction ID. | |
| bool | next_stride (void) |
| Set time for next stride. | |
| int | put_response (int resp) |
| Respond to client. | |
| socket_api & | ref_socket (void) |
| Reference OpenSSL bio structure. | |
| user_data & | ref_user (void) |
| Reference user_data structure. | |
| int | read (buffer &buf) |
| read a line from the client. | |
| void | error_reply (const std::string &err) |
| Send an error to the client. | |
| void | reply (const buffer &reply) |
| Send a reply. | |
| void | release (void) |
| Release the transaction. | |
| void | release_segments (void) |
| release all segments. | |
| void | release_segments (gps_type before) |
| Release segments with data before the specified GPS. | |
| void | reserve_segments (void) |
| Reserve all available segments. | |
| void | setCommand (command_code cmd) |
| Set the command. | |
| void | setCommand (const std::string &cmd) |
| Set the command from a string. | |
| void | set_id (long tranid) |
| set the transaction id. | |
| void | set_socket (socket_api *sock) |
| Set socket for this transaction. | |
| void | set_stage (long s) |
| Set socket for this transaction. | |
| void | set_user (const user_data &user) |
| Set user data. | |
| void | setTime (gps_type start, gps_type stop, gps_type stride=0) |
| Set transaction times. | |
| gps_type | stride (void) const |
| Time stride;. | |
Static Public Member Functions | |
| static command_code | getCommandCode (const std::string &str) |
| Get command code. | |
| static const char * | getCommandString (command_code code) |
| Get command string. | |
Classes | |
| class | chan_stat |
| Channel ID and status. More... | |
SENDS transaction block containing the SSL connection infomation, the user information, status information and other junk. The transaction structure is passed between the SEDA stages as the transaction is processed by the pipeline.
Channel index.
Data type of index into master channel list.
| typedef unsigned long sends::transaction::gps_type |
GPS times.
Data type for GPS time representation.
| typedef std::vector<chan_stat> sends::transaction::cinx_vect |
Data type for list (vector) oc channel status objects.
Segment list index.
Data type for index into the master segment list, used to specify individual segments.
| typedef std::vector<seg_index> sends::transaction::seg_vect |
Reserved segment list type.
Data type ued to maintain a list of reserved segments.
Server command ennumeration.
Enumerate all the commands to be recognized by the server.
| sends::transaction::transaction | ( | tran_queue & | retQ | ) |
Transaction constructor.
Construct a transaction block and note the queue into which the transaction is to be returned when processing is complete.
| retQ | Queue into which the trasaction is to be returned. |
| sends::transaction::~transaction | ( | void | ) |
Destroy the transaction. Release all allocated resources.
| long sends::transaction::block_seq | ( | void | ) | [inline] |
get block sequence number.
Return and increment reply block sequence number.
| void sends::transaction::add_channel | ( | chan_index | inx | ) |
Add a channel.
Add a channel index to the transaction channel list.
| inx | Index of the channel to be processed. |
| void sends::transaction::clear | ( | void | ) |
Clear transaction descriptor.
| void sends::transaction::clear_channels | ( | void | ) |
Clear the channel list.
Release all segments and clear the channel list.
| transaction::command_code sends::transaction::command | ( | void | ) | const [inline] |
Get command code.
| std::ostream& sends::transaction::dump | ( | std::ostream & | out | ) | const |
Dump out the transaction.
Write a formatted dump of the transaction descriptor to the specified output stream.
| out | Output stream to which the dump will be sent. |
| transaction::gps_type sends::transaction::getChanFill | ( | int | i | ) | const [inline] |
Get fill point.
Get the first gps time needed by the selected channel.
| i | Index into transaction channel list. |
| transaction::chan_index sends::transaction::getChanIndex | ( | int | i | ) | const [inline] |
Get ith channel index.
Get the master channel list index of the ith channel in this transaction.
| i | Index into transaction list of channel. |
| bool sends::transaction::getChanReady | ( | int | i | ) | const [inline] |
Test if channel is ready.
Check whether all data are available in reserved segments for the i'th channel in this transaction.
| i | Cindex into channel list for this transaction. |
| static command_code sends::transaction::getCommandCode | ( | const std::string & | str | ) | [static] |
Get command code.
Convert a command name string into a command code.
| str | Command name string. |
| static const char* sends::transaction::getCommandString | ( | command_code | code | ) | [static] |
Get command string.
Convert a command code into a command name string.
| code | Command code. |
| int sends::transaction::getNChan | ( | void | ) | const [inline] |
Get number of channels.
Get the number of channels requested for this transaction.
| long sends::transaction::get_stage | ( | void | ) | const [inline] |
Get the last stage to have processed this transaction.
Get the number of the last stage to have been processed.
| transaction::gps_type sends::transaction::getStartGPS | ( | void | ) | const [inline] |
| transaction::gps_type sends::transaction::getStopGPS | ( | void | ) | const [inline] |
| transaction::gps_type sends::transaction::getStrideEnd | ( | void | ) | const [inline] |
Get stride end time.
Get the end time of the current stride of this transaction.
| long sends::transaction::ident | ( | void | ) | const [inline] |
| bool sends::transaction::next_stride | ( | void | ) |
Set time for next stride.
The stride start time is set to the end of the current stride. All reserved segments covering the just completed stride are released. If there are more data to be transferrred for this transaction, next_stride treturns true.
| int sends::transaction::put_response | ( | int | resp | ) |
Respond to client.
Sent a response code to the client int he form of a 4-digit hex number.
| resp | Response code. |
| socket_api & sends::transaction::ref_socket | ( | void | ) | [inline] |
Reference OpenSSL bio structure.
Return a reference to the OpenSSL I/O base structure used by this transaction.
| user_data & sends::transaction::ref_user | ( | void | ) | [inline] |
Reference user_data structure.
Return a reference to the user data structure for the user authenticated for this transaction.
| int sends::transaction::read | ( | buffer & | buf | ) |
read a line from the client.
Read a line from the OpenSSL channel ito the specified buffer.
| buf | Buffer into which the client data is to be read. |
| void sends::transaction::error_reply | ( | const std::string & | err | ) |
Send an error to the client.
Send a terminal error message to the client.
| err | Error message to be sent to the client. |
| void sends::transaction::reply | ( | const buffer & | reply | ) |
Send a reply.
Send a reply to the client.
| reply | Buffer containing the reply. |
| void sends::transaction::release | ( | void | ) |
Release the transaction.
Release all transaction resources, close the connection and return the transaction structure to the free transaction queue.
| void sends::transaction::release_segments | ( | void | ) |
release all segments.
Release all segments being used by this transaction.
| void sends::transaction::release_segments | ( | gps_type | before | ) |
Release segments with data before the specified GPS.
Release all of the segments being used by this transaction that contain only data before the specified gps.
| before | Earliest end time for data to be released. |
| void sends::transaction::reserve_segments | ( | void | ) |
Reserve all available segments.
Reserve all available segments whilch will be used by this transaction.
| void sends::transaction::setCommand | ( | command_code | cmd | ) |
| void sends::transaction::setCommand | ( | const std::string & | cmd | ) |
Set the command from a string.
Translate a string to a transaction command code and set the transaction command.
| cmd | Transacton command string. |
| void sends::transaction::set_id | ( | long | tranid | ) |
set the transaction id.
Set the transaction ID (serial number).
| tranid | Transaction serial number. |
| void sends::transaction::set_socket | ( | socket_api * | sock | ) |
Set socket for this transaction.
Identify the communication socket to be used by this transaction.
| sock | Pointer to a socket_api object. |
| void sends::transaction::set_stage | ( | long | s | ) |
Set socket for this transaction.
Identify the communication socket to be used by this transaction.
| sock | Pointer to a socket_api object. |
| void sends::transaction::set_user | ( | const user_data & | user | ) |
Set user data.
Set the user_data describing the user requesting this transaction.
| user | User data structure describing users authorization. |
Set transaction times.
Set the transaction time range and stride. If a stride is specified, the transaction will be divided into a number of replies with the specified length. If the stride is unspecified or zero, a single reply is returned.
| start | Start GPS time. | |
| stop | End GPS time. | |
| stride | Time stride in seconds. |
| transaction::gps_type sends::transaction::stride | ( | void | ) | const [inline] |
Time stride;.
Get the stride length
1.5.5