DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
FIFOConnection.hpp
Go to the documentation of this file.
1/*
2 * FIFOConnection.h
3 * OksSystem
4 *
5 * Created by Matthias Wiesmann on 07.04.05.
6 * Copyright 2005 CERN. All rights reserved.
7 *
8 */
9
10#ifndef OKSSYSTEM_FIFO_CONNECTION
11#define OKSSYSTEM_FIFO_CONNECTION
12
13#include "okssystem/File.hpp"
15
16namespace OksSystem {
17
24 class FIFOConnection : public File {
25
26 public:
27 static const unsigned int MAX_MESSAGE_LEN ;
28
29 FIFOConnection(const std::string &name) ;
30 FIFOConnection(const File &file) ;
31
33
34 void make(mode_t perm=0622) const ;
35
36 std::string read_message() const ;
37 void send_message(const std::string &message) const ;
38
39 OksSystem::Descriptor* open_r(bool block = true);
40 OksSystem::Descriptor* open_w(bool block = true);
41 OksSystem::Descriptor* open_rw(bool block = true);
42 void send(const std::string &message) const;
43 std::string read() const;
44 int fd() const;
45 void close();
46
47 private:
50
51 } ; // FIFOConnection
52
53} // OksSystem
54
55#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.
Wrapper for file operations.
Definition File.hpp:32