is a registry of file handles, storing their name and openmode.
More...
#include <IIoSvc.h>
|
| | DeclareInterfaceID (IIoSvc, 1, 0) |
| | InterfaceID.
|
| virtual | ~IIoSvc () |
| | Destructor:
|
| virtual Fd | open (const std::string &fname, IoType mode)=0 |
| | open file fname with open mode mode
|
| virtual StatusCode | close (Fd fd)=0 |
| | close file fd
|
| virtual bool | has_fd (Fd fd) const =0 |
| | test if a given file descriptor fd is known to us
|
| virtual Fd | fd (const std::string &fname) const =0 |
| | retrieve the file descriptor associated with file fname
|
| virtual const std::string & | fname (Fd fd) const =0 |
| | retrieve the file fname associated with file descriptor fd
|
| virtual IoType | mode (Fd fd) const =0 |
| | retrieve the open mode associated with file descriptor fd
|
is a registry of file handles, storing their name and openmode.
Definition at line 27 of file IIoSvc.h.
◆ Fd
unix-y file descriptor
Definition at line 38 of file IIoSvc.h.
◆ IoType
I/O Connection types.
| Enumerator |
|---|
| INVALID | |
| READ | |
| UPDATE | |
| CREATE | |
| RECREATE | |
Definition at line 41 of file IIoSvc.h.
◆ ~IIoSvc()
◆ close()
| virtual StatusCode IIoSvc::close |
( |
Fd | fd | ) |
|
|
pure virtual |
◆ DeclareInterfaceID()
| IIoSvc::DeclareInterfaceID |
( |
IIoSvc | , |
|
|
1 | , |
|
|
0 | ) |
◆ fd()
| virtual Fd IIoSvc::fd |
( |
const std::string & | fname | ) |
const |
|
pure virtual |
retrieve the file descriptor associated with file fname
- Returns
- -1 if no such fname is known
◆ fname()
| virtual const std::string & IIoSvc::fname |
( |
Fd | fd | ) |
const |
|
pure virtual |
retrieve the file fname associated with file descriptor fd
- Returns
- empty string if no such fd is known
◆ has_fd()
| virtual bool IIoSvc::has_fd |
( |
Fd | fd | ) |
const |
|
pure virtual |
test if a given file descriptor fd is known to us
◆ IoTypeFromName()
| IoType IIoSvc::IoTypeFromName |
( |
const std::string & | name | ) |
|
|
inlinestatic |
Definition at line 63 of file IIoSvc.h.
63 {
64 static std::map<std::string, IoType> s_names;
65 if (s_names.empty()) {
67 s_names[
"READ"] =
READ;
68 s_names[
"UPDATE"] =
UPDATE;
69 s_names[
"CREATE"] =
CREATE;
71 }
73 }
◆ IoTypeName()
| const std::string & IIoSvc::IoTypeName |
( |
IoType | mode | ) |
|
|
inlinestatic |
Definition at line 50 of file IIoSvc.h.
50 {
51 static std::map<IoType, std::string> s_names;
52 if (s_names.empty()) {
54 s_names[
READ] =
"READ";
55 s_names[
UPDATE] =
"UPDATE";
56 s_names[
CREATE] =
"CREATE";
58 }
60 }
virtual IoType mode(Fd fd) const =0
retrieve the open mode associated with file descriptor fd
◆ mode()
| virtual IoType IIoSvc::mode |
( |
Fd | fd | ) |
const |
|
pure virtual |
retrieve the open mode associated with file descriptor fd
◆ open()
| virtual Fd IIoSvc::open |
( |
const std::string & | fname, |
|
|
IoType | mode ) |
|
pure virtual |
open file fname with open mode mode
- Returns
- -1 if not successful
The documentation for this class was generated from the following files: