Public Member Functions

dsim_connection Class Reference

Represents a connection between two objects within a network. More...

List of all members.

Public Member Functions

const char * source_path () const
 Retrieve the source model of this connection.
const char * destination_path () const
 Retrieve the destination model of this connection.
bool is_bi_directional () const
 Test whether or not this is a bi directional connection.
void set_value (const std::string &name, const dsim_value &value) throw (dsim_type_mismatch_exception)
 Set a named value for this connection.
dsim_value value (const std::string &name)
 Retrieve a connection value by name.

Detailed Description

Represents a connection between two objects within a network.

Within a network represented by a dsim_network object and created via dsim_model::create_managed_network(), connections between objects in the network are represented by dsim_connection. Each connection has a source and a destination and may be either unidirectional or bidirectional. Each connection may also have a number of values set at it, determined by the variables declared on the parent network.


Member Function Documentation

const char * dsim_connection::destination_path (  ) const

Retrieve the destination model of this connection.

Returns:
The path of the destination model for this connection
bool dsim_connection::is_bi_directional (  ) const

Test whether or not this is a bi directional connection.

Returns:
True if this connection is bi-directional, or false if not.
void dsim_connection::set_value ( const std::string &  name,
const dsim_value value 
) throw (dsim_type_mismatch_exception)

Set a named value for this connection.

The type of the value is checked against the expected type for the named variable in the connection's network. If a type mismatch occurs, a dsim_type_mismatch_exception is thrown.

Parameters:
nameThe name of the variable for which a value should be set
valueThe value to store in the named variable
const char * dsim_connection::source_path (  ) const

Retrieve the source model of this connection.

Returns:
The path of the source model for this connection
dsim_value dsim_connection::value ( const std::string &  name )

Retrieve a connection value by name.

Parameters:
nameThe name of the variable to retrieve
Returns:
The current value of the named variable, or an invalid dsim_value() if no variable by that name has been set.
 All Classes Files Functions Typedefs Enumerations Enumerator