DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
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"
20
21namespace 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
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:
55
56 } ; // FIFOConnection
57
58} // OksSystem
59
60#endif
File descriptor / Socket wrapper.
FIFOConnection(const std::string &name)
void close()
It closes the FIFO file descriptor.
void send(const std::string &message) const
It writes a message to a FIFO.
void send_message(const std::string &message) const
OksSystem::Descriptor * open_rw(bool block=true)
It opens the FIFO in read and write mode.
std::string read_message() const
static const unsigned int MAX_MESSAGE_LEN
void make(mode_t perm=0622) const
OksSystem::Descriptor * m_fifo_fd
int fd() const
It gets the FIFO file descriptor.
OksSystem::Descriptor * open_w(bool block=true)
It opens the FIFO in write-only mode.
std::string read() const
It reads a single message (string) from a FIFO.
OksSystem::Descriptor * open_r(bool block=true)
It opens the FIFO in read-only mode.
File(const std::string &name)
Definition File.cpp:301