CFEL - ASG Software Suite  2.5.0
CASS
Public Member Functions | Private Attributes | List of all members
cass::pixeldetector::SHMStreamer Class Reference

deserialize the data stream of shm2tcp program More...

#include <shm_deserializer.h>

+ Inheritance diagram for cass::pixeldetector::SHMStreamer:
+ Collaboration diagram for cass::pixeldetector::SHMStreamer:

Public Member Functions

size_t operator() (QDataStream &stream, CASSEvent &evt)
 deserialize stream More...
 
size_t operator() (QDataStream &stream)
 read header off from stream More...
 
- Public Member Functions inherited from cass::TCPStreamer
virtual ~TCPStreamer ()
 virtual destructor More...
 

Private Attributes

int _width
 the width of the framaes More...
 
std::vector< int16_t > _hllFrameBuffer
 a buffer to store frame data that needs to be converted to the cass structur More...
 

Additional Inherited Members

- Public Types inherited from cass::TCPStreamer
typedef std::tr1::shared_ptr< TCPStreamershared_pointer
 typedef the shared pointer of this More...
 
- Static Public Member Functions inherited from cass::TCPStreamer
static TCPStreamerinstance (const std::string &type)
 create an instance of the requested type and return a reference More...
 
static TCPStreamerinstance ()
 return a reference to the derefenced instance More...
 
- Protected Member Functions inherited from cass::TCPStreamer
 TCPStreamer ()
 only inheritants can create this More...
 
- Static Protected Attributes inherited from cass::TCPStreamer
static shared_pointer _instance
 a sigleton instance More...
 

Detailed Description

deserialize the data stream of shm2tcp program

see operator() for details

Author
Lutz Foucar

Definition at line 32 of file shm_deserializer.h.

Member Function Documentation

size_t SHMStreamer::operator() ( QDataStream stream,
CASSEvent evt 
)
virtual

deserialize stream

Returns
the number of bytes read off the stream
Parameters
streamThe stream that contains the serialized data
evtThe CASS Event that the data should be deserialized to.

read frame header and calculate the frame data size from the contained info. Set the eventid according to the id in the info Then read the frame from the stream into the frame buffer.

get the detector associated with the frame info id from the event

set the information of the frame to the detector

convert the hll type frame to the cass type frame

Todo:
: read out somehow?

Implements cass::TCPStreamer.

Definition at line 31 of file shm_deserializer.cpp.

References cass::pixeldetector::Device::dets(), cass::CASSEvent::devices(), cass::hllDataTypes::HLL2CASS(), cass::CASSEvent::id(), cass::pixeldetector::Detector::id(), cass::CASSEvent::PixelDetectors, and QDataStream::readRawData().

size_t SHMStreamer::operator() ( QDataStream stream)
virtual

read header off from stream

Returns
the number of bytes read off the stream
Parameters
streamThe stream that contains the serialized data

Reimplemented from cass::TCPStreamer.

Definition at line 23 of file shm_deserializer.cpp.

References cass::hllDataTypes::Frms6FileHeader::the_width.

Member Data Documentation

std::vector<int16_t> cass::pixeldetector::SHMStreamer::_hllFrameBuffer
private

a buffer to store frame data that needs to be converted to the cass structur

Definition at line 55 of file shm_deserializer.h.

int cass::pixeldetector::SHMStreamer::_width
private

the width of the framaes

Definition at line 52 of file shm_deserializer.h.


The documentation for this class was generated from the following files: