CFEL - ASG Software Suite  2.5.0
CASS
conversion_backend.cpp
Go to the documentation of this file.
1 // Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file conversion_backend.cpp file contains base class for all format converters
5  *
6  * @author Lutz Foucar
7  */
8 
9 #include <stdexcept>
10 
11 #include <QtCore/QMutex>
12 
13 #include "conversion_backend.h"
14 
15 #include "pdsdata/xtc/Xtc.hh"
16 
17 #include "acqiris_converter.h"
18 #include "acqiristdc_converter.h"
19 #include "machine_converter.h"
20 #include "lcls_converter.h"
21 #include "log.h"
22 
23 using namespace std;
24 using namespace std::tr1;
25 using namespace cass;
26 
27 
28 ConversionBackend::shared_pointer ConversionBackend::instance(const string &type)
29 {
30  std::tr1::shared_ptr<ConversionBackend> converter;
31  if("Acqiris" == type)
32  converter = ACQIRIS::Converter::instance();
33  else if("AcqirisTDC" == type)
34  converter = ACQIRISTDC::Converter::instance();
35  else if("pixeldetector" == type)
36  converter = pixeldetector::Converter::instance();
37  else if("Machine" == type)
38  converter = MachineData::Converter::instance();
39  else if("Blank" == type)
40  converter = shared_pointer(new ConversionBackend);
41  else
42  throw invalid_argument("ConversionBackend::instance(): Requested converter type '" +
43  type + "' is unkown");
44  return converter;
45 }
46 
47 void ConversionBackend::operator()(const Pds::Xtc *xtc, cass::CASSEvent*)
48 {
49  Log::add(Log::DEBUG0,string("ConversionBackend::operator(): Converter for xtc type '") +
50  Pds::TypeId::name(xtc->contains.id()) + "' has not been assigned or " +
51  "implemented");
52 }
contains xtc converter for machine data
Event to store all LCLS Data.
Definition: cass_event.h:32
STL namespace.
file contains base class for all format converters
std::tr1::shared_ptr< ConversionBackend > shared_pointer
typedef
file contains the declaration of the converter for the xtc containing acqiris tdc data...
Base class for Converters.
file contains the declaration of the converter for the xtc containing acqiris data.
contains the converters to convert ccd and pnccd data to CASSEvent
contains a logger for cass