| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DayaBay::DaqLtb Class Reference

Class that wraps the DAQ data read from a LTB readout. More...

#include <DaqLtb.h>

Collaboration diagram for DayaBay::DaqLtb:

[legend]
List of all members.

Public Types

typedef std::vector< DayaBay::DaqLtbFrame * > LtbFramePtrList
 A list containing pointers to the LTB frames.

Public Member Functions

 DaqLtb (const DybDaq::LtbReadout &ltbReadout, const DayaBay::Detector &detector)
 Constructor for read-only instance.
 DaqLtb (const unsigned int localTriggerNumber, const unsigned int rawTriggerTotal, const unsigned int ltbStatus, const DayaBay::Detector &detector)
 Constructor for read-write instance.
 DaqLtb ()
 Default Constructor.
virtual ~DaqLtb ()
 Destroys this instance of the class.
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the ASCII output stream.
const LtbFramePtrListframes () const
 Returns the list of LTB frames.
const DaqLtbFramefirstFrame () const
 Returns the first LTB frame in this readout.
unsigned int localTriggerNumber () const
 Returns the local trigger number of this readout.
const DybDaq::LtbReadoutltbReadout () const
 Returns the LtbReadout being wrapped by this class.
bool addFrame (DaqLtbFrame *frame)
 Adds a new DaqLtbFrame to this object.

Static Public Member Functions

static void * operator new (size_t size)
 operator new
static void * operator new (size_t size, void *pObj)
 placement operator new it is needed by libstdc++ 3.2.3 (e.g.
static void operator delete (void *p)
 operator delete
static void operator delete (void *p, void *pObj)
 placement operator delete not sure if really needed, but it does not harm

Private Attributes

DybDaq::LtbReadoutm_ltbReadout
 The wrapped LtbReadout instance.
const DayaBay::Detectorm_detector
 The detector with which this frame is associated.
LtbFramePtrListm_framePtrs
 The list containing pointers to the LTB frames in this readout.

Detailed Description

Class that wraps the DAQ data read from a LTB readout.

Author:
sjpatton@lbl.gov created Mon Apr 11 03:44:53 2011

Definition at line 41 of file DaqLtb.h.


Member Typedef Documentation

typedef std::vector<DayaBay::DaqLtbFrame*> DayaBay::DaqLtb::LtbFramePtrList

A list containing pointers to the LTB frames.

Definition at line 46 of file DaqLtb.h.


Constructor & Destructor Documentation

DaqLtb::DaqLtb ( const DybDaq::LtbReadout ltbReadout,
const DayaBay::Detector detector 
)

Constructor for read-only instance.

Definition at line 24 of file DaqLtb.cc.

00025                                          :
00026     m_ltbReadout(const_cast<LtbReadout*>(&ltbReadout)),
00027     m_detector(&detector),
00028     m_framePtrs(0) {
00029 }

DaqLtb::DaqLtb ( const unsigned int  localTriggerNumber,
const unsigned int  rawTriggerTotal,
const unsigned int  ltbStatus,
const DayaBay::Detector detector 
)

Constructor for read-write instance.

Definition at line 31 of file DaqLtb.cc.

00034                                          :
00035     m_ltbReadout(new LtbReadout(localTriggerNumber,
00036                                 rawTriggerTotal,
00037                                 ltbStatus,
00038                                 false,
00039                                 LtbTraits::defaultTraits())),
00040     m_detector(&detector),
00041     m_framePtrs(0) {
00042 }

DayaBay::DaqLtb::DaqLtb (  )  [inline]

Default Constructor.

Definition at line 59 of file DaqLtb.h.

00059              : m_ltbReadout(0),
00060                m_detector(0),
00061                m_framePtrs(0) {}

DaqLtb::~DaqLtb (  )  [virtual]

Destroys this instance of the class.

Definition at line 44 of file DaqLtb.cc.

00044                 {
00045     if (0 != m_framePtrs) {
00046         LtbFramePtrList::iterator finished = m_framePtrs->end();
00047         for(LtbFramePtrList::iterator frame = m_framePtrs->begin();
00048             frame != finished;
00049             ++frame) {
00050             delete *frame;
00051         }
00052         delete m_framePtrs;
00053     }
00054 }


Member Function Documentation

std::ostream & DayaBay::DaqLtb::fillStream ( std::ostream &  s  )  const [inline, virtual]

Fill the ASCII output stream.

Definition at line 140 of file DaqLtb.h.

00141 {
00142   s << "{ " << "ltbReadout :    " << m_ltbReadout << std::endl
00143             << "detector :      " << m_detector << std::endl
00144             << "framePtrs :     " << m_framePtrs << std::endl << " }";
00145   return s;
00146 }

const DaqLtb::LtbFramePtrList & DaqLtb::frames (  )  const

Returns the list of LTB frames.

Definition at line 60 of file DaqLtb.cc.

00060                                                   {
00061     if (0 == m_framePtrs) {
00062         LtbFramePtrList** framePtrs = const_cast<LtbFramePtrList**>(&m_framePtrs);
00063         *(framePtrs) = new LtbFramePtrList();
00064         const LtbReadout::LtbFramePtrList& frames = m_ltbReadout->ltbFrames();
00065         const LtbReadout::LtbFramePtrList::const_iterator finished = frames.end();
00066         for (LtbReadout::LtbFramePtrList::const_iterator frame = frames.begin();
00067              finished != frame;
00068              ++frame) {
00069             (*framePtrs)->push_back(new DaqLtbFrame(*(*frame),
00070                                                     *m_detector));
00071         }
00072     }
00073     return *m_framePtrs;
00074 }

const DaqLtbFrame & DaqLtb::firstFrame (  )  const

Returns the first LTB frame in this readout.

Definition at line 56 of file DaqLtb.cc.

00056                                              {
00057     return *(frames().front());
00058 }

unsigned int DaqLtb::localTriggerNumber (  )  const

Returns the local trigger number of this readout.

Definition at line 76 of file DaqLtb.cc.

00076                                               {
00077     return m_ltbReadout->head().localTriggerNumber();
00078 }

const LtbReadout * DaqLtb::ltbReadout (  )  const

Returns the LtbReadout being wrapped by this class.

Definition at line 80 of file DaqLtb.cc.

00080                                            {
00081     return m_ltbReadout;
00082 }

bool DaqLtb::addFrame ( DaqLtbFrame frame  ) 

Adds a new DaqLtbFrame to this object.

Definition at line 84 of file DaqLtb.cc.

00084                                         {
00085     if (0 == m_framePtrs) {
00086         m_framePtrs = new LtbFramePtrList();
00087     }
00088     m_framePtrs->push_back(frame);
00089     m_ltbReadout->addFrame(frame->ltbFrame());
00090     return true;
00091 }

static void* DayaBay::DaqLtb::operator new ( size_t  size  )  [inline, static]

operator new

Definition at line 87 of file DaqLtb.h.

00088     {
00089       return ( sizeof(DaqLtb) == size ? 
00090                boost::singleton_pool<DaqLtb, sizeof(DaqLtb)>::malloc() :
00091                ::operator new(size) );
00092     }

static void* DayaBay::DaqLtb::operator new ( size_t  size,
void *  pObj 
) [inline, static]

placement operator new it is needed by libstdc++ 3.2.3 (e.g.

in std::vector) it is not needed in libstdc++ >= 3.4

Definition at line 97 of file DaqLtb.h.

00098     {
00099       return ::operator new (size,pObj);
00100     }

static void DayaBay::DaqLtb::operator delete ( void *  p  )  [inline, static]

operator delete

Definition at line 103 of file DaqLtb.h.

00104     {
00105       boost::singleton_pool<DaqLtb, sizeof(DaqLtb)>::is_from(p) ?
00106       boost::singleton_pool<DaqLtb, sizeof(DaqLtb)>::free(p) :
00107       ::operator delete(p);
00108     }

static void DayaBay::DaqLtb::operator delete ( void *  p,
void *  pObj 
) [inline, static]

placement operator delete not sure if really needed, but it does not harm

Definition at line 112 of file DaqLtb.h.

00113     {
00114       ::operator delete (p, pObj);
00115     }


Member Data Documentation

DybDaq::LtbReadout* DayaBay::DaqLtb::m_ltbReadout [private]

The wrapped LtbReadout instance.

Definition at line 121 of file DaqLtb.h.

const DayaBay::Detector* DayaBay::DaqLtb::m_detector [private]

The detector with which this frame is associated.

Definition at line 122 of file DaqLtb.h.

LtbFramePtrList* DayaBay::DaqLtb::m_framePtrs [private]

The list containing pointers to the LTB frames in this readout.

Definition at line 123 of file DaqLtb.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:24:29 2011 for DaqEvent by doxygen 1.4.7