DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
File descriptor / Socket wrapper. More...
#include <Descriptor.hpp>
Public Member Functions | |
Descriptor (const File *file, int flags, mode_t perm) | |
~Descriptor () | |
operator int () const throw () | |
void | close () |
close the descriptor | |
void | close_safe () throw () |
close the descriptor no exception | |
int | read (void *buffer, size_t number) const |
int | write (const void *buffer, size_t number) const |
int | fd () const throw () |
file descritptor | |
void | closeOnExec () |
It flags the file descriptor to be closed after any call to the exec okssystem function. | |
Static Public Member Functions | |
static int | flags (bool read_mode, bool write_mode) |
Protected Member Functions | |
void | open (const File *file, int flags, mode_t perm) |
internal open method | |
Private Attributes | |
int | m_fd |
std::string | m_name |
internal file descriptor | |
File descriptor / Socket wrapper.
This class represents a low level file descriptor. The descriptor is opened when the object is created. It can be close explicitely, or implicetly when the object is destroyed
Definition at line 29 of file Descriptor.hpp.
OksSystem::Descriptor::Descriptor | ( | const File * | file, |
int | flags, | ||
mode_t | perm ) |
Definition at line 35 of file Descriptor.cpp.
OksSystem::Descriptor::~Descriptor | ( | ) |
Definition at line 40 of file Descriptor.cpp.
void OksSystem::Descriptor::close | ( | ) |
close the descriptor
Closes the descriptor
file | optional pointer to the file that we close (used for pretty printing potential exceptions). |
OksSystem::CloseFail | if there is problem in the close okssystem call |
Definition at line 73 of file Descriptor.cpp.
void OksSystem::Descriptor::close_safe | ( | ) | ||||
throw | ( | ) |
close the descriptor no exception
Closes a descriptor safely, i.e without throwing exceptions If there is a proble, the information is sent to the warning stream
Definition at line 86 of file Descriptor.cpp.
void OksSystem::Descriptor::closeOnExec | ( | ) |
It flags the file descriptor to be closed after any call to the exec okssystem function.
Definition at line 114 of file Descriptor.cpp.
int OksSystem::Descriptor::fd | ( | ) | const | |||
throw | ( | ) |
|
static |
Definition at line 21 of file Descriptor.cpp.
|
protected |
internal open method
Opens the descriptor
file | pointer to the file to open |
flags | open flags |
perm | the permissions |
Definition at line 57 of file Descriptor.cpp.
OksSystem::Descriptor::operator int | ( | ) | const | |||
throw | ( | ) |
Definition at line 46 of file Descriptor.cpp.
int OksSystem::Descriptor::read | ( | void * | buffer, |
size_t | number ) const |
Definition at line 93 of file Descriptor.cpp.
int OksSystem::Descriptor::write | ( | const void * | buffer, |
size_t | number ) const |
Definition at line 100 of file Descriptor.cpp.
|
private |
Definition at line 56 of file Descriptor.hpp.
|
private |
internal file descriptor
Definition at line 57 of file Descriptor.hpp.