ATLAS Offline Software
Loading...
Searching...
No Matches
IIoSvc Class Referenceabstract

is a registry of file handles, storing their name and openmode. More...

#include <IIoSvc.h>

Inheritance diagram for IIoSvc:
Collaboration diagram for IIoSvc:

Public Types

enum  IoType {
  INVALID = 0 , READ = 1<<1 , UPDATE = 1<<2 , CREATE = 1<<3 ,
  RECREATE = (1<<4)+(1<<3)
}
 I/O Connection types. More...
typedef int Fd
 unix-y file descriptor

Public Member Functions

 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

Static Public Member Functions

static const std::string & IoTypeName (IoType mode)
static IoType IoTypeFromName (const std::string &name)

Detailed Description

is a registry of file handles, storing their name and openmode.

Definition at line 27 of file IIoSvc.h.

Member Typedef Documentation

◆ Fd

typedef int IIoSvc::Fd

unix-y file descriptor

Definition at line 38 of file IIoSvc.h.

Member Enumeration Documentation

◆ IoType

I/O Connection types.

Enumerator
INVALID 
READ 
UPDATE 
CREATE 
RECREATE 

Definition at line 41 of file IIoSvc.h.

41 {
42 INVALID = 0,
43 READ = 1<<1,
44 UPDATE = 1<<2,
45 CREATE = 1<<3,
46 RECREATE = (1<<4)+(1<<3)
47 };
@ READ
Definition IIoSvc.h:43
@ CREATE
Definition IIoSvc.h:45
@ UPDATE
Definition IIoSvc.h:44
@ RECREATE
Definition IIoSvc.h:46
@ INVALID
Definition IIoSvc.h:42

Constructor & Destructor Documentation

◆ ~IIoSvc()

IIoSvc::~IIoSvc ( )
virtual

Destructor:

Definition at line 17 of file IIoSvc.cxx.

18{}

Member Function Documentation

◆ close()

virtual StatusCode IIoSvc::close ( Fd fd)
pure virtual

close file fd

◆ DeclareInterfaceID()

IIoSvc::DeclareInterfaceID ( IIoSvc ,
1 ,
0  )

InterfaceID.

◆ 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()) {
66 s_names[""] = INVALID;
67 s_names["READ"] = READ;
68 s_names["UPDATE"] = UPDATE;
69 s_names["CREATE"] = CREATE;
70 s_names["RECREATE"] = RECREATE;
71 }
72 return s_names[name];
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()) {
53 s_names[INVALID] = "";
54 s_names[READ] = "READ";
55 s_names[UPDATE] = "UPDATE";
56 s_names[CREATE] = "CREATE";
57 s_names[RECREATE] = "RECREATE";
58 }
59 return s_names[mode];
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: