Scippy

SoPlex

Sequential object-oriented simPlex

basic_format_args< Context > Class Template Reference

#include <core.h>

Public Types

using size_type = int
 
using format_arg = basic_format_arg< Context >
 

Public Member Functions

 basic_format_args ()
 
template<typename... Args>
FMT_INLINE basic_format_args (const format_arg_store< Context, Args... > &store)
 
FMT_INLINE basic_format_args (const dynamic_format_arg_store< Context > &store)
 
 basic_format_args (const format_arg *args, int count)
 
format_arg get (int id) const
 
template<typename Char >
format_arg get (basic_string_view< Char > name) const
 
template<typename Char >
int get_id (basic_string_view< Char > name) const
 
int max_size () const
 

Private Member Functions

bool is_packed () const
 
bool has_named_args () const
 
detail::type type (int index) const
 
 basic_format_args (unsigned long long desc, const detail::value< Context > *values)
 
 basic_format_args (unsigned long long desc, const format_arg *args)
 

Private Attributes

unsigned long long desc_
 
union {
   const detail::value< Context > *   values_
 
   const format_arg *   args_
 
}; 
 

Detailed Description

template<typename Context>
class basic_format_args< Context >

A view of a collection of formatting arguments. To avoid lifetime issues it should only be used as a parameter type in type-erased functions such as vformat::

void vlog(string_view format_str, format_args args); // OK format_args args = make_format_args(42); // Error: dangling reference

Definition at line 625 of file core.h.

Member Typedef Documentation

◆ format_arg

using format_arg = basic_format_arg<Context>

Definition at line 1831 of file core.h.

◆ size_type

using size_type = int

Definition at line 1830 of file core.h.

Constructor & Destructor Documentation

◆ basic_format_args() [1/6]

basic_format_args ( unsigned long long  desc,
const detail::value< Context > *  values 
)
private

Definition at line 1860 of file core.h.

◆ basic_format_args() [2/6]

basic_format_args ( unsigned long long  desc,
const format_arg args 
)
private

Definition at line 1863 of file core.h.

◆ basic_format_args() [3/6]

Definition at line 1867 of file core.h.

◆ basic_format_args() [4/6]

FMT_INLINE basic_format_args ( const format_arg_store< Context, Args... > &  store)

Constructs a basic_format_args object from ~fmtformat_arg_store.

Definition at line 1875 of file core.h.

◆ basic_format_args() [5/6]

FMT_INLINE basic_format_args ( const dynamic_format_arg_store< Context > &  store)

Constructs a basic_format_args object from ~fmtdynamic_format_arg_store.

Definition at line 1884 of file core.h.

◆ basic_format_args() [6/6]

basic_format_args ( const format_arg args,
int  count 
)

Constructs a basic_format_args object from a dynamic set of arguments.

Definition at line 1892 of file core.h.

Member Function Documentation

◆ get() [1/2]

format_arg get ( int  id) const

Returns the argument with the specified id.

Definition at line 1897 of file core.h.

Referenced by basic_printf_context< OutputIt, Char >::arg(), basic_format_context< OutputIt, Char >::arg(), and detail::vformat().

◆ get() [2/2]

format_arg get ( basic_string_view< Char >  name) const

Definition at line 1910 of file core.h.

◆ get_id()

int get_id ( basic_string_view< Char >  name) const

Definition at line 1915 of file core.h.

Referenced by basic_format_context< OutputIt, Char >::arg_id().

◆ has_named_args()

bool has_named_args ( ) const
private

Definition at line 1850 of file core.h.

◆ is_packed()

bool is_packed ( ) const
private

Definition at line 1849 of file core.h.

Referenced by format_arg_store< Context, Args >::format_arg_store().

◆ max_size()

int max_size ( ) const

Definition at line 1925 of file core.h.

◆ type()

detail::type type ( int  index) const
private

Definition at line 1854 of file core.h.

Member Data Documentation

◆ @11

union { ... }

◆ args_

const format_arg* args_

Definition at line 1846 of file core.h.

◆ desc_

unsigned long long desc_
private

Definition at line 1838 of file core.h.

◆ values_

const detail::value<Context>* values_

Definition at line 1845 of file core.h.