ForEachEntityInstanceMixin< DerivedT > Struct Template Reference

#include <RobotAPI/libraries/armem/core/base/detail/iteration_mixins.h>

Public Member Functions

template<class InstanceFunctionT >
bool forEachInstance (InstanceFunctionT &&func)
 
template<class InstanceFunctionT >
bool forEachInstance (InstanceFunctionT &&func) const
 
template<class AronDtoFunctionT >
bool forEachInstanceAs (AronDtoFunctionT &&func) const
 Call func on the data of each instance converted to Aron DTO class. More...
 
template<class EntityInstanceBaseAronDtoFunctionT >
bool forEachInstanceWithDataAs (EntityInstanceBaseAronDtoFunctionT &&func) const
 Call func on each instance with its data converted to Aron DTO class. More...
 

Detailed Description

template<class DerivedT>
struct armarx::armem::base::detail::ForEachEntityInstanceMixin< DerivedT >

Definition at line 137 of file iteration_mixins.h.

Member Function Documentation

◆ forEachInstance() [1/2]

bool forEachInstance ( InstanceFunctionT &&  func)
inline
Parameters
funcFunction like: bool process(EntityInstanceT& instance)>

Definition at line 146 of file iteration_mixins.h.

+ Here is the caller graph for this function:

◆ forEachInstance() [2/2]

bool forEachInstance ( InstanceFunctionT &&  func) const
inline
Parameters
funcFunction like: bool process(const EntityInstanceT& instance)

Definition at line 157 of file iteration_mixins.h.

◆ forEachInstanceAs()

bool forEachInstanceAs ( AronDtoFunctionT &&  func) const
inline

Call func on the data of each instance converted to Aron DTO class.

().forEachEntityInstanceAs([](my::arondto::CoolData data)
{
...
});

The Aron DTO type is deduced from the passed function's first argument.

Parameters
funcFunction like: bool process(my::arondto::CoolData data)

Definition at line 179 of file iteration_mixins.h.

◆ forEachInstanceWithDataAs()

bool forEachInstanceWithDataAs ( EntityInstanceBaseAronDtoFunctionT &&  func) const
inline

Call func on each instance with its data converted to Aron DTO class.

().forEachEntityInstanceWithDataAs(
[](armem::wm::EntityInstanceBase<my::arondto::CoolData> instance)
{
const armarx::armem::MemoryID id = instance.id();
const armarx::DateTime timestamp = instance.id().timestamp;
const armarx::arondto::Duration& data = instance.data();
...
});

Compared to forEachInstanceAs(), this function allows accessing the full metadata of the instances in addition to the payload data converted to the ARON DTO.

The Aron DTO type is deduced from the passed function's signature.

Parameters
funcFunction like: bool process(armem::wm::EntityInstanceBase<my::arondto::CoolData> instance)

Definition at line 213 of file iteration_mixins.h.


The documentation for this struct was generated from the following file:
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::armem::Duration
armarx::core::time::Duration Duration
Definition: forward_declarations.h:14