FACT++  1.0
int StateMachineImp::GetStateIndex ( const std::string &  name) const

Get a state's index by its name.

Parameters
nameName of the state to search for
Returns
Index of the state if found, kSM_NotAvailable otherwise

Definition at line 665 of file StateMachineImp.cc.

References fStateNames, and kSM_NotAvailable.

Referenced by StateMachineDim::AddStateName(), IsQueueEmpty(), RemoteControl< Shell >::JsGetState(), and RemoteControl< Shell >::JsHasState().

666 {
667  for (auto it=fStateNames.begin(); it!=fStateNames.end(); it++)
668  if (it->second.first==name)
669  return it->first;
670 
671  return kSM_NotAvailable;
672 }
StateNames fStateNames
Human readable names associated with the states.
Possible return value for GetStateIndex.

+ Here is the caller graph for this function: