SyDEVS  v0.6.5
Multiscale Simulation and Systems Modeling Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sydevs::systems::port< message, input, T > Class Template Reference

A class template for message input ports. More...

#include <port.h>

Inherits sydevs::systems::port_base< message, input, T >.

Public Member Functions

 port (const std::string &port_name, const node_interface &external_interface)
 Constructs a port<message, input> object. More...
 
 port (port &&)=default
 Move constructor. More...
 
portoperator= (port &&)=default
 Move assignment. More...
 
 ~port ()=default
 Destructor. More...
 
bool received () const
 Returns true if the port was the receipient of the latest incoming message. More...
 
const T & value () const
 Returns the current value attached to the port. More...
 
void print_on_use (bool flag=true) const
 If flag is true, all values communicated through this port are printed. More...
 
- Public Member Functions inherited from sydevs::systems::port_base< message, input, T >
 port_base (const port_base &)=delete
 No copy constructor. More...
 
 port_base (port_base &&)=default
 Move constructor. More...
 
port_baseoperator= (const port_base &)=delete
 No copy assignment. More...
 
port_baseoperator= (port_base &&)=default
 Move assignment. More...
 
virtual ~port_base ()=default
 Destructor. More...
 
const std::string & port_name () const
 Returns the name of the port. More...
 
int64 port_index () const
 Returns the index of the port within the encompassing node_interface object. More...
 
int64 node_index () const
 Returns the index of the node within the encompassing node_structure object. More...
 
const node_interfaceexternal_interface () const
 Returns the encomassing node_interface object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sydevs::systems::port_base< message, input, T >
 port_base (const std::string &port_name, int64 port_index, node_interface &external_interface)
 

Detailed Description

template<typename T>
class sydevs::systems::port< message, input, T >

A class template for message input ports.

A port<message, input> object is used to supply a system_node object with messages during a simulation.

Template Parameters
TThe type of data handled by the port.

Constructor & Destructor Documentation

template<typename T >
sydevs::systems::port< message, input, T >::port ( const std::string &  port_name,
const node_interface external_interface 
)

Constructs a port<message, input> object.

The port is created and registered with the encompassing node_interface object.

Parameters
port_nameThe name of the port.
external_interfaceThe encompassing node_interface object associated with the node.
Template Parameters
TThe type of data handled by the port.
template<typename T >
sydevs::systems::port< message, input, T >::port ( port< message, input, T > &&  )
default

Move constructor.

template<typename T >
sydevs::systems::port< message, input, T >::~port ( )
default

Destructor.

Member Function Documentation

template<typename T >
port& sydevs::systems::port< message, input, T >::operator= ( port< message, input, T > &&  )
default

Move assignment.

template<typename T >
void sydevs::systems::port< message, input, T >::print_on_use ( bool  flag = true) const

If flag is true, all values communicated through this port are printed.

template<typename T >
bool sydevs::systems::port< message, input, T >::received ( ) const

Returns true if the port was the receipient of the latest incoming message.

template<typename T >
const T & sydevs::systems::port< message, input, T >::value ( ) const

Returns the current value attached to the port.


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