ARGoS  3
A parallel, multi-engine simulator for swarm robotics
argos::CPositionalIndex< ENTITY >::COperation Class Reference

The operation to perform on each entity found in range. More...

#include <positional_index.h>

+ Inheritance diagram for argos::CPositionalIndex< ENTITY >::COperation:

List of all members.

Public Member Functions

virtual ~COperation ()
virtual bool operator() (ENTITY &)=0

Detailed Description

template<class ENTITY>
class argos::CPositionalIndex< ENTITY >::COperation

The operation to perform on each entity found in range.

The operation gets as input a reference to an entity. The return value is either true or false. The former means that the processing should continue with the next entity. The latter means that processing is finished. For example, this code prints the id of all the embodied entities in a sphere centered in zero and with 1-meter radius: class CMyOperation : public CPositionalIndex<CEmbodiedEntity>::COperation { public: virtual bool operator()(CEmbodiedEntity& e) { LOG << e.GetId() << std::endl; return true; } }; ... CPositionalIndex<CEmbodiedEntity>& i = ... i.ForEntitiesInSphereRange(CVector3(), 1, CMyOperation);

See also:
ForEntitiesInSphereRange()
ForEntitiesInBoxRange()
ForEntitiesInCircleRange()
ForEntitiesInRectangleRange()
ForEntitiesAlongRay()

Definition at line 59 of file positional_index.h.


Constructor & Destructor Documentation

template<class ENTITY>
virtual argos::CPositionalIndex< ENTITY >::COperation::~COperation ( ) [inline, virtual]

Definition at line 61 of file positional_index.h.


Member Function Documentation

template<class ENTITY>
virtual bool argos::CPositionalIndex< ENTITY >::COperation::operator() ( ENTITY &  ) [pure virtual]

The documentation for this class was generated from the following file: