argos::CPositionalIndex< ENTITY >::COperation Class Referenceabstract

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

#include <positional_index.h>

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

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 60 of file positional_index.h.

Constructor & Destructor Documentation

template<class ENTITY>
virtual argos::CPositionalIndex< ENTITY >::COperation::~COperation ( )
inlinevirtual

Definition at line 62 of file positional_index.h.

Member Function Documentation

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