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

Definition at line 834 of file fadctrl.cc.

References Error(), EventImp::GetSize(), EventImp::GetUShort(), kCalib, kCfitsio, kDebug, kFits, kNone, kRaw, and kZFits.

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

835  {
836  if (!CheckEventSize(evt.GetSize(), "SetFileFormat", 2))
837  return T::kSM_FatalError;
838 
839  const uint16_t fmt = evt.GetUShort();
840 
841  // A simple way to make sure that no invalid file format
842  // is passed to the event builder
843  switch (fmt)
844  {
845  case FAD::kNone:
846  case FAD::kDebug:
847  case FAD::kFits:
848  case FAD::kZFits:
849  case FAD::kCfitsio:
850  case FAD::kRaw:
851  case FAD::kCalib:
853  break;
854  default:
855  T::Error("File format unknonw.");
856  return T::GetCurrentState();
857  }
858 
859  return T::GetCurrentState();
860  }
uint16_t GetUShort() const
Definition: EventImp.h:92
void SetOutputFormat(FAD::FileFormat_t f)
FileFormat_t
Definition: HeadersFAD.h:74
Error()
Definition: HeadersFTM.h:197
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: