FACT++  1.0
bool EventImp::IsStateAllowed ( int  state) const

Return whether the given state is in the list of allowed states.

Parameters
stateThe state to look for in fAllowedStates
Returns
If the given state is negative returns false. If the list of allowed states is empty return true. Otherwise return whether the state is found in fAllowedList or not.

Definition at line 174 of file EventImp.cc.

References fAllowedStates.

Referenced by StateMachineImp::HandleEvent(), and operator()().

175 {
176  // States with negative values are internal states and are
177  // never allowed
178  // if (state<0)
179  // return false;
180 
181  // In case no allowed state is explicitly set
182  // all positive states are allowed
183  if (fAllowedStates.size()==0)
184  return true;
185 
186  return find(fAllowedStates.begin(), fAllowedStates.end(), state)!=fAllowedStates.end();
187 }
std::vector< int > fAllowedStates
Definition: EventImp.h:13

+ Here is the caller graph for this function: