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

Function object to retrieve objects from the container. More...

#include <object.hpp>

Public Types

using coro_t = boost::coroutines2::coroutine<object_t>

Public Member Functions

auto operator() (connection_ptr const &conn) const -> coro_t::pull_type
auto operator() (connection_ptr const &conn, oid_t const &oid) const -> maybe< object_t >
auto operator() (connection_ptr const &conn, std::vector< oid_t > const &oids) const -> coro_t::pull_type

Detailed Description

Function object to retrieve objects from the container.

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

Member Function Documentation

◆ operator()() [1/3]

auto oxy::core::object::get_fn::operator() ( connection_ptr const & conn) const -> coro_t::pull_type
Parameters
conn- The connection pointer to the container.
Returns
A coroutine pull type that yields all objects in the container.

◆ operator()() [2/3]

auto oxy::core::object::get_fn::operator() ( connection_ptr const & conn,
oid_t const & oid ) const -> maybe< object_t >
Parameters
conn- The connection pointer to the container.
oid- The OID of the object to retrieve.
Returns
A maybe<object_t> indicating whether the object was found.

◆ operator()() [3/3]

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