BOSS 7.0.9
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 uint32_t runNo();
23 inline std::string currentFile();
24 inline uint32_t stat();
25
26
27 private :
28
29 static void* thread_filling(void* arg);
30
31 PthrReaderBufPool(); //stop default
32
33
34 private :
35
36 int m_inLoop;
37 int m_outLoop;
38 AutoEnlargeBuffer* m_buf[PoolSize];
39
40 Reader* m_reader;
41
42 pthread_t m_tid;
43 sem_t m_semIn;
44 sem_t m_semOut;
45 pthread_mutex_t m_lock;
46
47 sem_t m_semSyn;
48
49 // copy of possible exceptions
50 RawFileException* m_RawFileException;
51};
52
54
55#endif
#define private
std::string currentFile()
virtual ~PthrReaderBufPool()
const uint32_t * nextEvent()
const uint32_t * currentEvent() const