BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
PthrReaderBufPool.h
Go to the documentation of this file.
1#ifndef PTHR_READER_BUF_POOL_H
2#define PTHR_READER_BUF_POOL_H
3
7#include <semaphore.h>
8#include <pthread.h>
9#include <vector>
10#include <string>
11
12template <typename Reader, int PoolSize = 8>
14{
15 public :
16
17 PthrReaderBufPool(typename Reader::ReaderArgType& arg);
18 virtual ~PthrReaderBufPool();
19
20 inline const uint32_t* nextEvent();
21 inline const uint32_t* currentEvent() const;
22 inline std::string currentFile();
23 inline uint32_t stat();
24
25
26 private :
27
28 static void* thread_filling(void* arg);
29
30 PthrReaderBufPool(); //stop default
31
32
33 private :
34
35 int m_inLoop;
36 int m_outLoop;
37 AutoEnlargeBuffer* m_buf[PoolSize];
38
39 Reader* m_reader;
40
41 pthread_t m_tid;
42 sem_t m_semIn;
43 sem_t m_semOut;
44 pthread_mutex_t m_lock;
45
46 sem_t m_semSyn;
47
48 // copy of possible exceptions
49 RawFileException* m_RawFileException;
50};
51
53
54#endif
double arg(const EvtComplex &c)
Definition: EvtComplex.hh:227
#define private
std::string currentFile()
virtual ~PthrReaderBufPool()
const uint32_t * nextEvent()
const uint32_t * currentEvent() const