Belle II Software
development
SharedMem.h
1
/**************************************************************************
2
* basf2 (Belle II Analysis Software Framework) *
3
* Author: The Belle II Collaboration *
4
* *
5
* See git log for contributors and copyright holders. *
6
* This file is licensed under LGPL-3.0, see LICENSE.md. *
7
**************************************************************************/
8
#pragma once
9
10
#include <sys/types.h>
11
12
#include <string>
13
14
namespace
Belle2
{
19
class
SharedMem
{
20
public
:
21
SharedMem
(
const
char
* name,
int
size);
22
SharedMem
(
int
shm_id,
int
sem_id,
int
size);
23
~SharedMem
(
void
);
24
25
void
* ptr(
void
);
26
int
shmid(
void
);
27
28
bool
IsCreated(
void
);
29
30
static
std::string getTmpFileName(std::string user, std::string name);
31
static
bool
getIdFromTmpFileName(std::string filename,
int
& shmid,
int
& semid);
32
33
void
lock(
void
);
34
void
unlock(
void
);
35
bool
isLocked(
void
);
36
37
private
:
38
bool
m_new
{
false
};
39
key_t
m_shmkey
;
40
key_t
m_semkey
;
42
int
m_shmid
{-1};
43
int
m_semid
{-1};
44
void
* m_shmadr{
nullptr
};
45
};
47
}
48
49
Belle2::SharedMem
Definition:
SharedMem.h:19
Belle2::SharedMem::m_shmkey
key_t m_shmkey
SHM key, see shmget(2).
Definition:
SharedMem.h:39
Belle2::SharedMem::m_semid
int m_semid
semaphore id
Definition:
SharedMem.h:43
Belle2::SharedMem::m_shmid
int m_shmid
shared memory id
Definition:
SharedMem.h:42
Belle2::SharedMem::~SharedMem
~SharedMem(void)
Definition:
SharedMem.cc:145
Belle2::SharedMem::m_new
bool m_new
True if we created the ring buffer ourselves (and need to clean it).
Definition:
SharedMem.h:38
Belle2::SharedMem::m_semkey
key_t m_semkey
Semaphore key.
Definition:
SharedMem.h:40
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:17
daq
rfarm
manager
include
SharedMem.h
Generated on Fri Nov 8 2024 02:35:29 for Belle II Software by
1.9.6