hydrobricks
Loading...
Searching...
No Matches
Parameter Class Reference
Inheritance diagram for Parameter:

Public Member Functions

 Parameter (const string &name, float val=NAN_F)
 
string GetName () const
 
void SetName (const string &name)
 
float GetValue () const
 
const float * GetValuePointer () const
 
void SetValue (float val)
 
void SetModifier (const ParameterModifier &modifier)
 
ParameterModifierGetModifier ()
 
const ParameterModifierGetModifier () const
 
bool HasModifier () const
 
bool UpdateFromModifier (double date)
 
virtual bool IsValid () const
 
void Validate () const
 

Protected Attributes

string _name
 
float _value
 
ParameterModifier _modifier
 
bool _hasModifier = false
 

Member Function Documentation

◆ GetModifier() [1/2]

ParameterModifier * Parameter::GetModifier ( )
inline

Get the modifier for this parameter.

Returns
pointer to the parameter modifier, or nullptr if none.

◆ GetModifier() [2/2]

const ParameterModifier * Parameter::GetModifier ( ) const
inline

Get the modifier for this parameter (const version).

Returns
pointer to the parameter modifier, or nullptr if none.

◆ GetName()

string Parameter::GetName ( ) const
inline

Get the name of the parameter.

Returns
the name of the parameter.

◆ GetValue()

float Parameter::GetValue ( ) const
inline

Get the parameter value.

Returns
the parameter value.

◆ GetValuePointer()

const float * Parameter::GetValuePointer ( ) const
inline

Get the pointer to the parameter value.

Returns
pointer to the parameter value.

◆ HasModifier()

bool Parameter::HasModifier ( ) const
inline

Check if this parameter has a modifier.

Returns
true if the parameter has a modifier.

◆ IsValid()

bool Parameter::IsValid ( ) const
nodiscardvirtual

Check if the parameter is valid. Verifies that the parameter has a name and value.

Returns
true if the parameter is valid, false otherwise.

◆ SetModifier()

void Parameter::SetModifier ( const ParameterModifier & modifier)
inline

Set a modifier for this parameter that changes its value over time.

Parameters
modifierthe parameter modifier.

◆ SetName()

void Parameter::SetName ( const string & name)
inline

Set the name of the parameter.

Parameters
namethe name of the parameter.

◆ SetValue()

void Parameter::SetValue ( float val)
inline

Set the parameter value.

Parameters
valthe parameter value.

◆ UpdateFromModifier()

bool Parameter::UpdateFromModifier ( double date)

Update the parameter value using its modifier.

Parameters
datecurrent date in MJD format.
Returns
true if the parameter was updated successfully.

◆ Validate()

void Parameter::Validate ( ) const

Validate the parameter. Throws an exception if the parameter is invalid.

Exceptions
ModelConfigErrorif validation fails.

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