9 #ifndef __EVENTDECODER_H__ 10 #define __EVENTDECODER_H__ 43 std::vector<adc16_t> &
adc );
47 std::vector<adc16_t> &adc );
67 int lock(pthread_mutex_t &
mutex) {
return pthread_mutex_lock(&mutex); }
68 int trylock(pthread_mutex_t &
mutex) {
return pthread_mutex_trylock(&mutex); }
69 int unlock(pthread_mutex_t &
mutex) {
return pthread_mutex_unlock(&mutex); }
73 void ReadEvent(std::vector<adc16_t> &adc,
bool headonly =
false);
77 ssize_t
Decode(
const char *buf,
size_t nb,
bool cflag,
78 std::vector<adc16_t> &adc);
pthread_mutex_t m_data_mutex
static constexpr double nb
ssize_t Open(std::string finname)
std::vector< std::streampos > m_events
std::vector< BYTE > m_EndFootBuf
std::vector< BYTE > m_EveDataBuf
int trylock(pthread_mutex_t &mutex)
evheader_t GetEventHeader()
int lock(pthread_mutex_t &mutex)
size_t GetNSample() const
void ReadEvent(std::vector< adc16_t > &adc, bool headonly=false)
size_t GetTotEvents() const
ssize_t GetEvent(size_t evnum, dlardaq::evheader_t &eh, std::vector< adc16_t > &adc)
runheader_t GetRunHeader()
void ReadBytes(std::vector< BYTE > &bytes)
std::vector< BYTE > m_EveHeadBuf
int unlock(pthread_mutex_t &mutex)
ssize_t Decode(const char *buf, size_t nb, bool cflag, std::vector< adc16_t > &adc)
void ReadBuffer(const char *buf, size_t nb)
void SetNSample(size_t val)
std::vector< BYTE > m_RunHeadBuf
byte bytes
Alias for common language habits.
std::vector< adc16_t > m_EveData
EventDecoder(size_t nch, size_t nsample)
bool IsFirstPacket(const char *buf, size_t nb)