pxmlw6n2f/Gazebo_Distributed_TCP/gazebo/physics/Distribution.hh

100 lines
2.6 KiB
C++

/*
* Copyright (C) 2019 AIRC 01
*
* 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
* distribution under the License is distribution 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: Base class for distribution simualtion
* Author: Zhang Shuai
* Date: 28 March 2019
*/
#ifndef _DISTRIBUTION_HH_
#define _DISTRIBUTION_HH_
#include <string>
// #include <map>
#include <vector>
#include <boost/function.hpp>
// #include <boost/thread/recursive_mutex.hpp>
#include <sdf/sdf.hh>
// #include "gazebo/common/CommonTypes.hh"
#include "gazebo/physics/PhysicsTypes.hh"
// #include "gazebo/physics/ModelState.hh"
// #include "gazebo/physics/Entity.hh"
#include "gazebo/util/system.hh"
#include "gazebo/physics/GazeboID.hh"
namespace gazebo
{
namespace physics
{
/// \class Distribution Distribution.hh physics/physics.hh
/// \brief Distribution is used to store information about the distribution simulation.
class GZ_PHYSICS_VISIBLE Distribution
{
/// \brief Constructor.
/// \param[in] _parent Parent object.
public:
explicit Distribution();
/// \brief Destructor.
public:
virtual ~Distribution();
/// \brief Load the Distribution.
/// \param[in] _sdf SDF parameters to load from.
public:
void Load(sdf::ElementPtr _sdf);
/// \brief Get the gazebo ID of the specified gazebo.
/// \param[in] _i Number of the gazebo ID to get.
/// \return the gazebo ID of the specified gazebo.
public:
unsigned int GetGazeboID(unsigned int _i);
/// \brief Get the gazebo ID pointer of the specified gazebo.
/// \param[in] _i Number of the gazebo ID to get.
/// \return the gazebo ID pointer of the specified gazebo.
public:
GazeboIDPtr GetGazeboIDPtr(unsigned int _gazeboID);
/// \brief Get the number of Gazebos this Distribution has.
/// \return Number of Gazebos associated with this Distribution.
public:
unsigned int GetGazeboCount();
/// \brief Finialize the Distribution
public:
void Fini();
/// \brief The Distribution's current SDF description.
private:
sdf::ElementPtr sdf;
// /// \brief Gazebos' ID in this distribution gazebo.
// private:
// std::vector<unsigned int> gazeboIDs;
/// \brief Gazebos' ID in this distribution gazebo.
private:
GazeboID_V gazeboIDs;
};
} // namespace physics
} // namespace gazebo
#endif