##

SubscriptionTransport.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _SUBSCRIPTIONTRANSPORT_HH_
#define _SUBSCRIPTIONTRANSPORT_HH_
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <string>
#include "Connection.hh"
#include "CallbackHelper.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace transport
{
class GZ_TRANSPORT_VISIBLE SubscriptionTransport : public CallbackHelper
{
public: SubscriptionTransport();
public: virtual ~SubscriptionTransport();
public: void Init(ConnectionPtr _conn, bool _latching);
public: virtual bool HandleData(const std::string &_newdata,
boost::function<void(uint32_t)> _cb, uint32_t _id);
// Documentation inherited
public: virtual bool HandleMessage(MessagePtr _newMsg);
public: const ConnectionPtr &GetConnection() const;
public: virtual bool IsLocal() const;
private: ConnectionPtr connection;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::transport::MessagePtr
boost::shared_ptr< google::protobuf::Message > MessagePtr
Definition: TransportTypes.hh:45
Connection.hh
gazebo::transport::CallbackHelper
A helper class to handle callbacks when messages arrive.
Definition: CallbackHelper.hh:44
gazebo::transport::SubscriptionTransport::GetConnection
const ConnectionPtr & GetConnection() const
Get the connection we're using.
system.hh
gazebo::transport::SubscriptionTransport::~SubscriptionTransport
virtual ~SubscriptionTransport()
Destructor.
CallbackHelper.hh
gazebo::transport::SubscriptionTransport::IsLocal
virtual bool IsLocal() const
Is the callback local?
gazebo::transport::SubscriptionTransport::Init
void Init(ConnectionPtr _conn, bool _latching)
Initialize the publication link.
gazebo::transport::ConnectionPtr
boost::shared_ptr< Connection > ConnectionPtr
Definition: Connection.hh:50
gazebo::transport::SubscriptionTransport::HandleMessage
virtual bool HandleMessage(MessagePtr _newMsg)
Process new incoming message.
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::transport::SubscriptionTransport::SubscriptionTransport
SubscriptionTransport()
Constructor.
gazebo::transport::SubscriptionTransport::HandleData
virtual bool HandleData(const std::string &_newdata, boost::function< void(uint32_t)> _cb, uint32_t _id)
Output a message to a connection.
transport
transport
Definition: ConnectionManager.hh:35
gazebo::transport::SubscriptionTransport
Handles sending data over the wire to remote subscribers.
Definition: SubscriptionTransport.hh:39