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

In This Package:

Public Member Functions | Private Types | Private Attributes
HallsTimeSync Class Reference

#include <HallsTimeSync.h>

List of all members.

Public Member Functions

 HallsTimeSync ()
bool validate (PhyEvent *evt)

Private Types

typedef std::list< std::pair
< TTimeStamp, TTimeStamp > > 
Periods

Private Attributes

TTimeStamp m_pEnd
Periods m_periods

Detailed Description

Definition at line 10 of file HallsTimeSync.h.


Member Typedef Documentation

typedef std::list<std::pair<TTimeStamp, TTimeStamp> > HallsTimeSync::Periods [private]

Definition at line 19 of file HallsTimeSync.h.


Constructor & Destructor Documentation

HallsTimeSync::HallsTimeSync ( )

Definition at line 9 of file HallsTimeSync.cc.

{
    std::string fSync;
    OptionParser::setOption("HallsTimeSync", "SyncInput", fSync);

    if ( access( fSync.c_str(), F_OK ) < 0 ) {
        std::string msg = std::string("Invalid HallsTimeSync.SyncInput: ") + fSync;
        throw LafException(msg);
    }

    int pStart_s, pStart_ns, pEnd_s, pEnd_ns;
    std::ifstream fs(fSync.c_str());
    fs >> pStart_s >> pStart_ns >> pEnd_s >> pEnd_ns;

    while ( fs.good() ) {
        m_periods.push_back(std::make_pair(TTimeStamp(pStart_s, pStart_ns),
                                           TTimeStamp(pEnd_s, pEnd_ns)));
        fs >> pStart_s >> pStart_ns >> pEnd_s >> pEnd_ns;
    }

    m_periods.push_back(std::make_pair(TTimeStamp(0x7FFFFFFF, 0),
                                       TTimeStamp(0x7FFFFFFF, 0)));
    m_pEnd = m_periods.front().second;
}

Member Function Documentation

bool HallsTimeSync::validate ( PhyEvent evt)

Definition at line 34 of file HallsTimeSync.cc.

{
    while ( evt->m_trigTime > m_pEnd ) {
        m_periods.pop_front();
        m_pEnd = m_periods.front().second;
    }

    return evt->m_trigTime >= m_periods.front().first;
}

Member Data Documentation

TTimeStamp HallsTimeSync::m_pEnd [private]

Definition at line 21 of file HallsTimeSync.h.

Definition at line 22 of file HallsTimeSync.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 Fri May 16 2014 09:50:56 for SelCycler by doxygen 1.7.4