LLFIO v2.00
Loading...
Searching...
No Matches
llfio_v2_xxx::storage_profile::item< T > Struct Template Reference

A tag-value item in the storage profile where T is the type of value stored. More...

#include "storage_profile.hpp"

Inheritance diagram for llfio_v2_xxx::storage_profile::item< T >:
llfio_v2_xxx::storage_profile::item_base

Public Types

using handle_type = item_base::handle_type
 
using callable = outcome< void >(*)(storage_profile &sp, handle_type &h)
 

Public Member Functions

constexpr item (const char *_name, callable c, const char *_desc=nullptr, T _value=default_value< T >())
 
void clear ()
 Clear this item, returning value to default.
 
outcome< void > operator() (storage_profile &sp, handle_type &h) const
 Set this item if its value is default.
 

Public Attributes

callable impl
 
value
 The storage of the item.
 
char _padding [item_size - sizeof(item_base) - sizeof(callable) - sizeof(T)]
 
const char * name
 The name of the item in colon delimited category format.
 
const char * description
 Some description of the item.
 
storage_types type
 The type of the value.
 

Static Public Attributes

static constexpr size_t item_size = item_base::item_size
 

Detailed Description

template<class T>
struct llfio_v2_xxx::storage_profile::item< T >

A tag-value item in the storage profile where T is the type of value stored.

Constructor & Destructor Documentation

◆ item()

template<class T >
constexpr llfio_v2_xxx::storage_profile::item< T >::item ( const char *  _name,
callable  c,
const char *  _desc = nullptr,
_value = default_value<T>() 
)
inlineconstexpr
113 : item_base(_name, _desc, map_to_storage_type<T>())
114 , impl(c)
115 , value(std::move(_value))
116 , _padding{0}
117 {
118 static_assert(sizeof(*this) == item_size, "");
119 }
T value
The storage of the item.
Definition storage_profile.hpp:110

Member Function Documentation

◆ clear()

template<class T >
void llfio_v2_xxx::storage_profile::item< T >::clear ( )
inline

Clear this item, returning value to default.

121{ value = default_value<T>(); }

◆ operator()()

template<class T >
outcome< void > llfio_v2_xxx::storage_profile::item< T >::operator() ( storage_profile sp,
handle_type h 
) const
inline

Set this item if its value is default.

124 {
125 if(value != default_value<T>())
126 {
127 return success();
128 }
129 return impl(sp, h);
130 }

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