@@ -140,7 +140,7 @@ namespace argos {
140
140
/* *
141
141
* Returns the entity with the given id.
142
142
* @param str_id The id of the wanted entity
143
- * @return The entity with the given id.
143
+ * @return The entity with the given id.
144
144
* @throws CARGoSException if an entity with the wanted id does not exist
145
145
*/
146
146
inline CEntity& GetEntity (const std::string& str_id) {
@@ -157,7 +157,7 @@ namespace argos {
157
157
* The pattern must be a valid regexp.
158
158
* @param t_buffer A vector filled with all the entities that match the given pattern.
159
159
* @param str_pattern The pattern to match.
160
- * @return The entity with the given id.
160
+ * @return The entity with the given id.
161
161
* @throws CARGoSException if the regexp is not valid.
162
162
*/
163
163
void GetEntitiesMatching (CEntity::TVector& t_buffer,
@@ -208,7 +208,14 @@ namespace argos {
208
208
* @see TMapPerType
209
209
* @see GetEntityMapPerTypePerId()
210
210
*/
211
- TMapPerType& GetEntitiesByType (const std::string& str_type);
211
+
212
+ TMapPerType& GetEntitiesByType (const std::string& str_type) {
213
+ return GetEntitiesByTypeImpl (str_type);
214
+ }
215
+
216
+ const TMapPerType& GetEntitiesByType (const std::string& str_type) const {
217
+ return GetEntitiesByTypeImpl (str_type);
218
+ }
212
219
213
220
/* *
214
221
* Returns the floor entity.
@@ -392,7 +399,7 @@ namespace argos {
392
399
virtual void AddControllableEntity (CControllableEntity& c_entity);
393
400
virtual void RemoveControllableEntity (CControllableEntity& c_entity);
394
401
virtual void AddEntityToPhysicsEngine (CEmbodiedEntity& c_entity);
395
-
402
+
396
403
protected:
397
404
398
405
virtual void UpdateControllableEntitiesAct () = 0;
@@ -452,6 +459,9 @@ namespace argos {
452
459
453
460
/* * A pointer to the list of media */
454
461
CMedium::TVector* m_ptMedia;
462
+
463
+ private:
464
+ TMapPerType& GetEntitiesByTypeImpl (const std::string& str_type) const ;
455
465
};
456
466
457
467
/* ***************************************/
0 commit comments