|
ICAROUS
|
#include <DataServer.h>
Public Member Functions | |
| void | addTransmitter (const std::string &address, Transmitter *t) |
| Transmitter * | getTransmitter (const std::string &address) const |
| void | removeTransmitter (const std::string &address) |
| void | advertiseAll (const std::string &keyword) |
| void | advertiseOne (const std::string &address, const std::string &keyword) |
| void | update (const std::string &keyword, const std::string &data) |
| bool | hasClients (const std::string &keyword) const |
| void | updateGeneralStates (const std::vector< GeneralState > &p) |
| void | updateGeneralStates (const std::vector< GeneralState > &p, const ParameterData &pd) |
| void | updateGeneralPlans (const std::vector< GeneralPlan > &p) |
| void | updateGeneralPlans (const std::vector< GeneralPlan > &p, const ParameterData &pd) |
| void | updateParameters (const ParameterData &p) |
| void | updateString (const std::string &s) |
| void | updateString (const std::string &keyword, const std::string &s) |
Private Attributes | |
| std::map< std::string, Transmitter * > | transmitters |
| std::string | word |
This class represents a wrapper for a collection of Transmitter object that represents a server's behavior. The server takes updates to plan, state, and/or parameter information and parcels it out to its various Transmitter object. Each Transmitter is intended to handle a certain type of request (e.g. for plan information that is updated every second and sent over a socket) and handles distributing the information to its clients. The particulars of the transmission of data are handled by the provided Transmitters.
Known keywords: GeneralState, GeneralPlan, ParameterData, String
| void larcfm::DataServer::addTransmitter | ( | const std::string & | address, |
| Transmitter * | t | ||
| ) |
Add a transmitter at a given address that will listen for clients
| address | This will replace any existing transmitter at this address. |
| t | Pointer to transmitter to be added. The destructor of this class will destroy all Transmitters included in it. |
| void larcfm::DataServer::advertiseAll | ( | const std::string & | keyword | ) |
Tell any clients that connect and ask what sort of data you provide. This propagates the same keyword to all current and future transmitters
| keyword |
| void larcfm::DataServer::advertiseOne | ( | const std::string & | address, |
| const std::string & | keyword | ||
| ) |
Associate a keyword with one particular Transmitter. This does not affect other Transmitters.
| address | |
| keyword |
| Transmitter * larcfm::DataServer::getTransmitter | ( | const std::string & | address | ) | const |
Return the transmitter associated with a given address. This will return null if no transmitter is associated with the given address. Note: The destructor of this class will destroy all Transmitters included in it.
| address |
| bool larcfm::DataServer::hasClients | ( | const std::string & | keyword | ) | const |
Return true if this server has any clients looking for the given keyword
| keyword |
| void larcfm::DataServer::removeTransmitter | ( | const std::string & | address | ) |
Delete the transmitter associated with an address, if there is one. This will destroy the Transmitter object.
| address |
| void larcfm::DataServer::update | ( | const std::string & | keyword, |
| const std::string & | data | ||
| ) |
Transmit String with user-specified keyword
| keyword | |
| data |
| void larcfm::DataServer::updateGeneralPlans | ( | const std::vector< GeneralPlan > & | p | ) |
Transmit a set of plans
| void larcfm::DataServer::updateGeneralStates | ( | const std::vector< GeneralState > & | p | ) |
Transmit a set of states
| void larcfm::DataServer::updateParameters | ( | const ParameterData & | p | ) |
Transmit a ParameterData object
| void larcfm::DataServer::updateString | ( | const std::string & | keyword, |
| const std::string & | s | ||
| ) |
Transmit a string with some associated keyword
| keyword | |
| s |
| void larcfm::DataServer::updateString | ( | const std::string & | s | ) |
Transmit a string