AnnaDB 1.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
tyson::TySonCollectionObject Class Reference

Public Member Functions

 TySonCollectionObject (size_t size, bool objects=false)
 
void add (const std::string &object)
 
void add (const std::string &link, const std::string &value)
 
template<TySonType T>
requires (T == TySonType::Object)
std::optional< std::pair< TySonObject, TySonObject > > get (std::string_view obj_id) noexcept
 
template<TySonType T>
requires (T == TySonType::Objects)
std::vector< std::pair< TySonObject, TySonObject > > get (std::string_view collection) noexcept
 
template<TySonType T>
requires (T == TySonType::Object)
std::optional< std::pair< TySonObject, TySonObject > > get (std::string_view collection, std::string_view obj_id) noexcept
 
template<TySonType T>
requires (T == TySonType::ID)
std::optional< TySonObjectget (std::string_view obj_id) noexcept
 
template<TySonType T>
requires (T == TySonType::IDs)
std::vector< TySonObjectget (std::string_view collection) noexcept
 
template<TySonType T>
requires (T == TySonType::ID)
std::optional< TySonObjectget (std::string_view collection, std::string_view obj_id) noexcept
 

Member Function Documentation

◆ add() [1/2]

void tyson::TySonCollectionObject::add ( const std::string &  link,
const std::string &  value 
)
inline

Add a new AnnaDB(TySon) pair of string representations to the current collection. It will be parsed automatically into a TySonObject

Parameters
object

◆ add() [2/2]

void tyson::TySonCollectionObject::add ( const std::string &  object)
inline

Add a new AnnaDB(TySon) string representation to the current collection. It will be parsed automatically into a TySonObject

Parameters
object

◆ get() [1/6]

template<TySonType T>
requires (T == TySonType::Objects)
std::vector< std::pair< TySonObject, TySonObject > > tyson::TySonCollectionObject::get ( std::string_view  collection)
inlinenoexcept

Get all nodes from the AnnaDB response data|:objects which belongs to a specific collection

Template Parameters
TTySonType::Objects
Parameters
collectionname
Returns
vector of TySonObject pairs which belongs to the collection

◆ get() [2/6]

template<TySonType T>
requires (T == TySonType::IDs)
std::vector< TySonObject > tyson::TySonCollectionObject::get ( std::string_view  collection)
inlinenoexcept

Get all nodes from the AnnaDB response data|:ids

Template Parameters
TTySonType::IDs
Parameters
collectionname
Returns
vector of TySonObjects which belongs to the collection found by collection name

◆ get() [3/6]

template<TySonType T>
requires (T == TySonType::Object)
std::optional< std::pair< TySonObject, TySonObject > > tyson::TySonCollectionObject::get ( std::string_view  collection,
std::string_view  obj_id 
)
inlinenoexcept

Get the node from the AnnaDB response data|:objects

Template Parameters
TTySonType::Object
Parameters
collectionname
obj_iduuid-string
Returns
TySonObject pair if found by collection name and link_id

◆ get() [4/6]

template<TySonType T>
requires (T == TySonType::ID)
std::optional< TySonObject > tyson::TySonCollectionObject::get ( std::string_view  collection,
std::string_view  obj_id 
)
inlinenoexcept

Get the node from the AnnaDB response data|:ids

Template Parameters
TTySonType::ID
Parameters
collectionname
obj_iduuid-string
Returns
TySonObject if found by collection name and link_id

◆ get() [5/6]

template<TySonType T>
requires (T == TySonType::Object)
std::optional< std::pair< TySonObject, TySonObject > > tyson::TySonCollectionObject::get ( std::string_view  obj_id)
inlinenoexcept

Get the node value from the AnnaDB response data|:objects Example: test|ea63e06f-9d1c-442f-89fd-c5041d863f5f|:s|foo|, get("ea63e06f-9d1c-442f-89fd-c5041d863f5f") => TySonObject with value foo and type String

Template Parameters
TTySonType::Object
Parameters
obj_iduuid-string
Returns
TySonObject if found by the link_id

◆ get() [6/6]

template<TySonType T>
requires (T == TySonType::ID)
std::optional< TySonObject > tyson::TySonCollectionObject::get ( std::string_view  obj_id)
inlinenoexcept

Get the node object from the AnnaDB response data|:ids

Template Parameters
TTySonType::ID
Parameters
obj_iduuid-string
Returns
TySonObject if found by link_id

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