Public Member Functions | Private Member Functions | Private Attributes | List of all members
OCL::TCP::Datasender Class Reference

#include <datasender.hpp>

Inheritance diagram for OCL::TCP::Datasender:
Inheritance graph
[legend]

Public Member Functions

bool addSubscription (const std::string name)
 
virtual bool breakloop ()
 
 Datasender (RTT::SocketMarshaller *marshaller, Socket *os)
 
RTT::SocketMarshallergetMarshaller () const
 
SocketgetSocket () 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::ThreadInterfacethread ()
 
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 RunnableInterfacegetRunner () 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_TASKgetTask ()
 
virtual const RTOS_TASKgetTask () 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
 
TcpReportingInterpreterinterpreter
 
unsigned long long limit
 
os::Mutex lock
 
RTT::SocketMarshallermarshaller
 
Socketos
 
OCL::TcpReportingreporter
 
bool silenced
 
std::vector< std::string > subscriptions
 

Additional Inherited Members

- Public Types inherited from RTT::base::ActivityInterface
typedef boost::shared_ptr< ActivityInterfaceshared_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
RunnableInterfacerunner
 
- 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
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.

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.

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.

Member Data Documentation

unsigned long long OCL::TCP::Datasender::curframe
private

Definition at line 71 of file datasender.hpp.

TcpReportingInterpreter* OCL::TCP::Datasender::interpreter
private

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.

RTT::SocketMarshaller* OCL::TCP::Datasender::marshaller
private

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.


The documentation for this class was generated from the following files:


ocl
Author(s): OCL Development Team
autogenerated on Wed Jun 26 2019 19:26:27