Skip to content

Commit

Permalink
style fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanyen committed Jan 30, 2019
1 parent 4f0519f commit 7f46524
Show file tree
Hide file tree
Showing 23 changed files with 40 additions and 74 deletions.
8 changes: 4 additions & 4 deletions gazebo/common/EnumIface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ namespace gazebo
#define GZ_ENUM(visibility, enumType, begin, end, ...) \
template<> visibility enumType \
common::EnumIface<enumType>::range[] = {begin, end}; \
template<> visibility \
std::vector<std::string> common::EnumIface<enumType>::names = {__VA_ARGS__};
template<> visibility std::vector<std::string> \
common::EnumIface<enumType>::names = {__VA_ARGS__};
#else
#define GZ_ENUM(visibility, enumType, begin, end, ...) \
template<> enumType \
common::EnumIface<enumType>::range[] = {begin, end}; \
template<> \
std::vector<std::string> common::EnumIface<enumType>::names = {__VA_ARGS__}; \
template<> std::vector<std::string> \
common::EnumIface<enumType>::names = {__VA_ARGS__}; \
template class visibility common::EnumIface<enumType>;
#endif

Expand Down
2 changes: 1 addition & 1 deletion gazebo/common/FuelModelDatabase.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define GZ_MODEL_DB_MANIFEST_FILENAME "database.config"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_COMMON_VISIBLE, gazebo::common::FuelModelDatabase)
GZ_SINGLETON_DECLARE(GZ_COMMON_VISIBLE, gazebo, common, FuelModelDatabase)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/common/MeshManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_COMMON_VISIBLE, gazebo::common::MeshManager)
GZ_SINGLETON_DECLARE(GZ_COMMON_VISIBLE, gazebo, common, MeshManager)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/common/ModelDatabase.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define GZ_MODEL_DB_MANIFEST_FILENAME "database.config"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_COMMON_VISIBLE, gazebo::common::ModelDatabase)
GZ_SINGLETON_DECLARE(GZ_COMMON_VISIBLE, gazebo, common, ModelDatabase)

namespace gazebo
{
Expand Down
56 changes: 10 additions & 46 deletions gazebo/common/SingletonT.hh
Original file line number Diff line number Diff line change
Expand Up @@ -59,55 +59,19 @@ class SingletonT
template <class T>
T &SingletonT<T>::myself = SingletonT<T>::GetInstance();

/// \brief Forward declarations for later explicit instantiation of typed SingletonT
namespace gazebo
{
namespace common
{
class FuelModelDatabase;
class MeshManager;
class ModelDatabase;
class SystemPaths;
}
namespace gui
{
class KeyEventHandler;
class ModelAlign;
class ModelManipulator;
class ModelSnap;
class MouseEventHandler;
class PlotManager;
}
namespace rendering
{
class RenderEngine;
class RTShaderSystem;
}
namespace sensors
{
class SensorManager;
}
namespace transport
{
class ConnectionManager;
class TopicManager;
}
namespace util
{
class DiagnosticManager;
class IntrospectionManager;
class LogPlay;
class LogRecord;
class OpenAL;
}
}

/// \brief Helper to declare typed SingletonT
#ifdef __clang__
#define GZ_SINGLETON_DECLARE(visibility, singletonType)
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
#else
#define GZ_SINGLETON_DECLARE(visibility, singletonType) \
template class visibility ::SingletonT<singletonType>;
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType) \
namespace n1 \
{ \
namespace n2 \
{ \
class singletonType; \
} \
} \
template class visibility ::SingletonT<n1::n2::singletonType>;
#endif

/// \}
Expand Down
2 changes: 1 addition & 1 deletion gazebo/common/SystemPaths.hh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_COMMON_VISIBLE, gazebo::common::SystemPaths)
GZ_SINGLETON_DECLARE(GZ_COMMON_VISIBLE, gazebo, common, SystemPaths)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/gui/KeyEventHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo::gui::KeyEventHandler)
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo, gui, KeyEventHandler)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/gui/ModelAlign.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo::gui::ModelAlign)
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo, gui, ModelAlign)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/gui/ModelManipulator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo::gui::ModelManipulator)
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo, gui, ModelManipulator)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/gui/ModelSnap.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo::gui::ModelSnap)
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo, gui, ModelSnap)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/gui/MouseEventHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo::gui::MouseEventHandler)
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo, gui, MouseEventHandler)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/gui/plot/PlotManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo::gui::PlotManager)
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo, gui, PlotManager)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/rendering/RTShaderSystem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_RENDERING_VISIBLE, gazebo::rendering::RTShaderSystem)
GZ_SINGLETON_DECLARE(GZ_RENDERING_VISIBLE, gazebo, rendering, RTShaderSystem)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/rendering/RenderEngine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_RENDERING_VISIBLE, gazebo::rendering::RenderEngine)
GZ_SINGLETON_DECLARE(GZ_RENDERING_VISIBLE, gazebo, rendering, RenderEngine)

namespace Ogre
{
Expand Down
10 changes: 6 additions & 4 deletions gazebo/sensors/SensorFactory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,21 @@ namespace gazebo
/// \brief Register a sensor class (called by sensor registration function).
/// \param[in] _className Name of class of sensor to register.
/// \param[in] _factoryfn Function handle for registration.
public: GZ_SENSORS_VISIBLE static void RegisterSensor(const std::string &_className,
SensorFactoryFn _factoryfn);
public: GZ_SENSORS_VISIBLE static void RegisterSensor(
const std::string &_className, SensorFactoryFn _factoryfn);

/// \brief Create a new instance of a sensor. Used by the world when
/// reading the world file.
/// \param[in] _className Name of sensor class
/// \return Pointer to Sensor
public: GZ_SENSORS_VISIBLE static SensorPtr NewSensor(const std::string &_className);
public: GZ_SENSORS_VISIBLE static SensorPtr NewSensor(
const std::string &_className);

/// \brief Get all the sensor types
/// \param _types Vector of strings of the sensor types,
/// populated by function
public: GZ_SENSORS_VISIBLE static void GetSensorTypes(std::vector<std::string> &_types);
public: GZ_SENSORS_VISIBLE static void GetSensorTypes(
std::vector<std::string> &_types);

/// \brief A list of registered sensor classes
private: static std::map<std::string, SensorFactoryFn> sensorMap;
Expand Down
2 changes: 1 addition & 1 deletion gazebo/sensors/SensorManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_SENSORS_VISIBLE, gazebo::sensors::SensorManager)
GZ_SINGLETON_DECLARE(GZ_SENSORS_VISIBLE, gazebo, sensors, SensorManager)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/transport/ConnectionManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_TRANSPORT_VISIBLE, gazebo::transport::ConnectionManager)
GZ_SINGLETON_DECLARE(GZ_TRANSPORT_VISIBLE, gazebo, transport, ConnectionManager)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/transport/TopicManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_TRANSPORT_VISIBLE, gazebo::transport::TopicManager)
GZ_SINGLETON_DECLARE(GZ_TRANSPORT_VISIBLE, gazebo, transport, TopicManager)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/util/Diagnostics.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo::util::DiagnosticManager)
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo, util, DiagnosticManager)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/util/IntrospectionManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo::util::IntrospectionManager)
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo, util, IntrospectionManager)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/util/LogPlay.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "gazebo/util/system.hh"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo::util::LogPlay)
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo, util, LogPlay)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/util/LogRecord.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define GZ_LOG_VERSION "1.0"

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo::util::LogRecord)
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo, util, LogRecord)

namespace gazebo
{
Expand Down
2 changes: 1 addition & 1 deletion gazebo/util/OpenAL.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#ifdef HAVE_OPENAL

/// \brief Explicit instantiation for typed SingletonT.
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo::util::OpenAL)
GZ_SINGLETON_DECLARE(GZ_UTIL_VISIBLE, gazebo, util, OpenAL)

namespace gazebo
{
Expand Down

0 comments on commit 7f46524

Please sign in to comment.