EMIPLIB
Public Member Functions

MIPInterChainTimer Class Reference

Component which generates a MIPSYSTEMMESSAGE_TYPE_ISTIME system message when data has been supplied to it from another chain. More...

#include <mipinterchaintimer.h>

Inheritance diagram for MIPInterChainTimer:
Inheritance graph
[legend]
Collaboration diagram for MIPInterChainTimer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool init (int count=1, MIPTime safetyTimeout=MIPTime(0.5))
 Initializes the component.
bool destroy ()
 De-initializes the component.
MIPComponentgetTriggerComponent ()
 Returns a pointer to the internal 'trigger component'.

Detailed Description

This component generates a MIPSYSTEMMESSAGE_TYPE_ISTIME system message when a component from another thread has delivered data to its 'trigger component'. The trigger component accepts any incoming message; the main component only accepts a MIPSYSTEMMESSAGE_TYPE_WAITTIME message.


Member Function Documentation

bool MIPInterChainTimer::destroy ( )
MIPComponent* MIPInterChainTimer::getTriggerComponent ( )

Returns a pointer to the internal 'trigger component'. Note that the init function has to be called to create such a component.

bool MIPInterChainTimer::init ( int  count = 1,
MIPTime  safetyTimeout = MIPTime(0.5) 
)

To initialize the component, this function must be called first. When the initialization was succesfull, an internal 'trigger component' is created, which can accept messages from another thread. When this happens, a signal is sent to the main component, causing it to generate a MIPSYSTEMMESSAGE_TYPE_ISTIME message.

Parameters:
countInstead of sending a signal to the main component on each incoming message, it is also possible to skip a number of messages each time. If this parameter is 1 or less, each message will cause a signal to be sent. If the value is 2 for example, every other message will cause a signal to be sent.
safetyTimeoutBecause this component will be waiting for signals from another chain, problems would arise if that chain crashed for example. To avoid this, a background thread is started which checks if a signal has been sent in the time interval specified by safetyTimeout. If not, the thread itself will send a signal to force progress in this component's chain.

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