##

ExistenceEventSource.hh
Go to the documentation of this file.
/*
* Copyright (C) 2014 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 GAZEBO_PLUGINS_EXISTENCEVENTSOURCE_HH_
#define GAZEBO_PLUGINS_EXISTENCEVENTSOURCE_HH_
#include <string>
#include "EventSource.hh"
namespace gazebo
{
class ExistenceEventSource: public EventSource
{
public: ExistenceEventSource(transport::PublisherPtr _pub,
physics::WorldPtr _world);
public: virtual void Load(const sdf::ElementPtr _sdf);
public: void OnExistence(const std::string &_model, bool _alive);
private: std::string model;
private: event::ConnectionPtr existenceConnection;
};
}
#endif
gazebo::ExistenceEventSource::OnExistence
void OnExistence(const std::string &_model, bool _alive)
callback for gazebo event
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::transport::PublisherPtr
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
EventSource.hh
gazebo::ExistenceEventSource::ExistenceEventSource
ExistenceEventSource(transport::PublisherPtr _pub, physics::WorldPtr _world)
Constructor.
gazebo::event::ConnectionPtr
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
gazebo::EventSource
The base class for emitting SimEvents.
Definition: EventSource.hh:34
gazebo::ExistenceEventSource::Load
virtual void Load(const sdf::ElementPtr _sdf)
Reads the model filter and event name.
gazebo::physics::WorldPtr
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
gazebo::ExistenceEventSource
Definition: ExistenceEventSource.hh:27