The Gaudi Framework  master (37c0b60a)
Io::IoFlags Class Referencefinal

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/IFileMgr.h>

Public Member Functions

 IoFlags ()=default
 
 IoFlags (unsigned i)
 
unsigned f () const
 
bool operator== (const IoFlags &fa) const
 
bool operator== (const unsigned &fa) const
 
IoFlags operator| (const IoFlags &fa) const
 
IoFlags operator| (const unsigned &fa) const
 
 operator unsigned () const
 
bool isRead () const
 
bool isWrite () const
 
bool isRdWr () const
 
bool isInvalid () const
 
bool match (const IoFlags &fa, bool strict=true) const
 
std::string bits () const
 

Private Attributes

unsigned _f = INVALID
 

Detailed Description

Definition at line 50 of file IFileMgr.h.

Constructor & Destructor Documentation

◆ IoFlags() [1/2]

Io::IoFlags::IoFlags ( )
default

◆ IoFlags() [2/2]

Io::IoFlags::IoFlags ( unsigned  i)
inline

Definition at line 53 of file IFileMgr.h.

53 : _f( i ) {}

Member Function Documentation

◆ bits()

std::string Io::IoFlags::bits ( ) const
inline

Definition at line 76 of file IFileMgr.h.

76  {
77  std::string s;
78  unsigned f( _f );
79  const unsigned SHIFT = 8 * sizeof( unsigned ) - 1;
80  const unsigned MASK = 1u << SHIFT;
81 
82  for ( unsigned i = 1; i <= SHIFT + 1; ++i ) {
83  s += ( f & MASK ? '1' : '0' );
84  f <<= 1;
85  if ( i % 8 == 0 ) s += ' ';
86  }
87  return s;
88  }

◆ f()

unsigned Io::IoFlags::f ( ) const
inline

Definition at line 55 of file IFileMgr.h.

55 { return _f; }

◆ isInvalid()

bool Io::IoFlags::isInvalid ( ) const
inline

Definition at line 68 of file IFileMgr.h.

68 { return ( ( _f & INVALID ) != 0 ); }

◆ isRdWr()

bool Io::IoFlags::isRdWr ( ) const
inline

Definition at line 67 of file IFileMgr.h.

67 { return ( ( _f & RDWR ) != 0 ); }

◆ isRead()

bool Io::IoFlags::isRead ( ) const
inline

Definition at line 65 of file IFileMgr.h.

65 { return ( _f == READ ); }

◆ isWrite()

bool Io::IoFlags::isWrite ( ) const
inline

Definition at line 66 of file IFileMgr.h.

66 { return ( ( _f & WRITE ) != 0 ); }

◆ match()

bool Io::IoFlags::match ( const IoFlags fa,
bool  strict = true 
) const
inline

Definition at line 70 of file IFileMgr.h.

70  {
71  if ( strict ) { return ( _f == fa ); }
72  // only look at first 2 bits
73  return ( ( _f & 3 ) == ( fa & 3 ) );
74  }

◆ operator unsigned()

Io::IoFlags::operator unsigned ( ) const
inline

Definition at line 63 of file IFileMgr.h.

63 { return _f; }

◆ operator==() [1/2]

bool Io::IoFlags::operator== ( const IoFlags fa) const
inline

Definition at line 57 of file IFileMgr.h.

57 { return ( _f == fa.f() ); }

◆ operator==() [2/2]

bool Io::IoFlags::operator== ( const unsigned &  fa) const
inline

Definition at line 58 of file IFileMgr.h.

58 { return ( _f == fa ); }

◆ operator|() [1/2]

IoFlags Io::IoFlags::operator| ( const IoFlags fa) const
inline

Definition at line 60 of file IFileMgr.h.

60 { return ( _f | fa.f() ); }

◆ operator|() [2/2]

IoFlags Io::IoFlags::operator| ( const unsigned &  fa) const
inline

Definition at line 61 of file IFileMgr.h.

61 { return ( _f | fa ); }

Member Data Documentation

◆ _f

unsigned Io::IoFlags::_f = INVALID
private

Definition at line 91 of file IFileMgr.h.


The documentation for this class was generated from the following file:
std::string
STL class.
Io::INVALID
@ INVALID
Definition: IFileMgr.h:47
Io::IoFlags::_f
unsigned _f
Definition: IFileMgr.h:91
Io::IoFlags::f
unsigned f() const
Definition: IFileMgr.h:55
gaudirun.s
string s
Definition: gaudirun.py:346
Io::WRITE
@ WRITE
Definition: IFileMgr.h:38
Io::RDWR
@ RDWR
Definition: IFileMgr.h:39
Io::READ
@ READ
Definition: IFileMgr.h:37