The Gaudi Framework  v30r3 (a5ef0a68)
Io::IoFlags Class Referencefinal

#include <GaudiKernel/IFileMgr.h>

Public Member Functions

 IoFlags ()=default
 
 IoFlags (int i)
 
int f () const
 
bool operator== (const IoFlags &fa) const
 
bool operator== (const int &fa) const
 
IoFlags operator| (const IoFlags &fa) const
 
IoFlags operator| (const int &fa) const
 
 operator int () 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

int _f = INVALID
 

Detailed Description

Definition at line 41 of file IFileMgr.h.

Constructor & Destructor Documentation

Io::IoFlags::IoFlags ( )
default
Io::IoFlags::IoFlags ( int  i)
inline

Definition at line 45 of file IFileMgr.h.

45 : _f( i ){};

Member Function Documentation

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

Definition at line 71 of file IFileMgr.h.

72  {
73  std::string s;
74  int f( _f );
75  const int SHIFT = 8 * sizeof( int ) - 1;
76  const unsigned MASK = 1 << SHIFT;
77 
78  for ( int i = 1; i <= SHIFT + 1; ++i ) {
79  s += ( f & MASK ? '1' : '0' );
80  f <<= 1;
81  if ( i % 8 == 0 ) s += ' ';
82  }
83  return s;
84  }
STL class.
string s
Definition: gaudirun.py:253
int f() const
Definition: IFileMgr.h:47
int Io::IoFlags::f ( ) const
inline

Definition at line 47 of file IFileMgr.h.

47 { return _f; }
bool Io::IoFlags::isInvalid ( ) const
inline

Definition at line 60 of file IFileMgr.h.

60 { return ( ( _f & INVALID ) != 0 ); }
bool Io::IoFlags::isRdWr ( ) const
inline

Definition at line 59 of file IFileMgr.h.

59 { return ( ( _f & RDWR ) != 0 ); }
bool Io::IoFlags::isRead ( ) const
inline

Definition at line 57 of file IFileMgr.h.

57 { return ( _f == READ ); }
bool Io::IoFlags::isWrite ( ) const
inline

Definition at line 58 of file IFileMgr.h.

58 { return ( ( _f & WRITE ) != 0 ); }
bool Io::IoFlags::match ( const IoFlags fa,
bool  strict = true 
) const
inline

Definition at line 62 of file IFileMgr.h.

63  {
64  if ( strict ) {
65  return ( _f == fa );
66  }
67  // only look at first 2 bits
68  return ( ( _f & 3 ) == ( fa & 3 ) );
69  }
Io::IoFlags::operator int ( ) const
inline

Definition at line 55 of file IFileMgr.h.

55 { return _f; }
bool Io::IoFlags::operator== ( const IoFlags fa) const
inline

Definition at line 49 of file IFileMgr.h.

49 { return ( _f == fa.f() ); }
bool Io::IoFlags::operator== ( const int &  fa) const
inline

Definition at line 50 of file IFileMgr.h.

50 { return ( _f == fa ); }
IoFlags Io::IoFlags::operator| ( const IoFlags fa) const
inline

Definition at line 52 of file IFileMgr.h.

52 { return ( _f | fa.f() ); }
IoFlags Io::IoFlags::operator| ( const int &  fa) const
inline

Definition at line 53 of file IFileMgr.h.

53 { return ( _f | fa ); }

Member Data Documentation

int Io::IoFlags::_f = INVALID
private

Definition at line 87 of file IFileMgr.h.


The documentation for this class was generated from the following file: