Functions

Model Data Lookup

dsim_model member functions that provide lookup of local variables and setup of outlets More...

Functions

dsim_variable dsim_model::request_local_variable (const char *name, bool quiet=false)
 Look up a variable created by this object.
dsim_value dsim_model::current_value_for_variable (const char *name)
 Look up the current value of a variable created by this object.
bool dsim_model::connect_outlet (const char *name, const dsim_variable &source, const char *source_object=NULL)
 Connect one of this object's outlets to a variable.

Detailed Description

dsim_model member functions that provide lookup of local variables and setup of outlets

These methods are generally called on an object by other objects to look up local variables.


Function Documentation

bool dsim_model::connect_outlet ( const char *  name,
const dsim_variable source,
const char *  source_object = NULL 
) [inherited]

Connect one of this object's outlets to a variable.

Connects the named outlet to the provided source variable. This function will generally not be called by user code, though it may be; outlets are usually connected to sources automatically according to the simulation setup file.

If the source variable's type or units do not match the outlet's type or units, a warning will be printed but the connection will succeed.

Parameters:
nameThe name of the outlet to connect.
sourceThe source variable to which the outlet should be connected.
source_objectIf not null and the specified outlet is marked as dependent, a dependency for this object on source_object will be set up.
Returns:
True if the connection succeeded, or false if it failed due to provided name not naming an outlet at this object.
dsim_variable dsim_model::request_local_variable ( const char *  name,
bool  quiet = false 
) [inherited]

Look up a variable created by this object.

Looks up a variable that has been created at this object with one of the create_* functions. Note that this function will not look up outlets.

Parameters:
nameThe name of the variable to look up.
quietIf true, suppresses showing a warning if a variable with the specified name does not exist.
Returns:
The variable with the given name, if one exists. If not, returns an invalid dsim_variable object (valid() on the returned object will return false).
 All Classes Files Functions Typedefs Enumerations Enumerator