OXY API 1.0
OXY API Library Documentation
Loading...
Searching...
No Matches
oxy::core::object::get_data_fn Struct Reference

Function object to retrieve data associated with objects in the container. More...

#include <object.hpp>

Public Types

using coro_t = boost::coroutines2::coroutine<result_t>
using result_t = contents_t

Public Member Functions

auto operator() (connection_ptr const &conn, oid_t const &item) const -> maybe< result_t >
auto operator() (connection_ptr const &conn, std::vector< oid_t > const &items) const -> coro_t::pull_type

Detailed Description

Function object to retrieve data associated with objects in the container.

This function object provides two operator() overloads: one that takes a connection pointer and a single OID and returns a maybe<contents_t> indicating whether the data was found, and another that takes a connection pointer and a vector of OIDs and returns a coroutine pull type that yields the corresponding data for the specified OIDs. It is designed to be used in a coroutine-based context for efficient retrieval of object data.

Member Function Documentation

◆ operator()() [1/2]

auto oxy::core::object::get_data_fn::operator() ( connection_ptr const & conn,
oid_t const & item ) const -> maybe< result_t >
Parameters
conn- The connection pointer to the container.
item- The OID of the object to retrieve data for.
Returns
A maybe<contents_t> indicating whether the data was found for the specified OID.

◆ operator()() [2/2]

auto oxy::core::object::get_data_fn::operator() ( connection_ptr const & conn,
std::vector< oid_t > const & items ) const -> coro_t::pull_type
Parameters
conn- The connection pointer to the container.
items- A vector of OIDs to retrieve data for.
Returns
A coroutine pull type that yields the corresponding data for the specified OIDs.