The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
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
 

Constructor & Destructor Documentation

◆ IoFlags() [1/2]

Io::IoFlags::IoFlags ( )
default

◆ IoFlags() [2/2]

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

Definition at line 46 of file IFileMgr.h.

46: _f( i ) {}
unsigned _f
Definition IFileMgr.h:84

Member Function Documentation

◆ bits()

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

Definition at line 69 of file IFileMgr.h.

69 {
70 std::string s;
71 unsigned f( _f );
72 const unsigned SHIFT = 8 * sizeof( unsigned ) - 1;
73 const unsigned MASK = 1u << SHIFT;
74
75 for ( unsigned i = 1; i <= SHIFT + 1; ++i ) {
76 s += ( f & MASK ? '1' : '0' );
77 f <<= 1;
78 if ( i % 8 == 0 ) s += ' ';
79 }
80 return s;
81 }
unsigned f() const
Definition IFileMgr.h:48

◆ f()

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

Definition at line 48 of file IFileMgr.h.

48{ return _f; }

◆ isInvalid()

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

Definition at line 61 of file IFileMgr.h.

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

◆ isRdWr()

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

Definition at line 60 of file IFileMgr.h.

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

◆ isRead()

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

Definition at line 58 of file IFileMgr.h.

58{ return ( _f == READ ); }

◆ isWrite()

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

Definition at line 59 of file IFileMgr.h.

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

◆ match()

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

Definition at line 63 of file IFileMgr.h.

63 {
64 if ( strict ) { return ( _f == fa ); }
65 // only look at first 2 bits
66 return ( ( _f & 3 ) == ( fa & 3 ) );
67 }

◆ operator unsigned()

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

Definition at line 56 of file IFileMgr.h.

56{ return _f; }

◆ operator==() [1/2]

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

Definition at line 50 of file IFileMgr.h.

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

◆ operator==() [2/2]

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

Definition at line 51 of file IFileMgr.h.

51{ return ( _f == fa ); }

◆ operator|() [1/2]

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

Definition at line 53 of file IFileMgr.h.

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

◆ operator|() [2/2]

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

Definition at line 54 of file IFileMgr.h.

54{ return ( _f | fa ); }

Member Data Documentation

◆ _f

unsigned Io::IoFlags::_f = INVALID
private

Definition at line 84 of file IFileMgr.h.


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