Skip to content

Commit

Permalink
Try the ign-gui plugins approach
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed Aug 12, 2021
1 parent 9baa1a8 commit 66bb2a2
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions include/ignition/gazebo/detail/View.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
#include "ignition/gazebo/config.hh"
#include "ignition/gazebo/detail/BaseView.hh"

// TODO(chapulina) Remove hardcoded 6
#ifndef _WIN32
# define ignition_gazebo_EXPORTS_API
#else
# if (defined(ignition_gazebo6_EXPORTS))
# define ignition_gazebo_EXPORTS_API __declspec(dllexport)
# else
# define ignition_gazebo_EXPORTS_API __declspec(dllimport)
# endif
#endif

namespace ignition
{
namespace gazebo
Expand All @@ -39,7 +50,7 @@ namespace detail
/// \brief A view that caches a particular set of component type data.
/// \tparam ComponentTypeTs The component type(s) that are stored in this view.
template<typename ...ComponentTypeTs>
class IGNITION_GAZEBO_VISIBLE View : public BaseView
class ignition_gazebo_EXPORTS_API View : public BaseView
{
/// \brief Alias for containers that hold and entity and its component data.
/// The component types held in this container match the component types that
Expand Down Expand Up @@ -147,15 +158,13 @@ class IGNITION_GAZEBO_VISIBLE View : public BaseView

//////////////////////////////////////////////////
template<typename ...ComponentTypeTs>
IGNITION_GAZEBO_VISIBLE
View<ComponentTypeTs...>::View()
{
this->componentTypes = {ComponentTypeTs::typeId...};
}

//////////////////////////////////////////////////
template<typename ...ComponentTypeTs>
IGNITION_GAZEBO_VISIBLE
bool View<ComponentTypeTs...>::HasCachedComponentData(
const Entity _entity) const
{
Expand All @@ -182,7 +191,6 @@ bool View<ComponentTypeTs...>::HasCachedComponentData(

//////////////////////////////////////////////////
template<typename ...ComponentTypeTs>
IGNITION_GAZEBO_VISIBLE
bool View<ComponentTypeTs...>::RemoveEntity(const Entity _entity)
{
this->invalidData.erase(_entity);
Expand All @@ -204,7 +212,6 @@ bool View<ComponentTypeTs...>::RemoveEntity(const Entity _entity)

//////////////////////////////////////////////////
template<typename ...ComponentTypeTs>
IGNITION_GAZEBO_VISIBLE
typename View<ComponentTypeTs...>::ConstComponentData
View<ComponentTypeTs...>::EntityComponentConstData(const Entity _entity) const
{
Expand All @@ -213,7 +220,6 @@ typename View<ComponentTypeTs...>::ConstComponentData

//////////////////////////////////////////////////
template<typename ...ComponentTypeTs>
IGNITION_GAZEBO_VISIBLE
typename View<ComponentTypeTs...>::ComponentData
View<ComponentTypeTs...>::EntityComponentData(const Entity _entity)
{
Expand All @@ -222,7 +228,6 @@ typename View<ComponentTypeTs...>::ComponentData

//////////////////////////////////////////////////
template<typename ...ComponentTypeTs>
IGNITION_GAZEBO_VISIBLE
void View<ComponentTypeTs...>::AddEntityWithConstComps(const Entity &_entity,
const bool _new, const ComponentTypeTs*... _compPtrs)
{
Expand All @@ -234,7 +239,6 @@ void View<ComponentTypeTs...>::AddEntityWithConstComps(const Entity &_entity,

//////////////////////////////////////////////////
template<typename ...ComponentTypeTs>
IGNITION_GAZEBO_VISIBLE
void View<ComponentTypeTs...>::AddEntityWithComps(const Entity &_entity,
const bool _new, ComponentTypeTs*... _compPtrs)
{
Expand All @@ -246,7 +250,6 @@ void View<ComponentTypeTs...>::AddEntityWithComps(const Entity &_entity,

//////////////////////////////////////////////////
template<typename ...ComponentTypeTs>
IGNITION_GAZEBO_VISIBLE
bool View<ComponentTypeTs...>::NotifyComponentAddition(const Entity _entity,
bool _newEntity, const ComponentTypeId _typeId)
{
Expand Down Expand Up @@ -285,7 +288,6 @@ bool View<ComponentTypeTs...>::NotifyComponentAddition(const Entity _entity,

//////////////////////////////////////////////////
template<typename ...ComponentTypeTs>
IGNITION_GAZEBO_VISIBLE
bool View<ComponentTypeTs...>::NotifyComponentRemoval(const Entity _entity,
const ComponentTypeId _typeId)
{
Expand Down Expand Up @@ -318,7 +320,6 @@ bool View<ComponentTypeTs...>::NotifyComponentRemoval(const Entity _entity,

//////////////////////////////////////////////////
template<typename ...ComponentTypeTs>
IGNITION_GAZEBO_VISIBLE
void View<ComponentTypeTs...>::Reset()
{
// reset all data structures in the BaseView except for componentTypes since
Expand Down

0 comments on commit 66bb2a2

Please sign in to comment.