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

Function object to retrieve references from a connection. More...

#include <reference.hpp>

Public Types

using coro_t = boost::coroutines2::coroutine<reference_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 -> coro_t::pull_type
auto operator() (connection_ptr const &conn, std::string const &url) const -> maybe< reference_t >

Detailed Description

Function object to retrieve references from a connection.

This functor provides three operator() overloads: one that takes a connection pointer and returns a coroutine pull type that yields all references, another that takes a connection pointer and an OID and returns a coroutine pull type that yields the corresponding references, and a third that takes a connection pointer and a reference name (URL) and returns a maybe<reference_t>, indicating that the reference may or may not be found. It allows for efficient retrieval of references in the version control system.

Member Function Documentation

◆ operator()() [1/3]

auto oxy::core::get_ref_fn::operator() ( connection_ptr const & conn) const -> coro_t::pull_type
Parameters
conn- A pointer to the database (container) connection from which to retrieve references.
Returns
A coroutine pull type that yields all references in the version control system.

◆ operator()() [2/3]

auto oxy::core::get_ref_fn::operator() ( connection_ptr const & conn,
oid_t const & oid ) const -> coro_t::pull_type
Parameters
conn- A pointer to the database (container) connection from which to retrieve references.
oid- The OID for which to retrieve the corresponding references.
Returns
A coroutine pull type that yields the references corresponding to the specified OID.

◆ operator()() [3/3]

auto oxy::core::get_ref_fn::operator() ( connection_ptr const & conn,
std::string const & url ) const -> maybe< reference_t >
Parameters
conn- A pointer to the database (container) connection from which to retrieve references.
url- The name (URL) of the reference to retrieve.
Returns
A maybe<reference_t> containing the reference if found, or an empty maybe if not found.