datasender.hpp
Go to the documentation of this file.
1 /***************************************************************************
2 
3  datasender.hpp - description
4  -------------------
5  begin : Wed August 9 2006
6  copyright : (C) 2006 Bas Kemper
7  (C) 2007 Ruben Smits //Changed subscription structure
8  email : kst@baskemper.be
9  first dot last at mech dot kuleuven dot be
10 
11  ***************************************************************************
12  * This library is free software; you can redistribute it and/or *
13  * modify it under the terms of the GNU Lesser General Public *
14  * License as published by the Free Software Foundation; either *
15  * version 2.1 of the License, or (at your option) any later version. *
16  * *
17  * This library is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
20  * Lesser General Public License for more details. *
21  * *
22  * You should have received a copy of the GNU Lesser General Public *
23  * License along with this library; if not, write to the Free Software *
24  * Foundation, Inc., 59 Temple Place, *
25  * Suite 330, Boston, MA 02111-1307 USA *
26  * *
27  ***************************************************************************/
28 
29 #ifndef ORO_COMP_TCP_DATASENDER
30 #define ORO_COMP_TCP_DATASENDER
31 
32 #include <rtt/Activity.hpp>
33 #include <rtt/os/Mutex.hpp>
34 #include <rtt/Property.hpp>
35 
36 using RTT::os::Mutex;
38 using RTT::Property;
39 using RTT::PropertyBag;
40 
41 namespace RTT
42 {
43  class SocketMarshaller;
44 }
45 namespace OCL{
46 
47  namespace TCP{
48  using namespace RTT;
49  class TcpReportingInterpreter;
50  class Socket;
51 
59  class Datasender
60  : public RTT::Activity
61  {
62  private:
65  void checkbag(const PropertyBag &v);
66  void writeOut(base::PropertyBase* v);
67  void writeOut(const PropertyBag &v);
70  unsigned long long limit;
71  unsigned long long curframe;
72  bool silenced;
74  std::vector<std::string> subscriptions;
75 
76  public:
77  Datasender(RTT::SocketMarshaller* marshaller, Socket* os);
78  virtual ~Datasender();
79 
84  bool isValid() const;
85 
89  void setLimit(unsigned long long newlimit);
90 
94  void serialize(const PropertyBag &v);
95 
99  RTT::SocketMarshaller* getMarshaller() const;
100 
101  bool addSubscription(const std::string name );
102  bool removeSubscription( const std::string& name );
103 
107  void listSubscriptions();
108 
112  Socket& getSocket() const;
113 
117  virtual void loop();
118 
122  virtual bool breakloop();
123 
127  void silence(bool newstate);
128 
132  void remove();
133  };
134 }
135 }
136 #endif
TcpReportingInterpreter * interpreter
Definition: datasender.hpp:64
OCL::TcpReporting * reporter
Definition: datasender.hpp:69
RTT::SocketMarshaller * marshaller
Definition: datasender.hpp:73
A component which writes data reports to a tcp/ip socket. It can serve different clients. It uses a ASCI-based protocol.
unsigned long long curframe
Definition: datasender.hpp:71
void serialize(Archive &a, RTT::ConnPolicy &c, unsigned int)
std::vector< std::string > subscriptions
Definition: datasender.hpp:74
unsigned long long limit
Definition: datasender.hpp:70


ocl
Author(s): OCL Development Team
autogenerated on Mon Mar 23 2020 04:47:19