#include <datasender.hpp>
Public Member Functions | |
bool | addSubscription (const std::string name) |
virtual bool | breakloop () |
Datasender (RTT::SocketMarshaller *marshaller, Socket *os) | |
RTT::SocketMarshaller * | getMarshaller () const |
Socket & | getSocket () const |
bool | isValid () const |
void | listSubscriptions () |
virtual void | loop () |
void | remove () |
bool | removeSubscription (const std::string &name) |
void | serialize (const PropertyBag &v) |
void | setLimit (unsigned long long newlimit) |
void | silence (bool newstate) |
virtual | ~Datasender () |
Private Member Functions | |
void | checkbag (const PropertyBag &v) |
void | writeOut (base::PropertyBase *v) |
void | writeOut (const PropertyBag &v) |
Private Attributes | |
unsigned long long | curframe |
TcpReportingInterpreter * | interpreter |
unsigned long long | limit |
os::Mutex | lock |
RTT::SocketMarshaller * | marshaller |
Socket * | os |
OCL::TcpReporting * | reporter |
bool | silenced |
std::vector< std::string > | subscriptions |
This class manages the connection with one single client. It is responsible for sending data to the client and managing the state of the client.
It has a thread responsible for reading data from the socket.
Definition at line 59 of file datasender.hpp.
OCL::TCP::Datasender::Datasender | ( | RTT::SocketMarshaller * | marshaller, |
Socket * | os | ||
) |
Definition at line 44 of file datasender.cpp.
OCL::TCP::Datasender::~Datasender | ( | ) | [virtual] |
Definition at line 54 of file datasender.cpp.
bool OCL::TCP::Datasender::addSubscription | ( | const std::string | name | ) |
Definition at line 92 of file datasender.cpp.
bool OCL::TCP::Datasender::breakloop | ( | ) | [virtual] |
Try to finish this thread.
Definition at line 71 of file datasender.cpp.
void OCL::TCP::Datasender::checkbag | ( | const PropertyBag & | v | ) | [private] |
Definition at line 179 of file datasender.cpp.
Return the marshaller.
Definition at line 77 of file datasender.cpp.
Socket & OCL::TCP::Datasender::getSocket | ( | ) | const |
Get socket associated with this datasender.
Definition at line 82 of file datasender.cpp.
bool OCL::TCP::Datasender::isValid | ( | ) | const |
Returns true if the connection of the datasender is valid, false otherwise.
Definition at line 87 of file datasender.cpp.
Write a list of the current subscriptions to the socket.
Definition at line 146 of file datasender.cpp.
void OCL::TCP::Datasender::loop | ( | ) | [virtual] |
Data connection main loop
Reimplemented from RTT::Activity.
Definition at line 61 of file datasender.cpp.
void OCL::TCP::Datasender::remove | ( | ) |
Remove this connection
Definition at line 121 of file datasender.cpp.
bool OCL::TCP::Datasender::removeSubscription | ( | const std::string & | name | ) |
Definition at line 126 of file datasender.cpp.
void OCL::TCP::Datasender::serialize | ( | const PropertyBag & | v | ) |
Send data to the client.
Definition at line 207 of file datasender.cpp.
void OCL::TCP::Datasender::setLimit | ( | unsigned long long | newlimit | ) |
Only frames up to frame <newlimit> will be processed.
Definition at line 202 of file datasender.cpp.
void OCL::TCP::Datasender::silence | ( | bool | newstate | ) |
Disable/enable output of data
Definition at line 197 of file datasender.cpp.
void OCL::TCP::Datasender::writeOut | ( | base::PropertyBase * | v | ) | [private] |
Definition at line 154 of file datasender.cpp.
void OCL::TCP::Datasender::writeOut | ( | const PropertyBag & | v | ) | [private] |
Definition at line 166 of file datasender.cpp.
unsigned long long OCL::TCP::Datasender::curframe [private] |
Definition at line 71 of file datasender.hpp.
Definition at line 64 of file datasender.hpp.
unsigned long long OCL::TCP::Datasender::limit [private] |
Definition at line 70 of file datasender.hpp.
os::Mutex OCL::TCP::Datasender::lock [private] |
Definition at line 63 of file datasender.hpp.
Definition at line 73 of file datasender.hpp.
Socket* OCL::TCP::Datasender::os [private] |
Definition at line 68 of file datasender.hpp.
OCL::TcpReporting* OCL::TCP::Datasender::reporter [private] |
Definition at line 69 of file datasender.hpp.
bool OCL::TCP::Datasender::silenced [private] |
Definition at line 72 of file datasender.hpp.
std::vector<std::string> OCL::TCP::Datasender::subscriptions [private] |
Definition at line 74 of file datasender.hpp.