User Tools

Site Tools


eeros_architecture:sequencer:usage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
eeros_architecture:sequencer:usage [2015/10/30 10:47] – [Non Blocking Call of a Sub-Sequence] grafeeros_architecture:sequencer:usage [2015/10/30 10:48] (current) – removed graf
Line 1: Line 1:
-======Sequencer Usage====== 
-This page describes the usage of the sequencer in the EEROS framework.  
- 
- 
- 
-===== Subsequence===== 
-A subsequence is a sequence which is called by another sequence. Such a subsequence can be called in a blocking or non-blocking way. Blocking means that the step waits (or blocks) until the subsequence has finished. Non-blocking means that subsequence and main sequence run concurrently.  
- 
-====Blocking Call of a Subsequence==== 
-If you want to save your own data in the sequence, you need to create a new instance of a sequence. This should be done in the desired step (method) of the superior sequence.  
-e.g. in the method //MoveBlocking()// 
- 
-<code c> 
-MyBlockingSubSequence* subSequence = dynamic_cast<MyBlockingSubSequence*>eeros::sequencer::Sequence::getSequence("BlockingSubSequence")); 
-if(!subSequence){ 
-  //callerThread for Blocking Sub Sequence is the same as is in this running Sequence. 
-  subSequence = new MyBlockingSubSequence("BlockingSubSequence", callerThread); 
-} 
-</code> 
- 
-**Note:** 
-  *In the above lines only one object of //MyBlockingSubSequence// with the name //BlockingSubSequence// is created. 
-  *It is not allowed to call the //callerThread.addRunnable(this)// method, because the superior sequence calls the blocking sub-sequence directly by the //run()// method. 
- 
-To start the sub-sequence just call //run()//, which calls all methods in the callback list (filled by //fillCallBacks()//). Be sure that the sub-sequence is terminated before you restart it. This could happen, for example, in an exception handling ( [[.:..:sequencer_usage:error_handler | Error Handler]] ). 
- 
-<code c> 
-//Here we wait for the returning of the subSequence.run() method 
-while(subSequence->getState() != eeros::sequencer::kSequenceFinished){ 
- subSequence->run(); 
-} 
-</code> 
- 
  
eeros_architecture/sequencer/usage.1446198477.txt.gz · Last modified: 2015/10/30 10:47 (external edit)