5#include <RobotAPI/interface/armem/query.h>
13 template <
class _Prov
iderSegmentT,
class _ResultProv
iderSegmentT,
class _ChildProcessorT>
16 _ResultProviderSegmentT,
17 armem::query::data::ProviderSegmentQuery>
21 _ResultProviderSegmentT,
22 armem::query::data::ProviderSegmentQuery>;
27 using EntityT =
typename ProviderSegmentT::EntityT;
49 const armem::query::data::ProviderSegmentQuery&
query,
52 if (
auto q =
dynamic_cast<const armem::query::data::provider::All*
>(&
query))
54 process(result, *
q, providerSegment);
56 else if (
auto q =
dynamic_cast<const armem::query::data::provider::Single*
>(&
query))
58 process(result, *
q, providerSegment);
60 else if (
auto q =
dynamic_cast<const armem::query::data::provider::Regex*
>(&
query))
62 process(result, *
q, providerSegment);
72 const armem::query::data::provider::All&
query,
75 providerSegment.forEachEntity([
this, &result, &
query](
const EntityT& entity)
81 const armem::query::data::provider::Single&
query,
84 if (
auto entity = providerSegment.findEntity(
query.entityName))
92 const armem::query::data::provider::Regex&
query,
95 const std::regex regex(
query.entityNameRegex);
96 providerSegment.forEachEntity(
99 if (std::regex_search(entity.name(), regex))
112 const armem::query::data::ProviderSegmentQuery&
query)
const
115 if (child ==
nullptr)
117 child = &result.addEntity(entity.name());
Indicates that an entity's history was queried, but is empty.
Base class for memory query processors.
_ResultProviderSegmentT process(const armem::query::data::ProviderSegmentQuery &query, const _ProviderSegmentT &data) const
typename ProviderSegmentT::EntityT EntityT
ProviderSegmentQueryProcessorBase()
_ProviderSegmentT ProviderSegmentT
typename ResultProviderSegmentT::EntityT ResultEntityT
ChildProcessorT childProcessor
BaseQueryProcessorBase< _ProviderSegmentT, _ResultProviderSegmentT, armem::query::data::ProviderSegmentQuery > Base
void _processResult(ResultProviderSegmentT &result, const EntityT &entity, const armem::query::data::ProviderSegmentQuery &query) const
_ResultProviderSegmentT ResultProviderSegmentT
virtual void process(ResultProviderSegmentT &result, const armem::query::data::provider::Single &query, const ProviderSegmentT &providerSegment) const
virtual void process(ResultProviderSegmentT &result, const armem::query::data::provider::Regex &query, const ProviderSegmentT &providerSegment) const
virtual void process(ResultProviderSegmentT &result, const armem::query::data::ProviderSegmentQuery &query, const ProviderSegmentT &providerSegment) const override
Process the query and populate result.
ProviderSegmentQueryProcessorBase(ChildProcessorT &&childProcessor)
virtual void process(ResultProviderSegmentT &result, const armem::query::data::provider::All &query, const ProviderSegmentT &providerSegment) const
_ChildProcessorT ChildProcessorT
typename Base::EntityT ResultEntityT
typename Base::ResultProviderSegmentT ResultProviderSegmentT