9 #ifndef _XTCITERATOR_H_
10 #define _XTCITERATOR_H_
20 #include "pdsdata/xtc/XtcIterator.hh"
21 #include "pdsdata/xtc/Xtc.hh"
22 #include "pdsdata/compress/CompressedXtc.hh"
23 #include "pdsdata/xtc/BldInfo.hh"
24 #include "pdsdata/xtc/DetInfo.hh"
72 Log::add(
Log::DEBUG4,
string(
"XTC Type '") + TypeId::name(xtc_orig->contains.id()) +
"'(" +
toString(xtc_orig->contains.id()) +
")");
74 Log::add(
Log::DEBUG4,
string(
"XTC Compressed '") + (xtc_orig->contains.compressed() ?
"true":
"false") +
"'");
78 switch (xtc_orig->src.level())
81 Log::add(
Log::DEBUG4,
string(
"XTC DetInfo: ") + DetInfo::name(reinterpret_cast<const DetInfo&>(xtc_orig->src)));
83 case Level::Reporter :
84 Log::add(
Log::DEBUG4,
string(
"XTC BldInfo: ") + BldInfo::name(reinterpret_cast<const BldInfo&>(xtc_orig->src)));
92 if (xtc_orig->contains.id() == Pds::TypeId::Id_Xtc)
101 std::tr1::shared_ptr<Xtc> xtc = xtc_orig->contains.compressed() ?
102 Pds::CompressedXtc::uncompress(*xtc_orig) :
103 std::tr1::shared_ptr<Xtc>(xtc_orig,
Destroy);
108 uint32_t damage = xtc->damage.value();
109 if (xtc->contains.id() >= Pds::TypeId::NumberOf)
112 " is an unkown xtc id.");
121 " is damaged: " +
toString(xtc->damage.value()) );
122 if (damage & ( 0x1 << Pds::Damage::DroppedContribution))
125 "' is damaged with '"+
toString(xtc->damage.value()) +
126 "'(dropped Contribution). Skipping Event");
129 else if(damage & (0x1 <<Pds::Damage::UserDefined))
136 "' is damaged with '"+
toString(xtc->damage.value()) +
137 "' (unkown Damage). Skipping Event");
162 #endif // XTCITERATOR_H
Event to store all LCLS Data.
static void Destroy(Xtc *)
overwrite the destruction of xtc pointers
file contains base class for all format converters
int process(Pds::Xtc *xtc_orig)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static void add(Level level, const std::string &line)
add a string to the log
unsigned _depth
counts the recursivness of this
CASSEvent * _cassevent
pointer to the cassevent to work on
std::string toString(const Type &t)
convert any type to a string
XtcIterator(Pds::Xtc *xtc, FormatConverter::usedConverters_t &converters, CASSEvent *cassevent, unsigned depth)
constructor.
contains a logger for cass
FormatConverter::usedConverters_t & _converters
reference to the converters