pub struct EcucNumericalParamValue(/* private fields */);
Expand description
The EcucNumericalParamValue
holds a numerical value and can represent boolean, float or int parameter definitions.
Internally this value is stored as a string; in additon to the value()
function, there are also
value_bool()
, value_int()
and value_float()
functions, which parse the string and should be used as appropriate.
Implementations§
Source§impl EcucNumericalParamValue
impl EcucNumericalParamValue
Sourcepub fn set_definition<T: EcucParamDef>(
&self,
definition: &T,
) -> Result<(), AutosarAbstractionError>
pub fn set_definition<T: EcucParamDef>( &self, definition: &T, ) -> Result<(), AutosarAbstractionError>
set the parameter definition reference
Sourcepub fn definition(&self) -> Option<EcucParameterDef>
pub fn definition(&self) -> Option<EcucParameterDef>
get the parameter definition
This function returns the definition as an EcucParameterDef
enum, which
could contain either an EcucFloatParamDef
or an EcucIntegerParamDef
.
If the definition is not loaded, use definition_ref()
instead.
Sourcepub fn definition_ref(&self) -> Option<String>
pub fn definition_ref(&self) -> Option<String>
get the parameter definition reference as a string
This function is an alternative to definition()
; it is useful when the
referenced definition is not loaded and can’t be resolved.
Sourcepub fn set_value(&self, value: &str) -> Result<(), AutosarAbstractionError>
pub fn set_value(&self, value: &str) -> Result<(), AutosarAbstractionError>
set the numerical value as a string
Sourcepub fn value_bool(&self) -> Option<bool>
pub fn value_bool(&self) -> Option<bool>
get the numerical value as a boolean
Sourcepub fn value_float(&self) -> Option<f64>
pub fn value_float(&self) -> Option<f64>
get the numerical value as a float
Sourcepub fn set_index(
&self,
index: Option<u64>,
) -> Result<(), AutosarAbstractionError>
pub fn set_index( &self, index: Option<u64>, ) -> Result<(), AutosarAbstractionError>
set the index of the parameter
If the parameter definition has requiresIndex
set to true
, then the parameter
must have an index. Otherwise the index is meaningless.
Sourcepub fn index(&self) -> Option<u64>
pub fn index(&self) -> Option<u64>
get the index of the parameter
If the parameter definition has requiresIndex
set to true
, then the parameter
must have an index. Otherwise the index is meaningless.
Sourcepub fn set_is_auto_value(
&self,
is_auto_value: Option<bool>,
) -> Result<(), AutosarAbstractionError>
pub fn set_is_auto_value( &self, is_auto_value: Option<bool>, ) -> Result<(), AutosarAbstractionError>
set the isAutoValue flag
If the parameter definition has withAuto
set to true
, then the parameter is allowed to have an auto value.
Sourcepub fn is_auto_value(&self) -> Option<bool>
pub fn is_auto_value(&self) -> Option<bool>
get the isAutoValue flag
Trait Implementations§
Source§impl Clone for EcucNumericalParamValue
impl Clone for EcucNumericalParamValue
Source§fn clone(&self) -> EcucNumericalParamValue
fn clone(&self) -> EcucNumericalParamValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for EcucNumericalParamValue
impl Debug for EcucNumericalParamValue
Source§impl From<EcucNumericalParamValue> for Element
impl From<EcucNumericalParamValue> for Element
Source§fn from(val: EcucNumericalParamValue) -> Self
fn from(val: EcucNumericalParamValue) -> Self
Source§impl Hash for EcucNumericalParamValue
impl Hash for EcucNumericalParamValue
Source§impl PartialEq for EcucNumericalParamValue
impl PartialEq for EcucNumericalParamValue
Source§impl TryFrom<Element> for EcucNumericalParamValue
impl TryFrom<Element> for EcucNumericalParamValue
impl Eq for EcucNumericalParamValue
impl StructuralPartialEq for EcucNumericalParamValue
Auto Trait Implementations§
impl Freeze for EcucNumericalParamValue
impl !RefUnwindSafe for EcucNumericalParamValue
impl Send for EcucNumericalParamValue
impl Sync for EcucNumericalParamValue
impl Unpin for EcucNumericalParamValue
impl !UnwindSafe for EcucNumericalParamValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.