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

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)
 
static const InterfaceID & interfaceID ()
 

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 36 of file IIoSvc.h.

Member Enumeration Documentation

◆ IoType

I/O Connection types.

Enumerator
INVALID 
READ 
UPDATE 
CREATE 
RECREATE 

Definition at line 39 of file IIoSvc.h.

39  {
40  INVALID = 0,
41  READ = 1<<1,
42  UPDATE = 1<<2,
43  CREATE = 1<<3,
44  RECREATE = (1<<4)+(1<<3)
45  };

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

Implemented in IoSvc.

◆ 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

Implemented in IoSvc.

◆ 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

Implemented in IoSvc.

◆ has_fd()

virtual bool IIoSvc::has_fd ( Fd  fd) const
pure virtual

test if a given file descriptor fd is known to us

Implemented in IoSvc.

◆ interfaceID()

const InterfaceID & IIoSvc::interfaceID ( )
inlinestatic

Definition at line 128 of file IIoSvc.h.

129 {
130  static const InterfaceID IID_IIoSvc("IIoSvc", 1, 0);
131  return IID_IIoSvc;
132 }

◆ IoTypeFromName()

static IoType IIoSvc::IoTypeFromName ( const std::string &  name)
inlinestatic

Definition at line 61 of file IIoSvc.h.

61  {
62  static std::map<std::string, IoType> s_names;
63  if (s_names.empty()) {
64  s_names[""] = INVALID;
65  s_names["READ"] = READ;
66  s_names["UPDATE"] = UPDATE;
67  s_names["CREATE"] = CREATE;
68  s_names["RECREATE"] = RECREATE;
69  }
70  return s_names[name];
71  }

◆ IoTypeName()

static const std::string& IIoSvc::IoTypeName ( IoType  mode)
inlinestatic

Definition at line 48 of file IIoSvc.h.

48  {
49  static std::map<IoType, std::string> s_names;
50  if (s_names.empty()) {
51  s_names[INVALID] = "";
52  s_names[READ] = "READ";
53  s_names[UPDATE] = "UPDATE";
54  s_names[CREATE] = "CREATE";
55  s_names[RECREATE] = "RECREATE";
56  }
57  return s_names[mode];
58  }

◆ mode()

virtual IoType IIoSvc::mode ( Fd  fd) const
pure virtual

retrieve the open mode associated with file descriptor fd

Implemented in IoSvc.

◆ 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

Implemented in IoSvc.


The documentation for this class was generated from the following files:
IIoSvc::RECREATE
@ RECREATE
Definition: IIoSvc.h:44
IIoSvc::CREATE
@ CREATE
Definition: IIoSvc.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
IIoSvc::UPDATE
@ UPDATE
Definition: IIoSvc.h:42
IIoSvc::mode
virtual IoType mode(Fd fd) const =0
retrieve the open mode associated with file descriptor fd
IIoSvc::READ
@ READ
Definition: IIoSvc.h:41
IIoSvc::INVALID
@ INVALID
Definition: IIoSvc.h:40