OXY API 1.0
OXY API Library Documentation
Loading...
Searching...
No Matches
oxy::filter::intersect_fn Struct Reference

A function object that performs an intersection operation on a database (container) context, yielding the results as a coroutine. More...

#include <filter.hpp>

Public Types

using coro_t = boost::coroutines2::coroutine<result_t>
using coro_t = boost::coroutines2::coroutine<result_t>
using result_t = std::map<std::string, std::string>
using result_t = std::map<std::string, std::string>

Public Member Functions

auto operator() (context_t const &main, std::string const &filterName, std::string const &column) const -> coro_t::pull_type
auto operator() (context_t const &main, std::string const &filterName, std::string const &column) const -> coro_t::pull_type

Detailed Description

A function object that performs an intersection operation on a database (container) context, yielding the results as a coroutine.

The intersect_fn struct defines a function call operator that takes a context_t, a filter name, and a column name as parameters. It returns a coroutine that yields a map of column names to their corresponding values for each row that is present in both the specified context and the filter. This allows for efficient retrieval of rows that meet the criteria defined by the intersection of the context and the filter, enabling the caller to process each matching row as it is produced by the coroutine.

Member Function Documentation

◆ operator()() [1/2]

auto oxy::filter::intersect_fn::operator() ( context_t const & main,
std::string const & filterName,
std::string const & column ) const -> coro_t::pull_type
Parameters
main- The main database (container) context to intersect with the filter.
filterName- The name of the filter to intersect with the main context.
column- The name of the column to be used for the intersection operation.
Returns
A coroutine that yields a map of column names to their corresponding values for each row that is present in both the specified context and the filter.

◆ operator()() [2/2]

auto oxy::filter::intersect_fn::operator() ( context_t const & main,
std::string const & filterName,
std::string const & column ) const -> coro_t::pull_type
Parameters
main- The main database (container) context to intersect with the filter.
filterName- The name of the filter to intersect with the main context.
column- The name of the column to be used for the intersection operation.
Returns
A coroutine that yields a map of column names to their corresponding values for each row that is present in both the specified context and the filter.