SubscriptionTransport.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _SUBSCRIPTIONTRANSPORT_HH_
18 #define _SUBSCRIPTIONTRANSPORT_HH_
19 
20 #include <boost/shared_ptr.hpp>
21 #include <string>
22 
23 #include "Connection.hh"
24 #include "CallbackHelper.hh"
25 #include "gazebo/util/system.hh"
26 
27 namespace gazebo
28 {
29  namespace transport
30  {
33 
39  {
41  public: SubscriptionTransport();
42 
44  public: virtual ~SubscriptionTransport();
45 
50  public: void Init(ConnectionPtr _conn, bool _latching);
51 
58  public: virtual bool HandleData(const std::string &_newdata,
59  boost::function<void(uint32_t)> _cb, uint32_t _id);
60 
61  // Documentation inherited
62  public: virtual bool HandleMessage(MessagePtr _newMsg);
63 
66  public: const ConnectionPtr &GetConnection() const;
67 
71  public: virtual bool IsLocal() const;
72 
73  private: ConnectionPtr connection;
74  };
76  }
77 }
78 
79 #endif
boost::shared_ptr< Connection > ConnectionPtr
Definition: Connection.hh:50
A helper class to handle callbacks when messages arrive.
Definition: CallbackHelper.hh:43
transport/transport.hh
Definition: SubscriptionTransport.hh:38
boost::shared_ptr< google::protobuf::Message > MessagePtr
Definition: TransportTypes.hh:45
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48