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/File.hpp
"
19
#include "
okssystem/Descriptor.hpp
"
20
21
namespace
OksSystem
{
22
28
29
class
FIFOConnection
:
public
File
{
30
31
public
:
32
static
const
unsigned
int
MAX_MESSAGE_LEN
;
33
34
FIFOConnection
(
const
std::string &name) ;
35
FIFOConnection
(
const
File
&file) ;
36
37
~FIFOConnection
() ;
38
39
void
make
(mode_t perm=0622)
const
;
40
41
std::string
read_message
()
const
;
42
void
send_message
(
const
std::string &message)
const
;
43
44
OksSystem::Descriptor
*
open_r
(
bool
block =
true
);
45
OksSystem::Descriptor
*
open_w
(
bool
block =
true
);
46
OksSystem::Descriptor
*
open_rw
(
bool
block =
true
);
47
void
send
(
const
std::string &message)
const
;
48
std::string
read
()
const
;
49
int
fd
()
const
;
50
void
close
();
51
52
private
:
53
OksSystem::Descriptor
*
m_fifo_fd
;
54
bool
m_is_blocking
;
55
56
} ;
// FIFOConnection
57
58
}
// OksSystem
59
60
#endif
Descriptor.hpp
File.hpp
OksSystem::Descriptor
File descriptor / Socket wrapper.
Definition
Descriptor.hpp:34
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:222
OksSystem::FIFOConnection::send
void send(const std::string &message) const
It writes a message to a FIFO.
Definition
FIFOConnection.cpp:93
OksSystem::FIFOConnection::send_message
void send_message(const std::string &message) const
Definition
FIFOConnection.cpp:72
OksSystem::FIFOConnection::open_rw
OksSystem::Descriptor * open_rw(bool block=true)
It opens the FIFO in read and write mode.
Definition
FIFOConnection.cpp:192
OksSystem::FIFOConnection::read_message
std::string read_message() const
Definition
FIFOConnection.cpp:54
OksSystem::FIFOConnection::MAX_MESSAGE_LEN
static const unsigned int MAX_MESSAGE_LEN
Definition
FIFOConnection.hpp:32
OksSystem::FIFOConnection::make
void make(mode_t perm=0622) const
Definition
FIFOConnection.cpp:45
OksSystem::FIFOConnection::m_fifo_fd
OksSystem::Descriptor * m_fifo_fd
Definition
FIFOConnection.hpp:53
OksSystem::FIFOConnection::fd
int fd() const
It gets the FIFO file descriptor.
Definition
FIFOConnection.cpp:236
OksSystem::FIFOConnection::open_w
OksSystem::Descriptor * open_w(bool block=true)
It opens the FIFO in write-only mode.
Definition
FIFOConnection.cpp:162
OksSystem::FIFOConnection::read
std::string read() const
It reads a single message (string) from a FIFO.
Definition
FIFOConnection.cpp:110
OksSystem::FIFOConnection::open_r
OksSystem::Descriptor * open_r(bool block=true)
It opens the FIFO in read-only mode.
Definition
FIFOConnection.cpp:131
OksSystem::FIFOConnection::~FIFOConnection
~FIFOConnection()
Definition
FIFOConnection.cpp:41
OksSystem::FIFOConnection::m_is_blocking
bool m_is_blocking
Definition
FIFOConnection.hpp:54
OksSystem::File::File
File(const std::string &name)
Definition
File.cpp:301
OksSystem
Definition
Descriptor.hpp:22
Generated on
for DUNE-DAQ by
1.17.0