$darkmode
object_sensor_functional.hpp File Reference
#include <functional>
#include <memory>
#include <string>
#include <cloe/component/object.hpp>
#include <cloe/component/object_sensor.hpp>
Include dependency graph for object_sensor_functional.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cloe::ObjectSensorFilter
 
class  cloe::ObjectSensorFilterMap
 

Typedefs

using cloe::ObjectFilter = std::function< bool(const Object &)>
 
using cloe::ObjectFilterMap = std::function< std::shared_ptr< Object >(const std::shared_ptr< Object > &)>
 

Detailed Description

See also
cloe/component/object_sensor.hpp
cloe/component/object.hpp

This file provides definitions for common functional idioms with respect to Objects and ObjectSensors.

Typedef Documentation

◆ ObjectFilter

using cloe::ObjectFilter = typedef std::function<bool(const Object&)>

ObjectFilter shall return true for any Object that should be yielded, and false for every Object that should be skipped.

◆ ObjectFilterMap

using cloe::ObjectFilterMap = typedef std::function<std::shared_ptr<Object>(const std::shared_ptr<Object>&)>

ObjectFilterMap may map and filter objects at the same time.

  • If it yields the object without changes, it may pass it on.
  • If it yields the object with changes, it should create a clone of the Object with std::make_shared first, and then make the changes.
  • If it should skip the object, it should return nullptr.