FACT++  1.0
template<class T>
int StateMachineFAD< T >::ToggleSlot ( const EventImp evt)
inlineprivate

Definition at line 1257 of file fadctrl.cc.

References EventImp::GetShort(), and EventImp::GetSize().

Referenced by StateMachineFAD< T >::StateMachineFAD().

1258  {
1259  if (!CheckEventSize(evt.GetSize(), "ToggleSlot", 2))
1260  return T::kSM_FatalError;
1261 
1262  const int16_t slot = evt.GetShort();
1263 
1264  const BoardList::iterator it = GetSlot(slot);
1265  if (it==fBoards.end())
1266  return T::GetCurrentState();
1267 
1268  const bool enable = it->second->IsDisconnected();
1269 
1270  EnableConnection(it->second, enable);
1271  ConnectSlot(it->first, enable ? it->second->GetEndpoint() : tcp::endpoint());
1272 
1273  return T::GetCurrentState();
1274  }
void ConnectSlot(unsigned int i, const tcp::endpoint &addr)
BoardList fBoards
Definition: fadctrl.cc:555
void EnableConnection(ConnectionFAD *ptr, bool enable=true)
Definition: fadctrl.cc:1208
const BoardList::iterator GetSlot(uint16_t slot)
Definition: fadctrl.cc:936
int16_t GetShort() const
Definition: EventImp.h:91
bool CheckEventSize(size_t has, const char *name, size_t size)
Definition: fadctrl.cc:562
virtual size_t GetSize() const
Definition: EventImp.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function: