BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnOnlineShmSource.h
Go to the documentation of this file.
1#ifndef BMN_ONLINE_SHM_SOURCE_H
2#define BMN_ONLINE_SHM_SOURCE_H
3
4#include <FairOnlineSource.h>
5#include <FairSource.h>
6#include <TClonesArray.h>
7#include <TTree.h>
8#include <boost/interprocess/managed_shared_memory.hpp>
9#include <boost/interprocess/sync/named_semaphore.hpp>
10#include <string>
11
12namespace bIpc = boost::interprocess;
13
15{
16 public:
18 virtual ~BmnOnlineShmSource();
19
20 virtual Bool_t Init();
21 virtual Int_t ReadEvent(UInt_t = 0);
22 virtual void Close();
23
26
27 private:
29
30 std::string fShmName;
31 std::string fWriteSemName;
32 std::string fReadSemName;
33 std::string fMsgName;
34
35 std::unique_ptr<bIpc::managed_shared_memory> fShmSegment;
36 std::unique_ptr<bIpc::named_semaphore> fWriteSem;
37 std::unique_ptr<bIpc::named_semaphore> fReadSem;
38
39 std::unordered_map<std::string, std::unique_ptr<TClonesArray>> fRegisteredBranches;
40
41 void RegisterBranches(std::unique_ptr<TTree>& inputTree);
42 void UploadData(std::unique_ptr<TTree>& inputTree);
43
45};
46
47#endif // BMN_ONLINE_SHM_SOURCE_H
bool Bool_t
int Int_t
unsigned int UInt_t
#define ClassDef(name, id)
virtual Int_t ReadEvent(UInt_t=0)
void UploadData(std::unique_ptr< TTree > &inputTree)
std::unordered_map< std::string, std::unique_ptr< TClonesArray > > fRegisteredBranches
void RegisterBranches(std::unique_ptr< TTree > &inputTree)
BmnOnlineShmSource(const BmnOnlineShmSource &)=delete
BmnOnlineShmSource & operator=(const BmnOnlineShmSource &)=delete
std::unique_ptr< bIpc::managed_shared_memory > fShmSegment
std::unique_ptr< bIpc::named_semaphore > fReadSem
std::unique_ptr< bIpc::named_semaphore > fWriteSem