#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 () |
Public Member Functions inherited from RTT::Activity | |
Activity (base::RunnableInterface *r=0, const std::string &name="Activity") | |
Activity (int priority, base::RunnableInterface *r=0, const std::string &name="Activity") | |
Activity (int scheduler, int priority, base::RunnableInterface *r=0, const std::string &name="Activity") | |
Activity (int scheduler, int priority, Seconds period, base::RunnableInterface *r=0, const std::string &name="Activity") | |
Activity (int priority, Seconds period, base::RunnableInterface *r=0, const std::string &name="Activity") | |
Activity (int scheduler, int priority, Seconds period, unsigned cpu_affinity, base::RunnableInterface *r=0, const std::string &name="Activity") | |
virtual bool | breakLoop () |
virtual bool | execute () |
virtual void | finalize () |
virtual unsigned | getCpuAffinity () const |
virtual Seconds | getPeriod () const |
virtual bool | initialize () |
virtual bool | isActive () const |
virtual bool | isPeriodic () const |
virtual bool | isRunning () const |
virtual bool | setCpuAffinity (unsigned cpu) |
virtual bool | setPeriod (Seconds period) |
void | setWaitPeriodPolicy (int p) |
virtual bool | start () |
virtual void | step () |
virtual bool | stop () |
virtual os::ThreadInterface * | thread () |
virtual bool | timeout () |
virtual bool | trigger () |
virtual void | work (base::RunnableInterface::WorkReason reason) |
virtual | ~Activity () |
Public Member Functions inherited from RTT::base::ActivityInterface | |
ActivityInterface () | |
ActivityInterface (RunnableInterface *run) | |
virtual RunnableInterface * | getRunner () const |
virtual bool | run (RunnableInterface *r) |
virtual | ~ActivityInterface () |
Public Member Functions inherited from RTT::os::Thread | |
virtual int | getMaxOverrun () const |
virtual const char * | getName () const |
void | getPeriod (secs &s, nsecs &ns) const |
virtual nsecs | getPeriodNS () const |
virtual unsigned int | getPid () const |
virtual int | getPriority () const |
virtual int | getScheduler () const |
Seconds | getStopTimeout () const |
virtual RTOS_TASK * | getTask () |
virtual const RTOS_TASK * | getTask () const |
virtual void | setMaxOverrun (int m) |
bool | setPeriod (Seconds s) |
bool | setPeriod (TIME_SPEC p) |
bool | setPeriod (secs s, nsecs ns) |
virtual bool | setPriority (int priority) |
virtual bool | setScheduler (int sched_type) |
void | setStopTimeout (Seconds s) |
Thread (int scheduler, int priority, double period, unsigned cpu_affinity, const std::string &name) | |
virtual void | yield () |
virtual | ~Thread () |
Public Member Functions inherited from RTT::os::ThreadInterface | |
bool | isSelf () const |
ThreadInterface () | |
unsigned int | threadNumber () const |
virtual | ~ThreadInterface () |
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 |
Additional Inherited Members | |
Public Types inherited from RTT::base::ActivityInterface | |
typedef boost::shared_ptr< ActivityInterface > | shared_ptr |
Static Public Member Functions inherited from RTT::os::Thread | |
static void | setLockTimeoutNoPeriod (double timeout_in_s) |
static void | setLockTimeoutPeriodFactor (double factor) |
static void | setStackSize (unsigned int ssize) |
Protected Member Functions inherited from RTT::base::ActivityInterface | |
void | disableRun (RunnableInterface *caller) |
Protected Member Functions inherited from RTT::os::Thread | |
void | emergencyStop () |
void | terminate () |
Protected Attributes inherited from RTT::Activity | |
os::Condition | msg_cond |
os::Mutex | msg_lock |
bool | mstopRequested |
bool | mtimeout |
int | mwaitpolicy |
double | update_period |
Protected Attributes inherited from RTT::base::ActivityInterface | |
RunnableInterface * | runner |
Protected Attributes inherited from RTT::os::Thread | |
bool | active |
MutexRecursive | breaker |
bool | inloop |
int | maxOverRun |
int | msched_type |
NANO_TIME | period |
bool | prepareForExit |
RTOS_TASK | rtos_task |
bool | running |
rt_sem_t | sem |
double | stopTimeout |
Protected Attributes inherited from RTT::os::ThreadInterface | |
int | threadnb |
Static Protected Attributes inherited from RTT::os::Thread | |
static unsigned int | default_stack_size |
static double | lock_timeout_no_period_in_s |
static double | lock_timeout_period_factor |
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.
|
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.
|
virtual |
Try to finish this thread.
Definition at line 71 of file datasender.cpp.
|
private |
Definition at line 179 of file datasender.cpp.
RTT::SocketMarshaller * OCL::TCP::Datasender::getMarshaller | ( | ) | const |
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.
void OCL::TCP::Datasender::listSubscriptions | ( | ) |
Write a list of the current subscriptions to the socket.
Definition at line 146 of file datasender.cpp.
|
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.
|
private |
Definition at line 154 of file datasender.cpp.
|
private |
Definition at line 166 of file datasender.cpp.
|
private |
Definition at line 71 of file datasender.hpp.
|
private |
Definition at line 64 of file datasender.hpp.
|
private |
Definition at line 70 of file datasender.hpp.
|
private |
Definition at line 63 of file datasender.hpp.
|
private |
Definition at line 73 of file datasender.hpp.
|
private |
Definition at line 68 of file datasender.hpp.
|
private |
Definition at line 69 of file datasender.hpp.
|
private |
Definition at line 72 of file datasender.hpp.
|
private |
Definition at line 74 of file datasender.hpp.