Offline Transaction Signing (OTS) 0.1.0
Loading...
Searching...
No Matches
ots::SeedJar Class Reference

Storage for the Seed objects, mainly for the purpose of the C ABI. More...

#include <ots.hpp>

Public Member Functions

seed_handle_t store (const Seed &seed) const noexcept
 Stores a Seed object and returns a handle, to retrieve later.
 
const Seedget (seed_handle_t handle) const
 retrieve a Seed object via a handle
 
const Seedget (const std::string &fingerprint) const
 retrieve a Seed object from the jar from the fingerprint of the Seed object
 
uint32_t count () const noexcept
 
bool has (seed_handle_t handle) const noexcept
 
bool has (const std::string &fingerprint) const
 
std::vector< std::reference_wrapper< const Seed > > list () const noexcept
 

Static Public Member Functions

static const SeedJarinstance () noexcept
 

Detailed Description

Storage for the Seed objects, mainly for the purpose of the C ABI.

Todo:
check if not better include in OTS

Member Function Documentation

◆ count()

uint32_t ots::SeedJar::count ( ) const
noexcept

◆ get() [1/2]

const Seed & ots::SeedJar::get ( const std::string &  fingerprint) const

retrieve a Seed object from the jar from the fingerprint of the Seed object

Parameters
fingerprint6digit fingerprint of the Seed object
Returns
The Seed object if in the jar
Exceptions
ots::exception::seedjar::SeedNotFoundif the Seed object is not in the jar

◆ get() [2/2]

const Seed & ots::SeedJar::get ( seed_handle_t  handle) const

retrieve a Seed object via a handle

Parameters
handlereceived on
See also
store(Seed)
Returns
The Seed object if in the jar
Exceptions
ots::exception::seedjar::SeedNotFoundif the Seed object is not in the jar

◆ has() [1/2]

bool ots::SeedJar::has ( const std::string &  fingerprint) const

◆ has() [2/2]

bool ots::SeedJar::has ( seed_handle_t  handle) const
noexcept

◆ instance()

static const SeedJar & ots::SeedJar::instance ( )
staticnoexcept

◆ list()

std::vector< std::reference_wrapper< const Seed > > ots::SeedJar::list ( ) const
noexcept

◆ store()

seed_handle_t ots::SeedJar::store ( const Seed seed) const
noexcept

Stores a Seed object and returns a handle, to retrieve later.

Parameters
seedthe actual Seed object to store
Returns
the handle to retrieve the Seed object with
See also
get(seed_handle_t)
Note
Attempt to store various times the same Seed object, results in receiving same handle, without duplicating reference of the Seed object

The documentation for this class was generated from the following file: