ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | List of all members
IIoSvc Class Referenceabstract

#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 More...
 

Public Member Functions

 DeclareInterfaceID (IIoSvc, 1, 0)
 InterfaceID. More...
 
virtual ~IIoSvc ()
 Destructor: More...
 
virtual Fd open (const std::string &fname, IoType mode)=0
 open file fname with open mode mode More...
 
virtual StatusCode close (Fd fd)=0
 close file fd More...
 
virtual bool has_fd (Fd fd) const =0
 test if a given file descriptor fd is known to us More...
 
virtual Fd fd (const std::string &fname) const =0
 retrieve the file descriptor associated with file fname More...
 
virtual const std::string & fname (Fd fd) const =0
 retrieve the file fname associated with file descriptor fd More...
 
virtual IoType mode (Fd fd) const =0
 retrieve the open mode associated with file descriptor fd More...
 

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  };

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  ,
,
 
)

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()

static 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()

static 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  }

◆ 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:
IIoSvc::RECREATE
@ RECREATE
Definition: IIoSvc.h:46
IIoSvc::CREATE
@ CREATE
Definition: IIoSvc.h:45
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
IIoSvc::UPDATE
@ UPDATE
Definition: IIoSvc.h:44
IIoSvc::mode
virtual IoType mode(Fd fd) const =0
retrieve the open mode associated with file descriptor fd
IIoSvc::READ
@ READ
Definition: IIoSvc.h:43
IIoSvc::INVALID
@ INVALID
Definition: IIoSvc.h:42