Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (01b473db)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 43 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 46 of file IFileMgr.h.

46 : _f( i ) {}

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  }

◆ 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:
Io::INVALID
@ INVALID
Definition: IFileMgr.h:40
Io::IoFlags::_f
unsigned _f
Definition: IFileMgr.h:84
Io::IoFlags::f
unsigned f() const
Definition: IFileMgr.h:48
gaudirun.s
string s
Definition: gaudirun.py:346
Io::WRITE
@ WRITE
Definition: IFileMgr.h:31
Io::RDWR
@ RDWR
Definition: IFileMgr.h:32
Io::READ
@ READ
Definition: IFileMgr.h:30