FuncSketch
Loading...
Searching...
No Matches
func_sketch::math::ConstantList Class Reference

Class of lists of constants. More...

#include <func_sketch/math/constant_list.h>

Collaboration diagram for func_sketch::math::ConstantList:

Public Member Functions

 ConstantList ()=default
 Constructor.
void emplace (const std::string &name, Number value)
 Append a constant to the list.
std::optional< Numberget (const std::string &name) const
 Get a constant from the list.

Private Attributes

std::unordered_map< std::string, Numberconstants_
 List of constants.

Detailed Description

Class of lists of constants.

Definition at line 33 of file constant_list.h.

Member Function Documentation

◆ emplace()

void func_sketch::math::ConstantList::emplace ( const std::string & name,
Number value )
inline

Append a constant to the list.

Parameters
[in]nameName of the constant.
[in]valueValue of the constant.

Definition at line 46 of file constant_list.h.

◆ get()

std::optional< Number > func_sketch::math::ConstantList::get ( const std::string & name) const
inlinenodiscard

Get a constant from the list.

Parameters
[in]nameName of the constant.
Returns
Constant value if found, otherwise std::nullopt.

Definition at line 56 of file constant_list.h.

Member Data Documentation

◆ constants_

std::unordered_map<std::string, Number> func_sketch::math::ConstantList::constants_
private

List of constants.

Definition at line 66 of file constant_list.h.


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