Reference

todo

Back-end

todo

File: <boost/msm/back/state_machine.hpp>

                    boost/msm/back/state_machine.hpp  
                    fff
                    void start
                    template <class Event> HandledEnum process_event
                    const int* current_state const
                
 template <class Derived,class HistoryPolicy=NoHistory,class
                            CompilePolicy=favor_runtime_speed> state_machine {
  void start();
  template <class Event> HandledEnum process_event(Event const&);
  const int* current_state const();
  const BaseState* get_state_by_id const(int id);
  bool is_contained const();
  template <class State> State* get_state();
  template <class State> State& get_state();
  template <class Flag,class BinaryOp> bool is_flag_active();
  template <class Flag> bool is_flag_active();
  void visit_current_states();
  void visit_current_states(any-type param1, any-type param2,...);
  template <class Event> void defer_event(Event const&);
}

eUML functions

The following table lists the supported operators:

Table 1. Operators and state machine helpers

eUML function / operatorDescriptionFunctor
&&Calls lazily Action1&& Action2And_
||Calls lazily Action1|| Action2Or_
!Calls lazily !Action1Not_
!=Calls lazily Action1 != Action2NotEqualTo_
==Calls lazily Action1 == Action2EqualTo_
>Calls lazily Action1 > Action2Greater_
>=Calls lazily Action1 >= Action2Greater_Equal_
<Calls lazily Action1 < Action2Less_
<=Calls lazily Action1 <= Action2Less_Equal_
&Calls lazily Action1 & Action2Bitwise_And_
|Calls lazily Action1 | Action2Bitwise_Or_
^Calls lazily Action1 ^ Action2Bitwise_Xor_
--Calls lazily --Action1 / Action1--Pre_Dec_ / Post_Dec_
++Calls lazily ++Action1 / Action1++Pre_Inc_ / Post_Inc_
/Calls lazily Action1 / Action2Divides_
/=Calls lazily Action1 /= Action2Divides_Assign_
*Calls lazily Action1 * Action2Multiplies_
*=Calls lazily Action1 *= Action2Multiplies_Assign_
+ (binary)Calls lazily Action1 + Action2Plus_
+ (unary)Calls lazily +Action1Unary_Plus_
+=Calls lazily Action1 += Action2Plus_Assign_
- (binary)Calls lazily Action1 - Action2Minus_
- (unary)Calls lazily -Action1Unary_Minus_
-=Calls lazily Action1 -= Action2Minus_Assign_
%Calls lazily Action1 % Action2Modulus_
%=Calls lazily Action1 %= Action2Modulus_Assign_
>>Calls lazily Action1 >> Action2ShiftRight_
>>=Calls lazily Action1 >>= Action2ShiftRight_Assign_
<<Calls lazily Action1 << Action2ShiftLeft_
<<=Calls lazily Action1 <<= Action2ShiftLeft_Assign_
[] (works on vector, map, arrays)Calls lazily Action1 [Action2]Subscript_
if_then_else_(Condition,Action1,Action2)Returns either the result of calling Action1 or the result of calling Action2If_Else_
if_then_(Condition,Action)Returns the result of calling Action if ConditionIf_Then_
while_(Condition, Body)While Condition(), calls Body(). Returns nothingWhile_Do_
do_while_(Condition, Body)Calls Body() while Condition(). Returns nothingDo_While_
for_(Begin,Stop,EndLoop,Body)Calls for(Begin;Stop;EndLoop){Body;}For_Loop_
process_(Event [,fsm1] [,fsm2] [,fsm3] [,fsm4])Processes Event on the current state machine (if no fsm specified) or on up to 4 state machines returned by an appropriate functor.Process_
process2_(Event, Data [,fsm1] [,fsm2] [,fsm3])Processes Event on the current state machine (if no fsm specified) or on up to 2 state machines returned by an appropriate functor. The event is copy-constructed from what Data() returns.Process2_
is_flag_(Flag [,fsm])Calls is_flag_active() on the current state machine or the one returned by calling fsm.Get_Flag_
event_ [(attribute name)]Returns the current event (as const reference)GetEvent_
source_ [(attribute name)]Returns the source state of the currently triggered transition (as reference). If an attribute name is provided, returns the attribute by reference.GetSource_
target_ [(attribute name)]Returns the target state of the currently triggered transition (as reference). If an attribute name is provided, returns the attribute by reference.GetTarget_
state_ [(attribute name)]Returns the source state of the currently active state (as reference). Valid inside a state entry/exit action. If an attribute name is provided, returns the attribute by reference.GetState_
fsm_ [(attribute name)]Returns the current state machine (as reference). Valid inside a state entry/exit action or a transition. If an attribute name is provided, returns the attribute by reference.GetFsm_
substate_(state_name [,fsm])Returns (as reference) the state state_name referenced in the current state machine or the one given as argument.SubState_


TODO macro for functor def

To use these functions, you need to include:

#include <msm/front/euml/euml.hpp>

Functional programming

To use these functions, you need to include:

#include <msm/front/euml/stl.hpp>

or the specified header in the following tables.

The following table lists the supported STL algorithms:

Table 2. STL algorithms

STL algorithms in querying.hppFunctor
find_(first, last, value)Find_
find_if_(first, last, value)FindIf_
lower_bound_(first, last, value [,opᵃ])LowerBound_
upper_bound_(first, last, value [,opᵃ])UpperBound_
equal_range_(first, last, value [,opᵃ])EqualRange_
binary_search_(first, last, value [,opᵃ])BinarySearch_
min_element_(first, last[,opᵃ])MinElement_
max_element_(first, last[,opᵃ])MaxElement_
adjacent_find_(first, last[,opᵃ])AdjacentFind_
find_end_( first1, last1, first2, last2 [,op ᵃ])FindEnd_
find_first_of_( first1, last1, first2, last2 [,op ᵃ])FindFirstOf_
equal_( first1, last1, first2 [,op ᵃ])Equal_
search_( first1, last1, first2, last2 [,op ᵃ])Search_
includes_( first1, last1, first2, last2 [,op ᵃ])Includes_
lexicographical_compare_ ( first1, last1, first2, last2 [,op ᵃ]) LexicographicalCompare_
count_(first, last, value [,size])Count_
count_if_(first, last, op ᵃ [,size])CountIf_
distance_(first, last)Distance_
mismatch _( first1, last1, first2 [,op ᵃ])Mismatch_


Table 3. STL algorithms

STL algorithms in transformation.hppFunctor
copy_(first, last, result)Copy_
copy_backward_(first, last, result)CopyBackward_
reverse_(first, last)Reverse_
reverse_copy_(first, last , result)ReverseCopy_
remove_(first, last, value)Remove_
remove_if_(first, last , opᵃ)RemoveIf_
remove_copy_(first, last , output, value)RemoveCopy_
remove_copy_if_(first, last, output, opᵃ)RemoveCopyIf_
fill_(first, last, value)Fill_
fill_n_(first, size, value)ᵇFillN_
generate_(first, last, generatorᵃ)Generate_
generate_(first, size, generatorᵃ)ᵇGenerateN_
unique_(first, last [,opᵃ])Unique_
unique_copy_(first, last, output [,opᵃ])UniqueCopy_
random_shuffle_(first, last [,opᵃ])RandomShuffle_
rotate_copy_(first, middle, last, output)RotateCopy_
partition_ (first, last [,opᵃ])Partition_
stable_partition_ (first, last [,opᵃ])StablePartition_
stable_sort_(first, last [,opᵃ])StableSort_
sort_(first, last [,opᵃ])Sort_
partial_sort_(first, middle, last [,opᵃ])PartialSort_
partial_sort_copy_ (first, last, res_first, res_last [,opᵃ]) PartialSortCopy_
nth_element_(first, nth, last [,opᵃ])NthElement_
merge_( first1, last1, first2, last2, output [,op ᵃ])Merge_
inplace_merge_(first, middle, last [,opᵃ])InplaceMerge_
set_union_(first1, last1, first2, last2, output [,op ᵃ])SetUnion_
push_heap_(first, last [,op ᵃ])PushHeap_
pop_heap_(first, last [,op ᵃ])PopHeap_
make_heap_(first, last [,op ᵃ])MakeHeap_
sort_heap_(first, last [,op ᵃ])SortHeap_
next_permutation_(first, last [,op ᵃ])NextPermutation_
prev_permutation_(first, last [,op ᵃ])PrevPermutation_
inner_product_(first1, last1, first2, init [,op1ᵃ] [,op2ᵃ]) InnerProduct_
partial_sum_(first, last, output [,opᵃ])PartialSum_
adjacent_difference_(first, last, output [,opᵃ])AdjacentDifference_
replace_(first, last, old_value, new_value)Replace_
replace_if_(first, last, opᵃ, new_value)ReplaceIf_
replace_copy_(first, last, result, old_value, new_value)ReplaceCopy_
replace_copy_if_(first, last, result, opᵃ, new_value)ReplaceCopyIf_
rotate_(first, middle, last)ᵇRotate_


Table 4. STL container methods

STL container methods(common) in container.hppFunctor
container::reference front_(container)Front_
container::reference back_(container)Back_
container::iterator begin_(container)Begin_
container::iterator end_(container)End_
container::reverse_iterator rbegin_(container)RBegin_
container::reverse_iterator rend_(container)REnd_
void push_back_(container, value)Push_Back_
void pop_back_(container, value)Pop_Back_
void push_front_(container, value)Push_Front_
void pop_front_(container, value)Pop_Front_
void clear_(container)Clear_
size_type capacity_(container)Capacity_
size_type size_(container)Size_
size_type max_size_(container)Max_Size_
void reserve_(container, value)Reserve _
void resize_(container, value)Resize _
iterator insert_(container, pos, value)Insert_
void insert_( container , pos, first, last)Insert_
void insert_( container , pos, number, value)Insert_
void swap_( container , other_container)Swap_
void erase_( container , pos)Erase_
void erase_( container , first, last) Erase_
bool empty_( container)Empty_


Table 5. STL list methods

std::list methods in container.hppFunctor
void list_remove_(container, value)ListRemove_
void list_remove_if_(container, opᵃ)ListRemove_If_
void list_merge_(container, other_list)ListMerge_
void list_merge_(container, other_list, opᵃ)ListMerge_
void splice_(container, iterator, other_list)Splice_
void splice_(container, iterator, other_list, iterator)Splice_
void splice_(container, iterator, other_list, first, last)Splice_
void list_reverse_(container)ListReverse_
void list_unique_(container)ListUnique_
void list_unique_(container, opᵃ)ListUnique_
void list_sort_(container)ListSort_
void list_sort_(container, opᵃ)ListSort_


Table 6. STL associative container methods

Associative container methods in container.hppFunctor
iterator insert_(container, pos, value)Insert_
void insert_( container , first, last)Insert_
pair<iterator, bool> insert_( container , value)Insert_
void associative_erase_( container , pos)Associative_Erase_
void associative_erase_( container , first, last)Associative_Erase_
size_type associative_erase_( container , key)Associative_Erase_
iterator associative_find_( container , key)Associative_Find_
size_type associative_count_( container , key)AssociativeCount_
iterator associative_lower_bound_( container , key)Associative_Lower_Bound_
iterator associative_upper_bound_( container , key)Associative_Upper_Bound_
pair<iterator, iterator> associative_equal_range_( container , key)Associative_Equal_Range_


Table 7. STL pair

std::pair in container.hppFunctor
first_type first_(pair<T1, T2>)First_
second_type second_(pair<T1, T2>)Second_


Table 8. STL string

STL string methodstd::string method in container.hppFunctor
substr (size_type pos, size_type size)string substr_(container, pos, length)Substr_
int compare(string)int string_compare_(container, another_string)StringCompare_
int compare(char*)int string_compare_(container, another_string)StringCompare_
int compare(size_type pos, size_type size, string)int string_compare_(container, pos, size, another_string)StringCompare_
int compare (size_type pos, size_type size, string, size_type length)int string_compare_(container, pos, size, another_string, length)StringCompare_
string& append(const string&)string& append_(container, another_string)Append_
string& append (charT*)string& append_(container, another_string)Append_
string& append (string , size_type pos, size_type size)string& append_(container, other_string, pos, size)Append_
string& append (charT*, size_type size)string& append_(container, another_string, length)Append_
string& append (size_type size, charT)string& append_(container, size, char)Append_
string& append (iterator begin, iterator end)string& append_(container, begin, end)Append_
string& insert (size_type pos, charT*)string& string_insert_(container, pos, other_string)StringInsert_
string& insert(size_type pos, charT*,size_type n)string& string_insert_(container, pos, other_string, n)StringInsert_
string& insert(size_type pos,size_type n, charT c)string& string_insert_(container, pos, n, c)StringInsert_
string& insert (size_type pos, const string&)string& string_insert_(container, pos, other_string)StringInsert_
string& insert (size_type pos, const string&, size_type pos1, size_type n)string& string_insert_(container, pos, other_string, pos1, n)StringInsert_
string& erase(size_type pos=0, size_type n=npos)string& string_erase_(container, pos, n)StringErase_
string& assign(const string&)string& string_assign_(container, another_string)StringAssign_
string& assign(const charT*)string& string_assign_(container, another_string)StringAssign_
string& assign(const string&, size_type pos, size_type n)string& string_assign_(container, another_string, pos, n)StringAssign_
string& assign(const charT*, size_type n)string& string_assign_(container, another_string, n)StringAssign_
string& assign(size_type n, charT c)string& string_assign_(container, n, c)StringAssign_
string& assign(iterator first, iterator last)string& string_assign_(container, first, last)StringAssign_
string& replace(size_type pos, size_type n, const string&)string& string_replace_(container, pos, n, another_string)StringReplace_
string& replace(size_type pos, size_type n, const charT*, size_type n1)string& string_replace_(container, pos, n, another_string, n1)StringReplace_
string& replace(size_type pos, size_type n, const charT*)string& string_replace_(container, pos, n, another_string)StringReplace_
string& replace(size_type pos, size_type n, size_type n1, charT c)string& string_replace_(container, pos, n, n1, c)StringReplace_
string& replace(iterator first, iterator last, const string&)string& string_replace_(container, first, last, another_string)StringReplace_
string& replace(iterator first, iterator last, const charT*, size_type n)string& string_replace_(container, first, last, another_string, n)StringReplace_
string& replace(iterator first, iterator last, const charT*)string& string_replace_(container, first, last, another_string)StringReplace_
string& replace(iterator first, iterator last, size_type n, charT c)string& string_replace_(container, first, last, n, c)StringReplace_
string& replace(iterator first, iterator last, iterator f, iterator l)string& string_replace_(container, first, last, f, l)StringReplace_
const charT* c_str()const charT* c_str_(container)CStr_
const charT* data()const charT* string_data_(container)StringData_
size_type copy(charT* buf, size_type n, size_type pos = 0)size_type string_copy_(container, buf, n, pos); size_type string_copy_(container, buf, n) StringCopy_
size_type find(charT* s, size_type pos, size_type n)size_type string_find_(container, s, pos, n)StringFind_
size_type find(charT* s, size_type pos=0)size_type string_find_(container, s, pos); size_type string_find_(container, s) StringFind_
size_type find(const string& s, size_type pos=0)size_type string_find_(container, s, pos) size_type string_find_(container, s) StringFind_
size_type find(charT c, size_type pos=0)size_type string_find_(container, c, pos) size_type string_find_(container, c) StringFind_
size_type rfind(charT* s, size_type pos, size_type n)size_type string_rfind_(container, s, pos, n)StringRFind_
size_type rfind(charT* s, size_type pos=npos)size_type string_rfind_(container, s, pos); size_type string_rfind_(container, s) StringRFind_
size_type rfind(const string& s, size_type pos=npos)size_type string_rfind_(container, s, pos); size_type string_rfind_(container, s) StringRFind_
size_type rfind(charT c, size_type pos=npos)size_type string_rfind_(container, c, pos) size_type string_rfind_(container, c) StringRFind_
size_type find_first_of(charT* s, size_type pos, size_type n)size_type find_first_of_(container, s, pos, n)StringFindFirstOf_
size_type find_first_of (charT* s, size_type pos=0)size_type find_first_of_(container, s, pos); size_type find_first_of_(container, s) StringFindFirstOf_
size_type find_first_of (const string& s, size_type pos=0)size_type find_first_of_(container, s, pos); size_type find_first_of_(container, s) StringFindFirstOf_
size_type find_first_of (charT c, size_type pos=0)size_type find_first_of_(container, c, pos) size_type find_first_of_(container, c) StringFindFirstOf_
size_type find_first_not_of(charT* s, size_type pos, size_type n)size_type find_first_not_of_(container, s, pos, n)StringFindFirstNotOf_
size_type find_first_not_of (charT* s, size_type pos=0)size_type find_first_not_of_(container, s, pos); size_type find_first_not_of_(container, s) StringFindFirstNotOf_
size_type find_first_not_of (const string& s, size_type pos=0)size_type find_first_not_of_(container, s, pos); size_type find_first_not_of_(container, s) StringFindFirstNotOf_
size_type find_first_not_of (charT c, size_type pos=0)size_type find_first_not_of_(container, c, pos); size_type find_first_not_of_(container, c) StringFindFirstNotOf_
size_type find_last_of(charT* s, size_type pos, size_type n)size_type find_last_of_(container, s, pos, n)StringFindLastOf_
size_type find_last_of (charT* s, size_type pos=npos)size_type find_last_of_(container, s, pos); size_type find_last_of_(container, s) StringFindLastOf_
size_type find_last_of (const string& s, size_type pos=npos)size_type find_last_of_(container, s, pos); size_type find_last_of_(container, s) StringFindLastOf_
size_type find_last_of (charT c, size_type pos=npos)size_type find_last_of_(container, c, pos); size_type find_last_of_(container, c) StringFindLastOf_
size_type find_last_not_of(charT* s, size_type pos, size_type n)size_type find_last_not_of_(container, s, pos, n)StringFindLastNotOf_
size_type find_last_not_of (charT* s, size_type pos=npos)size_type find_last_not_of_(container, s, pos); size_type find_last_of_(container, s) StringFindLastNotOf_
size_type find_last_not_of (const string& s, size_type pos=npos)size_type find_last_not_of_(container, s, pos); size_type find_last_not_of_(container, s) StringFindLastNotOf_
size_type find_last_not_of (charT c, size_type pos=npos)size_type find_last_not_of_(container, c, pos); size_type find_last_not_of_(container, c) StringFindLastNotOf_


Notes:

  • ᵃ: algorithms requiring a predicate need to make them eUML compatible by wrapping them inside a Predicate_ functor. For example, std::less<int> => Predicate_<std::less<int> >()

  • ᵇ: If using the SGI STL implementation, these functors use the SGI return value