##

Subscriber.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.
*
*/
/* Desc: Handles a subscription to a topic
* Author: Nate Koenig
*/
#ifndef GAZEBO_TRANSPORT_SUBSCRIBER_HH_
#define GAZEBO_TRANSPORT_SUBSCRIBER_HH_
#include <string>
#include <boost/shared_ptr.hpp>
#include "gazebo/transport/CallbackHelper.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace transport
{
class GZ_TRANSPORT_VISIBLE Subscriber
{
public: Subscriber(const std::string &_topic, NodePtr _node);
public: virtual ~Subscriber();
public: void SetCallbackId(unsigned int _id);
public: unsigned int GetCallbackId() const;
public: std::string GetTopic() const;
public: void Unsubscribe() const;
private: std::string topic;
private: NodePtr node;
private: unsigned int callbackId;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::transport::Subscriber::Unsubscribe
void Unsubscribe() const
Unsubscribe from the topic.
gazebo::transport::Subscriber
A subscriber to a topic.
Definition: Subscriber.hh:39
system.hh
gazebo::transport::Subscriber::GetCallbackId
unsigned int GetCallbackId() const
CallbackHelper.hh
gazebo::transport::NodePtr
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
gazebo::transport::Subscriber::GetTopic
std::string GetTopic() const
Get the topic name.
gazebo::transport::Subscriber::Subscriber
Subscriber(const std::string &_topic, NodePtr _node)
Constructor.
gazebo::transport::Subscriber::SetCallbackId
void SetCallbackId(unsigned int _id)
transport
transport
Definition: ConnectionManager.hh:35
gazebo::transport::Subscriber::~Subscriber
virtual ~Subscriber()
Destructor.