Skip to content

Commit 23ffe01

Browse files
committed
Make EntityComponentData a const function
Signed-off-by: Addisu Z. Taddese <[email protected]>
1 parent 48b2bef commit 23ffe01

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

include/ignition/gazebo/detail/View.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class IGNITION_GAZEBO_VISIBLE View : public BaseView
7777
/// \param[_in] _entity The entity
7878
/// \return The entity and its component data. Mutable pointers to the
7979
/// component data are returned.
80-
public: const ComponentData &EntityComponentData(const Entity _entity);
80+
public: const ComponentData &EntityComponentData(const Entity _entity) const;
8181

8282
/// \brief Add an entity with its component data to the view. It is assumed
8383
/// that the entity to be added does not already exist in the view.

src/View.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ const std::vector<const components::BaseComponent *>
4040

4141
//////////////////////////////////////////////////
4242
const std::vector<components::BaseComponent *> &View::EntityComponentData(
43-
const Entity _entity)
43+
const Entity _entity) const
4444
{
4545
return this->validData.at(_entity);
4646
}
4747

48-
4948
//////////////////////////////////////////////////
5049
bool View::HasCachedComponentData(const Entity _entity) const
5150
{

0 commit comments

Comments
 (0)