Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61040 - trunk/libs/statechart/doc
From: ahd6974-boostorg_at_[hidden]
Date: 2010-04-04 09:31:25


Author: andreas_huber69
Date: 2010-04-04 09:31:24 EDT (Sun, 04 Apr 2010)
New Revision: 61040
URL: http://svn.boost.org/trac/boost/changeset/61040

Log:
Added documentation for triggering_event.
Text files modified:
   trunk/libs/statechart/doc/future_and_history.html | 21 ++++++++-------------
   trunk/libs/statechart/doc/reference.html | 22 ++++++++++++++++++++++
   2 files changed, 30 insertions(+), 13 deletions(-)

Modified: trunk/libs/statechart/doc/future_and_history.html
==============================================================================
--- trunk/libs/statechart/doc/future_and_history.html (original)
+++ trunk/libs/statechart/doc/future_and_history.html 2010-04-04 09:31:24 EDT (Sun, 04 Apr 2010)
@@ -51,19 +51,6 @@
 
     <li>Optimize state-entry and state-exit for speed and code-size</li>
 
- <li>Implement <code>simple_state::triggering_event()</code>, which
- returns a pointer to the event that triggered the action currently being
- executed. This is useful for the rare cases when an entry or exit action
- needs to access the event that triggered the execution of the action.
- <code>triggering_event()</code> returns a <code>const event_base *</code>
- due to the fact that entry and exit actions can be triggered by events of
- any type or no event at all
- (<code>state_machine&lt;&gt;::initiate()</code> &amp;
- <code>state_machine::terminate()</code>). The caller thus needs to make a
- type check or cast the return value. The use of
- <code>triggering_event</code>() therefore often indicates a problem in
- the state machine design and should be avoided whenever possible</li>
-
     <li>Reimplement <code>fifo_scheduler&lt;&gt;::processor_handle</code> so
     that <code>fifo_scheduler&lt;&gt;::create_processor&lt;&gt;()</code> and
     <code>fifo_scheduler&lt;&gt;::destroy_processor()</code> no longer make
@@ -140,6 +127,14 @@
 
   <p>(<font color="#FF0000">red</font> = points raised during formal
   review)</p>
+ <p>1.43.0</p>
+ <ul>
+ <li>Generalized the context() functions so that they can also return a
+ reference to any public base type of a context. This also makes
+ transition&lt;&gt; &amp; in_state_reaction&lt;&gt; more general, reported by Igor R</li>
+ <li>Added triggering_event()</li>
+ </ul>
+
   <p>1.40.0</p>
   <ul>
     <li>Fixed a bug that prevented the use of boost::ref() with

Modified: trunk/libs/statechart/doc/reference.html
==============================================================================
--- trunk/libs/statechart/doc/reference.html (original)
+++ trunk/libs/statechart/doc/reference.html 2010-04-04 09:31:24 EDT (Sun, 04 Apr 2010)
@@ -759,6 +759,8 @@
 "#Classevent_base">event_base</a> &gt; &amp; );
       void post_event( const <a href=
 "#Classevent_base">event_base</a> &amp; );
+
+ const event_base * triggering_event() const;
   };
 }
 }
@@ -1202,6 +1204,15 @@
   <b>Note</b>: The position of a given innermost state in the range is
   arbitrary. It may change with each call to a modifier function. Moreover,
   all iterators are invalidated whenever a modifier function is called</p>
+ <pre>
+const event_base * <a name="triggering_event1" id="triggering_event1">triggering_event</a>();
+</pre>
+
+ <p><b>Returns</b>: A pointer to the event that triggered the reaction that is currently
+ being executed. Returns <code>0</code> if no reaction is being executed or if the current
+ reaction was triggered by either <code>initiate()</code> or
+ <code>terminate()</code>
+ </p>
 
   <h1>Header &lt;boost/statechart/<br>
   <a name="asynchronous_state_machine.hpp" id=
@@ -1934,6 +1945,8 @@
 
 state_iterator <b>state_begin</b>() const;
 state_iterator <b>state_end</b>() const;
+
+const event_base * <b>triggering_event</b>() const;
 </pre>
 
   <p>States that need to call any of these member functions from their
@@ -2077,6 +2090,8 @@
       state_iterator <a href=
 "#simple_state::state_end">state_end</a>() const;
 
+ const event_base * triggering_event() const;
+
       void post_event(
         const intrusive_ptr&lt; const <a href=
 "#Classevent_base">event_base</a> &gt; &amp; );
@@ -2623,6 +2638,12 @@
   <b>Note</b>: The result is <b>unspecified</b> if these functions are called
   when the machine is <a href=
   "definitions.html#UnstableStateMachine">unstable</a></p>
+ <pre>
+const event_base * <a name="triggering_event0" id="triggering_event0">triggering_event</a>();
+</pre>
+
+ <p><b>Returns</b>: Has exactly the same semantics as
+ <code>state_machine<>::triggering_event()</code></p>
 
   <h3>Class template <code>simple_state</code> static functions</h3>
   <pre>
@@ -2703,6 +2724,7 @@
 
 state_iterator <b>state_begin</b>() const;
 state_iterator <b>state_end</b>() const;
+const event_base * <b>triggering_event</b>() const;
 </pre>
 
   <p>States that do not need to call any of these member functions from their


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk