OrocosComponentLibrary  2.8.3
socketmarshaller.hpp
1 /***************************************************************************
2 
3  socketmarshaller.hpp - description
4  -------------------
5  begin : Mon August 7 2006
6  copyright : (C) 2006 Bas Kemper
7  email : kst@baskemper.be
8 
9  ***************************************************************************
10  * This library is free software; you can redistribute it and/or *
11  * modify it under the terms of the GNU Lesser General Public *
12  * License as published by the Free Software Foundation; either *
13  * version 2.1 of the License, or (at your option) any later version. *
14  * *
15  * This library is distributed in the hope that it will be useful, *
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18  * Lesser General Public License for more details. *
19  * *
20  * You should have received a copy of the GNU Lesser General Public *
21  * License along with this library; if not, write to the Free Software *
22  * Foundation, Inc., 59 Temple Place, *
23  * Suite 330, Boston, MA 02111-1307 USA *
24  * *
25  ***************************************************************************/
26 
27 #ifndef ORO_COMP_SOCKET_MARSHALLER
28 #define ORO_COMP_SOCKET_MARSHALLER
29 
30 #include <rtt/Property.hpp>
31 #include <rtt/marsh/MarshallInterface.hpp>
32 #include <rtt/os/Mutex.hpp>
33 #include <list>
34 
35 namespace OCL
36 {
37 class TcpReporting;
38 namespace TCP
39 {
40  class Datasender;
41  class Socket;
42 }
43 }
44 
45 namespace RTT
46 {
51  : public marsh::MarshallInterface
52  {
53  private:
54  RTT::os::MutexRecursive lock;
55  std::list<OCL::TCP::Datasender*> _connections;
56  OCL::TcpReporting* _reporter;
57 
58  public:
61  virtual void flush();
62  virtual void serialize(RTT::base::PropertyBase*);
63  virtual void serialize(const PropertyBag &v);
64  void addConnection(OCL::TCP::Socket* os);
65  void removeConnection(OCL::TCP::Datasender* sender);
66  void closeAllConnections();
67  void shutdown();
68  OCL::TcpReporting* getReporter() const;
69  };
70 }
71 #endif
This class manages the connection with one single client.
Definition: datasender.hpp:59
A component which writes data reports to a tcp/ip socket.
marsh::MarshallInterface which sends data to multiple sockets.
The Orocos Component Library.
Definition: Component.hpp:43
Definition: Category.hpp:10