Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

simth::DeviceSystemIntf Class Reference

Abstract base class of a simulation system interface. More...

#include <devicesystemintf.h>

Inheritance diagram for simth::DeviceSystemIntf:

simth::FreeConnectionSystem simth::StreamDrivenSystem List of all members.

Public Types

enum  process_signal { READY_TO_PROCESS, STOP_ITERATION, STOP_SIMULATION_PREMATURE }

Public Member Functions

 DeviceSystemIntf ()
virtual ~DeviceSystemIntf ()
virtual void connectInterface (ControlInterface *interface, const std::string &varName)=0
virtual Devicedevice (int deviceNr)=0
virtual const Devicedevice (int deviceNr) const =0
virtual void acceptSignal (Device *dev, process_signal sig)=0
template<class T>
void writeParameter (const std::string &parameterName, const T &value) throw (simth::name_conflict)
template<class T>
readParameter (const std::string &parameterName) const throw (simth::no_such_parameter, simth::type_error)
virtual void warningMessage (const std::string &warningMess, int deviceNr) const =0

Protected Member Functions

void printParameterList (std::ostream &os) const

Detailed Description

Abstract base class of a simulation system interface.

This class declares functions to access a SimulationSystem. The class Device takes this interface to access the simulation system.


Member Enumeration Documentation

enum simth::DeviceSystemIntf::process_signal
 

Signals that can be send from a device to the simulation system by means of the DeviceSystemIntf::acceptSignal() function.

WATCH OUT: These 'signals' are only signalled through functions in the simth::Device class. In any derived Device, you should only call the funtions in the Device base class, not directly the acceptSignal() function.

Note:
This enum gives unnecessary headache. Since every signal has to be declared inside this enum, every one of them could just as well be declared as virtual methods in this base class -- in both cases it is something declared in this base clase. Maybe we should get rid of this enum altogether and only provide direct methods to be called.
Enumeration values:
READY_TO_PROCESS  If a device sends a 'READY_TO_PROCESS' signal, the StreamDrivenSystem will queue a request for processing of that device in a 'process queue'. During a simulation run, the StreamDrivenSystem calls the process functions of the device whose 'request for processing' is in the first position of the process queue, and then consecutively every next device.
STOP_ITERATION  If a device sends a 'STOP_ITERATION' signal, the StreamDrivenSystem stops the current iteration. This means that no new(!) request for processing will be accepted by the StreamDrivenSystem and the process function of the start device will not be called if the process queue runs empty. With other words, only 'request for processing' that had been queued in the process queue, will be processed by the StreamDrivenSimulationSystem, i.e. the process functions of the corresponding devices will be called. (The argument 'device' of that signalling will be ignored.)
STOP_SIMULATION_PREMATURE  This signal will stop the simulation run. The current iteration will still be finished (i.e. the same as STOP_ITERATION is completed), and then the simulation will stop regardless of any unfinished iterations. (The argument 'device' of that signalling will be ignored.)


Constructor & Destructor Documentation

simth::DeviceSystemIntf::DeviceSystemIntf  ) 
 

Class constructor.

virtual simth::DeviceSystemIntf::~DeviceSystemIntf  )  [virtual]
 

Virtual Destructor.


Member Function Documentation

virtual void simth::DeviceSystemIntf::connectInterface ControlInterface interface,
const std::string &  varName
[pure virtual]
 

Connects a ControlInterface of the Device calling this function, to a loop control of the SimulationDeviceIntf.

Parameters:
interface pointer to control interface
varName name of the loop control the controlInterface is connected to

Implemented in simth::StreamDrivenSystem.

virtual Device* simth::DeviceSystemIntf::device int  deviceNr  )  [pure virtual]
 

Returns a pointer to the specified device.

virtual const Device* simth::DeviceSystemIntf::device int  deviceNr  )  const [pure virtual]
 

Returns a pointer to the specified device. (Constant version)

Implemented in simth::StreamDrivenSystem.

virtual void simth::DeviceSystemIntf::acceptSignal Device dev,
process_signal  sig
[pure virtual]
 

Receive a signal from the specified device.

WATCH OUT: These 'signals' are only signalled through functions in the simth::Device class. In any derived Device, you should only call the funtions in the Device base class, not directly the acceptSignal() function.

Parameters:
dev Pointer to the device sending the signal. For some signals, this might simply be ignored.
sig The type of signal, see process_signal

Implemented in simth::StreamDrivenSystem.

template<class T>
void simth::DeviceSystemIntf::writeParameter const std::string &  parameterName,
const T &  value
throw (simth::name_conflict) [inline]
 

DEPRECATED. Writes a parameter of any type to the system-wide parameter list.

This concept is deprecated because it totally blurs the data flow between the devices. Please don't use it anymore.

This can be useful, if a device would like to give some parameter values to other devices. If the list already contains a parameter with the given name but a different value, a simth::name_conflict error is thrown.

Parameters:
parameterName name of the parameter
value value of the parameter

template<class T>
T simth::DeviceSystemIntf::readParameter const std::string &  parameterName  )  const throw (simth::no_such_parameter, simth::type_error) [inline]
 

DEPRECATED. Reads a parameter of any type from the system-wide parameter list.

This concept is deprecated because it totally blurs the data flow between the devices. Please don't use it anymore.

This can be useful, if a device would get some parameter values from other devices. However, these parameter values must have been written to that list before using writeParameter(). If the list contains no parameter with the given name, a simth::no_such_parameter error is thrown. If the parameter value stored in the list with the given name and the value a device asked for have different types, a simth::type_error error is thrown.

Parameters:
parameterName name of the parameter
Returns:
value of the parameter

virtual void simth::DeviceSystemIntf::warningMessage const std::string &  warningMess,
int  deviceNr
const [pure virtual]
 

This function can be used to print out warnings.

Implemented in simth::FreeConnectionSystem.

void simth::DeviceSystemIntf::printParameterList std::ostream &  os  )  const [protected]
 

Prints the system parameters to the given output stream.


Generated on Mon Aug 15 13:54:35 2005 for simthetic by  doxygen 1.4.1