Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove invalid visibility macros to fix Windows compilation #565

Merged
merged 6 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions include/ignition/gazebo/System.hh
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ namespace ignition
/// explains why UpdateInfo::simTime is initially 0 if simulation is started
/// paused, while UpdateInfo::simTime is initially UpdateInfo::dt if
/// simulation is started un-paused.
class IGNITION_GAZEBO_VISIBLE System
class System
{
/// \brief Constructor
public: System();
public: System() = default;

/// \brief Destructor
public: virtual ~System();
public: virtual ~System() = default;
};

/// \class ISystemConfigure ISystem.hh ignition/gazebo/System.hh
Expand All @@ -85,7 +85,7 @@ namespace ignition
/// Configure is called after the system is instatiated and all entities
/// and components are loaded from the corresponding SDF world, and before
/// simulation begins exectution.
class IGNITION_GAZEBO_VISIBLE ISystemConfigure {
class ISystemConfigure {
/// \brief Configure the system
/// \param[in] _entity The entity this plugin is attached to.
/// \param[in] _sdf The SDF Element associated with this system plugin.
Expand All @@ -102,21 +102,21 @@ namespace ignition

/// \class ISystemPreUpdate ISystem.hh ignition/gazebo/System.hh
/// \brief Interface for a system that uses the PreUpdate phase
class IGNITION_GAZEBO_VISIBLE ISystemPreUpdate {
class ISystemPreUpdate {
public: virtual void PreUpdate(const UpdateInfo &_info,
EntityComponentManager &_ecm) = 0;
};

/// \class ISystemUpdate ISystem.hh ignition/gazebo/System.hh
/// \brief Interface for a system that uses the Update phase
class IGNITION_GAZEBO_VISIBLE ISystemUpdate {
class ISystemUpdate {
public: virtual void Update(const UpdateInfo &_info,
EntityComponentManager &_ecm) = 0;
};

/// \class ISystemPostUpdate ISystem.hh ignition/gazebo/System.hh
/// \brief Interface for a system that uses the PostUpdate phase
class IGNITION_GAZEBO_VISIBLE ISystemPostUpdate{
class ISystemPostUpdate{
public: virtual void PostUpdate(const UpdateInfo &_info,
const EntityComponentManager &_ecm) = 0;
};
Expand Down
12 changes: 6 additions & 6 deletions include/ignition/gazebo/components/Factory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
namespace components
{
/// \brief A base class for an object responsible for creating components.
class IGNITION_GAZEBO_VISIBLE ComponentDescriptorBase
class ComponentDescriptorBase
{
/// \brief Destructor
public: virtual ~ComponentDescriptorBase() = default;
Expand All @@ -54,7 +54,7 @@ namespace components
/// \brief A class for an object responsible for creating components.
/// \tparam ComponentTypeT type of component to describe.
template <typename ComponentTypeT>
class IGNITION_GAZEBO_VISIBLE ComponentDescriptor
class ComponentDescriptor
: public ComponentDescriptorBase
{
/// \brief Create an instance of a ComponentTypeT Component.
Expand All @@ -66,7 +66,7 @@ namespace components
};

/// \brief A base class for an object responsible for creating storages.
class IGNITION_GAZEBO_VISIBLE StorageDescriptorBase
class StorageDescriptorBase
{
/// \brief Destructor
public: virtual ~StorageDescriptorBase() = default;
Expand All @@ -79,7 +79,7 @@ namespace components
/// \brief A class for an object responsible for creating storages.
/// \tparam ComponentTypeT type of component that the storage will hold.
template <typename ComponentTypeT>
class IGNITION_GAZEBO_VISIBLE StorageDescriptor
class StorageDescriptor
: public StorageDescriptorBase
{
/// \brief Create an instance of a storage that holds ComponentTypeT
Expand All @@ -92,7 +92,7 @@ namespace components
};

/// \brief A factory that generates a component based on a string type.
class IGNITION_GAZEBO_VISIBLE Factory
class Factory
: public ignition::common::SingletonT<Factory>
{
/// \brief Register a component so that the factory can create instances
Expand Down Expand Up @@ -329,7 +329,7 @@ namespace components
/// \param[in] _compType Component type name.
/// \param[in] _classname Class name for component.
#define IGN_GAZEBO_REGISTER_COMPONENT(_compType, _classname) \
class IGNITION_GAZEBO_VISIBLE IgnGazeboComponents##_classname \
class IgnGazeboComponents##_classname \
{ \
public: IgnGazeboComponents##_classname() \
{ \
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ set (sources
ServerConfig.cc
ServerPrivate.cc
SimulationRunner.cc
System.cc
SystemLoader.cc
Util.cc
View.cc
Expand Down
25 changes: 0 additions & 25 deletions src/System.cc

This file was deleted.

12 changes: 6 additions & 6 deletions src/cmd/ign.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,32 @@
#include "ign.hh"

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE char *ignitionGazeboVersion()
extern "C" char *ignitionGazeboVersion()
{
return strdup(IGNITION_GAZEBO_VERSION_FULL);
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE char *gazeboVersionHeader()
extern "C" char *gazeboVersionHeader()
{
return strdup(IGNITION_GAZEBO_VERSION_HEADER);
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE void cmdVerbosity(
extern "C" void cmdVerbosity(
const char *_verbosity)
{
ignition::common::Console::SetVerbosity(std::atoi(_verbosity));
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE const char *worldInstallDir()
extern "C" const char *worldInstallDir()
{
return IGN_GAZEBO_WORLD_INSTALL_DIR;
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString,
extern "C" int runServer(const char *_sdfString,
int _iterations, int _run, float _hz, int _levels, const char *_networkRole,
int _networkSecondaries, int _record, const char *_recordPath,
int _logOverwrite, const char *_playback, const char *_file)
Expand Down Expand Up @@ -206,7 +206,7 @@ extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString,
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE int runGui(const char *_guiConfig)
extern "C" int runGui(const char *_guiConfig)
{
ignition::common::SignalHandler sigHandler;
bool sigKilled = false;
Expand Down
14 changes: 7 additions & 7 deletions src/ign.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,32 @@
#include "ignition/gazebo/gui/Gui.hh"

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE char *ignitionGazeboVersion()
extern "C" char *ignitionGazeboVersion()
{
return strdup(IGNITION_GAZEBO_VERSION_FULL);
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE char *gazeboVersionHeader()
extern "C" char *gazeboVersionHeader()
{
return strdup(IGNITION_GAZEBO_VERSION_HEADER);
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE void cmdVerbosity(
extern "C" void cmdVerbosity(
const char *_verbosity)
{
ignition::common::Console::SetVerbosity(std::atoi(_verbosity));
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE const char *worldInstallDir()
extern "C" const char *worldInstallDir()
{
return IGN_GAZEBO_WORLD_INSTALL_DIR;
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE const char *findFuelResource(
extern "C" const char *findFuelResource(
char *_pathToResource)
{
std::string path;
Expand Down Expand Up @@ -115,7 +115,7 @@ extern "C" IGNITION_GAZEBO_VISIBLE const char *findFuelResource(
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString,
extern "C" int runServer(const char *_sdfString,
int _iterations, int _run, float _hz, int _levels, const char *_networkRole,
int _networkSecondaries, int _record, const char *_recordPath,
int _recordResources, int _logOverwrite, int _logCompress,
Expand Down Expand Up @@ -355,7 +355,7 @@ extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString,
}

//////////////////////////////////////////////////
extern "C" IGNITION_GAZEBO_VISIBLE int runGui(const char *_guiConfig)
extern "C" int runGui(const char *_guiConfig)
{
// argc and argv are going to be passed to a QApplication. The Qt
// documentation has a warning about these:
Expand Down
14 changes: 7 additions & 7 deletions src/ign.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@

/// \brief External hook to read the library version.
/// \return C-string representing the version. Ex.: 0.1.2
extern "C" IGNITION_GAZEBO_VISIBLE char *ignitionGazeboVersion();
extern "C" char *ignitionGazeboVersion();

/// \brief Get the Gazebo version header.
/// \return C-string containing the Gazebo version information.
extern "C" IGNITION_GAZEBO_VISIBLE char *gazeboVersionHeader();
extern "C" char *gazeboVersionHeader();

/// \brief Set verbosity level
/// \param[in] _verbosity 0 to 4
extern "C" IGNITION_GAZEBO_VISIBLE void cmdVerbosity(
extern "C" void cmdVerbosity(
const char *_verbosity);

extern "C" IGNITION_GAZEBO_VISIBLE const char *worldInstallDir();
extern "C" const char *worldInstallDir();

/// \brief External hook to run simulation server.
/// \param[in] _sdfString SDF file to run, as a string.
Expand All @@ -55,7 +55,7 @@ extern "C" IGNITION_GAZEBO_VISIBLE const char *worldInstallDir();
/// \param[in] _recordTopics Colon separated list of topics to record. Leave
/// null to record the default topics.
/// \return 0 if successful, 1 if not.
extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString,
extern "C" int runServer(const char *_sdfString,
int _iterations, int _run, float _hz, int _levels,
const char *_networkRole, int _networkSecondaries, int _record,
const char *_recordPath, int _recordResources, int _logOverwrite,
Expand All @@ -67,13 +67,13 @@ extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString,
/// \brief External hook to run simulation GUI.
/// \param[in] _guiConfig Path to Ignition GUI configuration file.
/// \return 0 if successful, 1 if not.
extern "C" IGNITION_GAZEBO_VISIBLE int runGui(const char *_guiConfig);
extern "C" int runGui(const char *_guiConfig);

/// \brief External hook to find or download a fuel world provided a URL.
/// \param[in] _pathToResource Path to the fuel world resource, ie,
/// https://staging-fuel.ignitionrobotics.org/1.0/gmas/worlds/ShapesClone
/// \return C-string containing the path to the local world sdf file
extern "C" IGNITION_GAZEBO_VISIBLE const char *findFuelResource(
extern "C" const char *findFuelResource(
char *_pathToResource);

#endif
3 changes: 2 additions & 1 deletion test/plugins/EventTriggerSystem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ namespace ignition
{
namespace gazebo
{
class IGNITION_GAZEBO_VISIBLE EventTriggerSystem :
class EventTriggerSystem :
public gazebo::System,
public gazebo::ISystemConfigure,
public gazebo::ISystemUpdate
{
// needed for linter
public: EventTriggerSystem() = default;
public: ~EventTriggerSystem() = default;

public: void Configure(const Entity &/*_entity*/,
const std::shared_ptr<const sdf::Element> &/*_sdf*/,
Expand Down
4 changes: 3 additions & 1 deletion test/plugins/MockSystem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@

namespace ignition {
namespace gazebo {
class IGNITION_GAZEBO_VISIBLE MockSystem :
class MockSystem :
public gazebo::System,
public gazebo::ISystemPreUpdate,
public gazebo::ISystemUpdate,
public gazebo::ISystemPostUpdate
{
public: MockSystem() = default;
public: ~MockSystem() = default;
public: size_t preUpdateCallCount {0};
public: size_t updateCallCount {0};
public: size_t postUpdateCallCount {0};
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/Null.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace systems
{
/// \class Null Null.hh ignition/gazebo/systems/Null.hh
/// \brief Minimal system implementation
class IGNITION_GAZEBO_VISIBLE Null:
class Null:
public System,
public ISystemConfigure,
public ISystemPreUpdate,
Expand Down