Skip to content

Commit cf89674

Browse files
committed
Fixed some const correctness issues and some compilation issues.
1 parent 6717581 commit cf89674

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

FSM/FiniteStateMachine.hh

+5-6
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ namespace Core
440440
*
441441
* @return The default handler function object.
442442
*/
443-
virtual EventHandler DefaultEventHandler()
443+
virtual EventHandler DefaultEventHandler() const
444444
{
445445
return default_handler;
446446
}
@@ -496,7 +496,7 @@ namespace Core
496496
/**
497497
* Checks whether the event store of the state is empty.
498498
*/
499-
inline bool IsEventStoreEmpty() { return event_store.empty(); }
499+
inline bool IsEventStoreEmpty() const { return event_store.empty(); }
500500

501501

502502
/**
@@ -629,7 +629,6 @@ namespace Core
629629
FiniteStateMachine()
630630
: previous_state( SentinelStateID )
631631
, current_state( SentinelStateID )
632-
, blocking( false )
633632
, default_handler( nullptr )
634633
, state_transfer_event( 0 )
635634
{ }
@@ -747,7 +746,7 @@ namespace Core
747746
*/
748747
bool IsDirectTransition(
749748
const Event & event
750-
)
749+
) const
751750
{
752751
return (EventNumber) event >= state_transfer_event;
753752
}
@@ -1048,7 +1047,7 @@ namespace Core
10481047
/**
10491048
* @return true if the FSM is blocking conditional events, false otherwise.
10501049
*/
1051-
inline bool IsBlocking() { return not block_cleared_in.empty(); }
1050+
inline bool IsBlocking() const { return not block_cleared_in.empty(); }
10521051

10531052

10541053
private :
@@ -1132,7 +1131,7 @@ namespace Core
11321131
{
11331132
if ( IsBlocking() )
11341133
{
1135-
auto where = block_cleared_in.find( CurrentState() )
1134+
auto where = block_cleared_in.find( CurrentState() );
11361135
if ( where != block_cleared_in.end() ) { block_cleared_in.clear(); }
11371136
}
11381137
on_entry( event );

0 commit comments

Comments
 (0)