/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

UserBuffer.cc
Go to the documentation of this file.
00001 #include "LafKernel/UserBuffer.h"
00002 
00003 UserBuffer::UserBuffer(EvtSelector* selector)
00004     : m_selector(selector)
00005 {
00006 }
00007 
00008 UserBuffer::~UserBuffer()
00009 {
00010     delete m_selector;
00011 }
00012 
00013 bool UserBuffer::tryPushBack(PhyEvent* evt)
00014 {
00015     if ( m_selector->select(evt) ) {
00016         m_dBuf.push_back(evt->GrabInstance());
00017         return true;
00018     }
00019     return false;
00020 }
00021 
00022 void UserBuffer::synchronize(PhyEventBuf* buf)
00023 {
00024     PhyEventBuf::Iterator it = buf->begin();
00025     while ( !m_dBuf.empty() && m_dBuf[0]->m_trigTime < (*it)->m_trigTime ) {
00026         m_dBuf[0]->ReleaseInstance();
00027         m_dBuf[0] = 0;
00028         m_dBuf.pop_front();
00029     }
00030     unsigned int size = m_dBuf.size();
00031     m_iCur = size;
00032     if ( size > 0 ) {
00033         int curEntry = buf->curEvt()->m_entry;
00034         const TTimeStamp& curTime = buf->curEvt()->m_trigTime;
00035         while ( --m_iCur != 0 && m_dBuf[m_iCur]->m_entry != curEntry ) {
00036             if ( m_dBuf[m_iCur]->m_trigTime < curTime ) break;
00037         }
00038         if ( m_dBuf[m_iCur]->m_entry != curEntry ) {
00039             m_iCur = size;
00040         }
00041     }
00042 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:18 for LafKernel by doxygen 1.7.4