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

Function object to retrieve an index from a connection and an OID or object. More...

#include <index.hpp>

Public Member Functions

auto operator() (connection_ptr const &conn, object_t const &obj) const -> maybe< index_t >
auto operator() (connection_ptr const &conn, oid_t const &oid) const -> maybe< index_t >

Detailed Description

Function object to retrieve an index from a connection and an OID or object.

This functor provides two operator() overloads: one that takes a connection pointer and an OID, and another that takes a connection pointer and an object. Both overloads attempt to retrieve the corresponding index from the connection and return it as a maybe<index_t>, indicating that the index may or may not be found.

Member Function Documentation

◆ operator()() [1/2]

auto oxy::core::get_index_fn::operator() ( connection_ptr const & conn,
object_t const & obj ) const -> maybe< index_t >
Parameters
conn- A pointer to the database (container) connection from which to retrieve the index.
obj- The object representing the index to retrieve.
Returns
A maybe<index_t> containing the index if found, or an empty maybe if not.

◆ operator()() [2/2]

auto oxy::core::get_index_fn::operator() ( connection_ptr const & conn,
oid_t const & oid ) const -> maybe< index_t >
Parameters
conn- A pointer to the database (container) connection from which to retrieve the index.
oid- The OID of the index to retrieve.
Returns
A maybe<index_t> containing the index if found, or an empty maybe if not.