SFM_FLOW_METER Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sfm::CheckedConfig Class Reference

A configuration proven valid at build time. More...

#include <sfm_flow_meter_parts.hpp>

Public Member Functions

consteval CheckedConfig (const Config &config) noexcept
 Check config at build time.
 
constexpr const Config & Get () const &noexcept
 
void Get () const &&=delete
 Not on a temporary: the reference would dangle (KB-CPP20-044).
 

Detailed Description

A configuration proven valid at build time.

constexpr CheckedConfig kBoard{PresetFor(Variant::SFM3003_300_CL)}; fails to compile, naming ConfigIsInvalid, when Validate() rejects the configuration. Pass kBoard.Get() to the driver; the driver still validates at start-up, for configurations built at run time.

Constructor & Destructor Documentation

◆ CheckedConfig()

consteval sfm::CheckedConfig::CheckedConfig ( const Config &  config)
inlineexplicitnoexcept

Check config at build time.

Parameters
configThe configuration; it must pass Validate().

Member Function Documentation

◆ Get()

constexpr const Config & sfm::CheckedConfig::Get ( ) const &
inlineconstexprnoexcept
Returns
The checked configuration.

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