CFEL - ASG Software Suite
2.5.0
CASS
|
Format converter container. More...
#include <format_converter.h>
Public Types | |
typedef std::tr1::shared_ptr< FormatConverter > | shared_pointer |
a shared pointer of this type More... | |
typedef std::map< Pds::TypeId::Type, ConversionBackend::shared_pointer > | usedConverters_t |
typdef describing the map of used converters for easier readable code More... | |
Public Member Functions | |
bool | operator() (CASSEvent *evt) |
function to process a datagram and turn it into a cassevent. More... | |
void | loadSettings (size_t what) |
function to load the settings for the format converter More... | |
void | saveSettings () |
function to save the settings for the format converter More... | |
Static Public Member Functions | |
static shared_pointer | instance () |
Return a pointer to the single FormatConverter instance. More... | |
Static Public Attributes | |
static const unsigned int | pvNumMax = 2 |
Protected Member Functions | |
FormatConverter () | |
constructor is made protected, should only be called through instance More... | |
Protected Attributes | |
bool | _configseen |
status whether a configure has already been seen More... | |
usedConverters_t | _usedConverters |
map that contains all type id's of all known xtc in a transition. More... | |
Static Protected Attributes | |
static shared_pointer | _instance |
pointer to the single instance More... | |
static QMutex | _mutex |
Singleton operation locker in a multi-threaded environment. More... | |
Format converter container.
Only one FormatConvert object must exist, therefore this is implemented as a singleton. It contains all available Format Converters and calls all requested ones.
Definition at line 59 of file format_converter.h.
typedef std::tr1::shared_ptr<FormatConverter> cass::FormatConverter::shared_pointer |
a shared pointer of this type
Definition at line 65 of file format_converter.h.
typedef std::map<Pds::TypeId::Type, ConversionBackend::shared_pointer> cass::FormatConverter::usedConverters_t |
typdef describing the map of used converters for easier readable code
Definition at line 99 of file format_converter.h.
|
protected |
constructor is made protected, should only be called through instance
Definition at line 46 of file format_converter.cpp.
|
static |
Return a pointer to the single FormatConverter instance.
Definition at line 35 of file format_converter.cpp.
void FormatConverter::loadSettings | ( | size_t | what | ) |
function to load the settings for the format converter
initialze all xtc ids with blank converters. Get the list of converters that should be used. Then create the requested converters and retrieve the list of pds ids that the individual converter is responsible for. Add the converter to used converters container for all retrieved ids
Definition at line 50 of file format_converter.cpp.
References _usedConverters, QSettings::beginGroup(), cass::ConversionBackend::instance(), and QSettings::value().
Referenced by cass::SharedMemoryInput::load(), and cass::XtcReader::loadSettings().
bool FormatConverter::operator() | ( | CASSEvent * | evt | ) |
function to process a datagram and turn it into a cassevent.
this function will iterate through the xtc's contained in the datagram extract the information and put into the right device of the CASSEvent
evt | pointer to the CASSEvent which also contains the datagram |
intialize the return value (the return value reflects the whether the datagram was a good L1Transition(an event))
get the datagram from the cassevent
if datagram is configuration or an event (L1Accept) then we will iterate through it otherwise we ignore the datagram
when it is a configuration transition then set the flag accordingly
if the datagram is an event, create the id from time and fiducial
extract the bunchId from the datagram
put the id into the cassevent
set the return value to true
prepare the cassevent
now iterate through the datagram and find the wanted information if the return value of the iterator is false, then the transition did not contain all information
finalize the epics conversion, so get the epics converter and finalize
Definition at line 77 of file format_converter.cpp.
References _configseen, _usedConverters, cass::Log::add(), cass::CASSEvent::datagrambuffer(), cass::Log::DEBUG4, GoodData, cass::CASSEvent::id(), NoGoodData, and cass::toString().
|
inline |
function to save the settings for the format converter
Definition at line 91 of file format_converter.h.
|
protected |
status whether a configure has already been seen
Definition at line 103 of file format_converter.h.
Referenced by operator()().
|
staticprotected |
pointer to the single instance
Definition at line 113 of file format_converter.h.
|
staticprotected |
Singleton operation locker in a multi-threaded environment.
Definition at line 116 of file format_converter.h.
|
protected |
map that contains all type id's of all known xtc in a transition.
the converter used by the xtc is the second. We add the appropriate converters at the right position
Definition at line 110 of file format_converter.h.
Referenced by loadSettings(), and operator()().
|
static |
Definition at line 62 of file format_converter.h.