coral
A C++ library for distributed co-simulation
Public Member Functions | List of all members
coral::model::VariableSetting Class Reference

An object which represents the action of assigning an initial value to a variable, or to connect it to another variable. More...

#include "coral/model.hpp"

Public Member Functions

 VariableSetting (VariableID variable, const ScalarValue &value)
 Indicates a variable which should be given a specific value.
 
 VariableSetting (VariableID inputVar, const coral::model::Variable &outputVar)
 Indicates an input variable which should be connected to, or disconnected from, an output variable. More...
 
 VariableSetting (VariableID inputVar, const ScalarValue &value, const coral::model::Variable &outputVar)
 Indicates an input variable which should both be given a specific value and connected to or disconnected from an output variable. More...
 
VariableID Variable () const CORAL_NOEXCEPT
 The variable ID.
 
bool HasValue () const CORAL_NOEXCEPT
 Whether the variable is to be given a value.
 
const ScalarValueValue () const
 The variable value, if any. More...
 
bool IsConnectionChange () const CORAL_NOEXCEPT
 Whether this represents a variable connection change.
 
const coral::model::VariableConnectedOutput () const
 The output to which the variable is to be connected, if any. More...
 

Detailed Description

An object which represents the action of assigning an initial value to a variable, or to connect it to another variable.

Constructor & Destructor Documentation

coral::model::VariableSetting::VariableSetting ( VariableID  inputVar,
const coral::model::Variable outputVar 
)

Indicates an input variable which should be connected to, or disconnected from, an output variable.

If outputVar is a default-constructed Variable object (i.e., if outputVar.Empty() is true) this is equivalent to "no connection", meaning that an existing connection should be broken.

coral::model::VariableSetting::VariableSetting ( VariableID  inputVar,
const ScalarValue value,
const coral::model::Variable outputVar 
)

Indicates an input variable which should both be given a specific value and connected to or disconnected from an output variable.

If outputVar is a default-constructed Variable object (i.e., if outputVar.Empty() is true) this is equivalent to "no connection", meaning that an existing connection should be broken.

Member Function Documentation

const coral::model::Variable& coral::model::VariableSetting::ConnectedOutput ( ) const

The output to which the variable is to be connected, if any.

Precondition
IsConnectionChange() == true
const ScalarValue& coral::model::VariableSetting::Value ( ) const

The variable value, if any.

Precondition
HasValue() == true

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