Decentralised Art Server
High-performance C++ backend that exposes HTML interface and a secure REST API for managing Performative Transactions entities
 
Loading...
Searching...
No Matches
dcn::utils Namespace Reference

Functions

const std::string & getAsciiLogo ()
 Get the ASCII logo string.
 
std::string loadBuildTimestamp (const std::filesystem::path &path)
 
std::string currentTimestamp ()
 
asio::awaitable< voidwatchdog (std::chrono::steady_clock::time_point &deadline)
 Suspends the coroutine until the given deadline is reached.
 
asio::awaitable< voidensureOnStrand (const asio::strand< asio::io_context::executor_type > &strand)
 
std::string escapeSolSrcQuotes (const std::string &json)
 
template<class DataT , class ChildT , template< typename... > class ChildListT>
std::vector< std::string > topologicalSort (const absl::flat_hash_map< std::string, DataT > &data, std::function< ChildListT< ChildT >(const DataT &)> get_childreen, std::function< std::string(const ChildT &)> get_child_name)
 

Function Documentation

◆ currentTimestamp()

std::string dcn::utils::currentTimestamp ( )

◆ ensureOnStrand()

asio::awaitable< void > dcn::utils::ensureOnStrand ( const asio::strand< asio::io_context::executor_type > &  strand)

◆ escapeSolSrcQuotes()

std::string dcn::utils::escapeSolSrcQuotes ( const std::string &  json)

◆ getAsciiLogo()

const std::string & dcn::utils::getAsciiLogo ( )

Get the ASCII logo string.

Returns
The ASCII logo string.

◆ loadBuildTimestamp()

std::string dcn::utils::loadBuildTimestamp ( const std::filesystem::path &  path)

◆ topologicalSort()

template<class DataT , class ChildT , template< typename... > class ChildListT>
std::vector< std::string > dcn::utils::topologicalSort ( const absl::flat_hash_map< std::string, DataT > &  data,
std::function< ChildListT< ChildT >(const DataT &)>  get_childreen,
std::function< std::string(const ChildT &)>  get_child_name 
)

◆ watchdog()

asio::awaitable< void > dcn::utils::watchdog ( std::chrono::steady_clock::time_point &  deadline)

Suspends the coroutine until the given deadline is reached.

Parameters
deadlineThe point in time when the coroutine should be resumed

This function is used to implement a watchdog like behavior in the server. It is used for example in the listening function to periodically check if the server should be shut down.