DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
okssystem
include
okssystem
FIFOConnection.hpp
Go to the documentation of this file.
1
// DUNE DAQ modification notice:
2
// This file has been modified from the original ATLAS system source for the DUNE DAQ project.
3
// Fork baseline commit: system-00-00-20 (2020-09-25).
4
// Renamed since fork: yes (from system/FIFOConnection.h to include/okssystem/FIFOConnection.hpp).
5
6
/*
7
* FIFOConnection.h
8
* OksSystem
9
*
10
* Created by Matthias Wiesmann on 07.04.05.
11
* Copyright 2005 CERN. All rights reserved.
12
*
13
*/
14
15
#ifndef OKSSYSTEM_FIFO_CONNECTION
16
#define OKSSYSTEM_FIFO_CONNECTION
17
18
#include "
okssystem/Descriptor.hpp
"
19
#include "
okssystem/File.hpp
"
20
21
namespace
OksSystem
{
22
28
29
class
FIFOConnection
:
public
File
30
{
31
32
public
:
33
static
const
unsigned
int
MAX_MESSAGE_LEN
;
34
35
FIFOConnection
(
const
std::string& name);
36
FIFOConnection
(
const
File
& file);
37
38
~FIFOConnection
();
39
40
void
make
(mode_t perm = 0622)
const
;
41
42
std::string
read_message
()
const
;
43
void
send_message
(
const
std::string& message)
const
;
44
45
OksSystem::Descriptor
*
open_r
(
bool
block =
true
);
46
OksSystem::Descriptor
*
open_w
(
bool
block =
true
);
47
OksSystem::Descriptor
*
open_rw
(
bool
block =
true
);
48
void
send
(
const
std::string& message)
const
;
49
std::string
read
()
const
;
50
int
fd
()
const
;
51
void
close
();
52
53
private
:
54
OksSystem::Descriptor
*
m_fifo_fd
;
55
bool
m_is_blocking
;
56
57
};
// FIFOConnection
58
59
}
// OksSystem
60
61
#endif
Descriptor.hpp
File.hpp
OksSystem::Descriptor
File descriptor / Socket wrapper.
Definition
Descriptor.hpp:35
OksSystem::FIFOConnection::FIFOConnection
FIFOConnection(const std::string &name)
Definition
FIFOConnection.cpp:29
OksSystem::FIFOConnection::close
void close()
It closes the FIFO file descriptor.
Definition
FIFOConnection.cpp:238
OksSystem::FIFOConnection::send
void send(const std::string &message) const
It writes a message to a FIFO.
Definition
FIFOConnection.cpp:105
OksSystem::FIFOConnection::send_message
void send_message(const std::string &message) const
Definition
FIFOConnection.cpp:82
OksSystem::FIFOConnection::open_rw
OksSystem::Descriptor * open_rw(bool block=true)
It opens the FIFO in read and write mode.
Definition
FIFOConnection.cpp:208
OksSystem::FIFOConnection::read_message
std::string read_message() const
Definition
FIFOConnection.cpp:62
OksSystem::FIFOConnection::MAX_MESSAGE_LEN
static const unsigned int MAX_MESSAGE_LEN
Definition
FIFOConnection.hpp:33
OksSystem::FIFOConnection::make
void make(mode_t perm=0622) const
Definition
FIFOConnection.cpp:51
OksSystem::FIFOConnection::m_fifo_fd
OksSystem::Descriptor * m_fifo_fd
Definition
FIFOConnection.hpp:54
OksSystem::FIFOConnection::fd
int fd() const
It gets the FIFO file descriptor.
Definition
FIFOConnection.cpp:253
OksSystem::FIFOConnection::open_w
OksSystem::Descriptor * open_w(bool block=true)
It opens the FIFO in write-only mode.
Definition
FIFOConnection.cpp:178
OksSystem::FIFOConnection::read
std::string read() const
It reads a single message (string) from a FIFO.
Definition
FIFOConnection.cpp:124
OksSystem::FIFOConnection::open_r
OksSystem::Descriptor * open_r(bool block=true)
It opens the FIFO in read-only mode.
Definition
FIFOConnection.cpp:148
OksSystem::FIFOConnection::m_is_blocking
bool m_is_blocking
Definition
FIFOConnection.hpp:55
OksSystem::File::File
File(const std::string &name)
Definition
File.cpp:327
OksSystem
Definition
Descriptor.hpp:22
Generated on
for DUNE-DAQ by
1.18.0