##

UserCmdManager.hh
Go to the documentation of this file.
/*
* Copyright (C) 2015 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_PHYSICS_USERCMDMANAGER_HH_
#define GAZEBO_PHYSICS_USERCMDMANAGER_HH_
#include <string>
#include "gazebo/transport/TransportTypes.hh"
#include "gazebo/msgs/msgs.hh"
#include "gazebo/physics/PhysicsTypes.hh"
namespace gazebo
{
namespace physics
{
class UserCmdPrivate;
class GZ_PHYSICS_VISIBLE UserCmd
{
public: UserCmd(const unsigned int _id,
physics::WorldPtr _world,
const std::string &_description,
const msgs::UserCmd::Type &_type);
public: virtual ~UserCmd();
public: virtual void Undo();
public: virtual void Redo();
public: unsigned int Id() const;
public: std::string Description() const;
public: msgs::UserCmd::Type Type() const;
protected: UserCmdPrivate *dataPtr;
};
class UserCmdManagerPrivate;
class GZ_PHYSICS_VISIBLE UserCmdManager
{
public: explicit UserCmdManager(const WorldPtr _world);
public: virtual ~UserCmdManager();
private: void OnUserCmdMsg(ConstUserCmdPtr &_msg);
private: void OnUndoRedoMsg(ConstUndoRedoPtr &_msg);
private: void PublishCurrentStats();
private: UserCmdManagerPrivate *dataPtr;
};
}
}
#endif
gazebo::physics::UserCmd::Description
std::string Description() const
Return this command's description.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::physics::UserCmd::Type
msgs::UserCmd::Type Type() const
Return this command's type.
gazebo::physics::UserCmdManager::~UserCmdManager
virtual ~UserCmdManager()
Destructor.
gazebo::physics::UserCmdManager::UserCmdManager
UserCmdManager(const WorldPtr _world)
Constructor.
TransportTypes.hh
Forward declarations for transport.
msgs.hh
PhysicsTypes.hh
default namespace for gazebo
gazebo::physics::UserCmd::Redo
virtual void Redo()
Redo this command.
gazebo::physics::UserCmd::Id
unsigned int Id() const
Return this command's unique ID.
gazebo::physics::UserCmd::Undo
virtual void Undo()
Undo this command.
gazebo::physics::UserCmd::~UserCmd
virtual ~UserCmd()
Destructor.
gazebo::physics::UserCmd::dataPtr
UserCmdPrivate * dataPtr
Definition: UserCmdManager.hh:71
gazebo::physics::UserCmd
Class which represents a user command, which can be "undone" and "redone".
Definition: UserCmdManager.hh:35
gazebo::physics::UserCmdManager
Manages user commands from the server side.
Definition: UserCmdManager.hh:77
gazebo::physics::UserCmd::UserCmd
UserCmd(const unsigned int _id, physics::WorldPtr _world, const std::string &_description, const msgs::UserCmd::Type &_type)
Constructor.
gazebo::physics::WorldPtr
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89