22 #ifndef __M2ETIS_PUBSUB_FILTER_ATTRIBUTEACCESSOR_H__
23 #define __M2ETIS_PUBSUB_FILTER_ATTRIBUTEACCESSOR_H__
32 template<
typename EventType,
typename AttributeType>
36 explicit AttributeAccessor(AttributeType EventType::*attribute_accessor_pointer) : attribute_accessor_pointer_(attribute_accessor_pointer) {}
39 explicit AttributeAccessor(std::function<AttributeType(
const EventType &)> attribute_accessor_function) : attribute_accessor_function_(attribute_accessor_function), attribute_accessor_pointer_(nullptr) {}
42 return attribute_accessor_pointer_ ?
event.*attribute_accessor_pointer_ : attribute_accessor_function_(event);
46 std::function<AttributeType(const EventType &)> attribute_accessor_function_;
48 AttributeType EventType::*attribute_accessor_pointer_;
AttributeType getAttributeValue(const EventType &event)
AttributeAccessor(AttributeType EventType::*attribute_accessor_pointer)
AttributeAccessor(std::function< AttributeType(const EventType &)> attribute_accessor_function)