scram::mef::Parameter
This class provides a representation of a variable in basic event description. More...
#include <parameter.h>
Inherits from scram::mef::Expression, scram::mef::Id, scram::mef::NodeMark, scram::mef::Usage, boost::noncopyable, scram::mef::Element, scram::mef::Role, scram::mef::ContainerElement
Public Functions
| Name | |
|---|---|
| void | expression(Expression * expression)<br>Sets the expression of this parameter. |
| Units | unit() const |
| void | unit(Units unit)<br>Sets the unit of this parameter. |
| virtual double | value() override |
| virtual Interval | interval() override |
| Id(std::string name, std::string base_path ="", RoleSpecifier role =RoleSpecifier::kPublic)<br>Constructs an element with an original name. |
Public Attributes
| Name | |
|---|---|
| constexpr const char * | kTypeString <br>Type string for errors. |
Additional inherited members
Public Functions inherited from scram::mef::Expression
| Name | |
|---|---|
| Expression(std::vector< Expression * > args ={})<br>Constructor for use by derived classes to register their arguments. | |
| virtual | ~Expression() =default |
| const std::vector< Expression * > & | args() const |
| virtual void | Validate() const<br>Validates the expression. |
| virtual bool | IsDeviate()<br>Determines if the value of the expression contains deviate expressions. |
| double | Sample() |
| void | Reset()<br>This routine resets the sampling to get new values. |
Protected Functions inherited from scram::mef::Expression
| Name | |
|---|---|
| void | AddArg(Expression * arg)<br>Registers an additional argument expression. |
Public Functions inherited from scram::mef::Id
| Name | |
|---|---|
| const std::string & | unique_name(const Element & element)<br>Produces unique name for the model element within the same type. |
| const std::string & | unique_name(const Id & element) |
| const std::string & | id() const |
| std::string_view | id_view() const |
| std::string_view | full_path() const |
| void | id(std::string name)<br>Resets the element ID. |
Protected Functions inherited from scram::mef::Id
| Name | |
|---|---|
| ~Id() =default |
Public Types inherited from scram::mef::NodeMark
| Name | |
|---|---|
| enum std::uint8_t | Mark { kClear, kTemporary, kPermanent}<br>Possible marks for the node. |
Public Functions inherited from scram::mef::NodeMark
| Name | |
|---|---|
| Mark | mark() const |
| void | mark(Mark label)<br>Sets the mark for this node. |
Protected Functions inherited from scram::mef::NodeMark
| Name | |
|---|---|
| ~NodeMark() =default |
Public Functions inherited from scram::mef::Usage
| Name | |
|---|---|
| bool | usage() const |
| void | usage(bool usage) |
Protected Functions inherited from scram::mef::Usage
| Name | |
|---|---|
| ~Usage() =default |
Public Types inherited from scram::mef::Element
| Name | |
|---|---|
| using ext::linear_set< Attribute, AttributeKey > | AttributeMap <br>Unique attribute map keyed with the attribute names. |
Public Functions inherited from scram::mef::Element
| Name | |
|---|---|
| Element(std::string name)<br>Constructs an element with an original name. | |
| const std::string & | name() const |
| std::string_view | name_view() const |
| const std::string & | label() const |
| void | label(std::string label)<br>Sets the element label. |
| const AttributeMap & | attributes() const |
| void | AddAttribute(Attribute attr)<br>Adds an attribute to the attribute map of this element. |
| void | SetAttribute(Attribute attr)<br>Sets an attribute to the attribute map. |
| const Attribute * | GetAttribute(std::string_view name) const |
| std::optional< Attribute > | RemoveAttribute(std::string_view name)<br>Removes an attribute of this element. |
Protected Functions inherited from scram::mef::Element
| Name | |
|---|---|
| ~Element() =default | |
| void | name(std::string name)<br>Resets the element name. |
Public Functions inherited from scram::mef::Role
| Name | |
|---|---|
| Role(RoleSpecifier role =RoleSpecifier::kPublic, std::string base_path ="")<br>Sets the role of an element upon creation. | |
| RoleSpecifier | role() const |
| const std::string & | base_path() const |
Protected Functions inherited from scram::mef::Role
| Name | |
|---|---|
| ~Role() =default |
Protected Functions inherited from scram::mef::ContainerElement
| Name | |
|---|---|
| const Element * | container() const |
Friends inherited from scram::mef::ContainerElement
| Name | |
|---|---|
| class | Container |
Detailed Description
class scram::mef::Parameter;This class provides a representation of a variable in basic event description.
It is both expression and element description.
Public Functions Documentation
function expression
void expression(
Expression * expression
)Sets the expression of this parameter.
Parameters:
- expression The expression to describe this parameter.
Exceptions:
- LogicError The parameter expression is already set.
function unit
inline Units unit() constReturn: The unit of this parameter.
function unit
inline void unit(
Units unit
)Sets the unit of this parameter.
Parameters:
- unit A valid unit.
function value
inline virtual double value() overrideReturn: The mean value of this expression.
Reimplements: scram::mef::Expression::value
function interval
inline virtual Interval interval() overrideReturn: The domain interval for validation purposes only.
Reimplements: scram::mef::Expression::interval
function Id
explicit Id(
std::string name,
std::string base_path ="",
RoleSpecifier role =RoleSpecifier::kPublic
)Constructs an element with an original name.
Parameters:
- name The local identifier name.
- role A role specifier of the element.
- base_path The series of containers to get this event.
Exceptions:
- LogicError The name is required and empty.
- ValidityError The name is malformed.
- ValidityError The base path string is malformed.
- ValidityError Private element at model/global scope.
The name is expected to conform to identifier requirements described in the MEF documentation and additions.
Sets the role of an element upon creation.
The base reference path must be formatted according to the MEF documentation and additions.
Mangles the element name into a unique id. Private elements get their full path as their ids, while public elements retain their name as ids.
Public Attributes Documentation
variable kTypeString
static constexpr const char * kTypeString = "parameter";Type string for errors.
Updated on 2025-11-11 at 16:51:08 +0000
