OXY API 1.0
OXY API Library Documentation
Loading...
Searching...
No Matches
oxy::api::get_commit_fn Struct Reference

Function object to retrieve a commit from the storage container in the OXY-API. More...

#include <storage.hpp>

Public Member Functions

maybe< commit_toperator() (IStoragePtr const &stg, oid_t const &parent) const
maybe< commit_toperator() (IStoragePtr const &stg, std::string const &reference_name) const

Detailed Description

Function object to retrieve a commit from the storage container in the OXY-API.

This function object provides two operator() overloads: one that takes a storage container pointer and a reference name, and another that takes a storage container pointer and an OID. Both overloads return a maybe<commit_t> containing the commit if available. It is designed to be used in a constexpr context for compile-time evaluation of commit retrieval operations.

Member Function Documentation

◆ operator()() [1/2]

maybe< commit_t > oxy::api::get_commit_fn::operator() ( IStoragePtr const & stg,
oid_t const & parent ) const
Parameters
stg- The storage container pointer from which to retrieve the commit.
parent- The OID of the parent commit to retrieve from the storage container.
Returns
A maybe<commit_t> containing the commit if available, or nothing() if not found.

◆ operator()() [2/2]

maybe< commit_t > oxy::api::get_commit_fn::operator() ( IStoragePtr const & stg,
std::string const & reference_name ) const
Parameters
stg- The storage container pointer from which to retrieve the commit.
reference_name- The reference name of the commit to retrieve from the storage container.
Returns
A maybe<commit_t> containing the commit if available, or nothing() if not found.