HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
v1::delayed_format< Fmt, Values > Class Template Reference

#include <hikogui/telemetry/delayed_format.hpp>

Public Member Functions

 delayed_format (delayed_format &&) noexcept=default
 
 delayed_format (delayed_format const &) noexcept=default
 
delayed_formatoperator= (delayed_format &&) noexcept=default
 
delayed_formatoperator= (delayed_format const &) noexcept=default
 
template<typename... Args>
 delayed_format (Args const &...args) noexcept
 Construct a delayed format.
 
std::string operator() () const noexcept
 Format now.
 
std::string operator() (std::locale const &loc) const noexcept
 Format now.
 

Detailed Description

template<fixed_string Fmt, typename... Values>
class v1::delayed_format< Fmt, Values >

Delayed formatting.

This class will capture all the arguments so that it may be passed to another thread. Then call the function operator to do the actual formatting.

Constructor & Destructor Documentation

◆ delayed_format()

template<fixed_string Fmt, typename... Values>
template<typename... Args>
v1::delayed_format< Fmt, Values >::delayed_format ( Args const &... args)
inlinenoexcept

Construct a delayed format.

All arguments are passed by forwarding-references so that values can be moved into the storage of the delayed_format.

Arguments passed by reference will be copied. Arguments passed by std::string_view or std::span will be copied into a std::string or std::vector.

Literal strings will not be copied, instead a pointer is taken.

Parameters
argsThe parameters to std::format, including the fmt paramater, but excluding the locale.

Member Function Documentation

◆ operator()() [1/2]

template<fixed_string Fmt, typename... Values>
std::string v1::delayed_format< Fmt, Values >::operator() ( ) const
inlinenoexcept

Format now.

Returns
The formatted string.

◆ operator()() [2/2]

template<fixed_string Fmt, typename... Values>
std::string v1::delayed_format< Fmt, Values >::operator() ( std::locale const & loc) const
inlinenoexcept

Format now.

Parameters
locThe locale to use for formatting.
Returns
The formatted string.

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