Public Types | Public Member Functions | Private Attributes

chomp::homology::argflags Class Reference

This is a helper class which defines specific flags indicating various types of command-line arguments and the state of interpreting them. More...

#include <arg.h>

List of all members.

Public Types

enum  names {
  obligatory = 0x01, hasdefault = 0x02, filled = 0x04, breakinterpreting = 0x08,
  toomany = 0x10, missingvalue = 0x20, readerror = 0x40, ignorevalue = 0x80
}
 

A list of specific names for the flags.

More...

Public Member Functions

 argflags ()
 The constructor. All flags are initially cleared (unset).
 ~argflags ()
 The destructor.
void set (int flag)
 Sets the given flag.
void unset (int flag)
 Unsets (clears) the given flag.
bool get (int flag) const
 Returns true if any of the given flags is set or false otherwise.

Private Attributes

int n
 The interger variable that stores the flags.

Detailed Description

This is a helper class which defines specific flags indicating various types of command-line arguments and the state of interpreting them.

Definition at line 100 of file arg.h.


Member Enumeration Documentation

A list of specific names for the flags.

Enumerator:
obligatory 
hasdefault 
filled 
breakinterpreting 
toomany 
missingvalue 
readerror 
ignorevalue 

Definition at line 104 of file arg.h.

                   {obligatory = 0x01, hasdefault = 0x02,
                filled = 0x04, breakinterpreting = 0x08,
                toomany = 0x10, missingvalue = 0x20,
                readerror = 0x40, ignorevalue = 0x80};


Constructor & Destructor Documentation

chomp::homology::argflags::argflags (  )  [inline]

The constructor. All flags are initially cleared (unset).

Definition at line 110 of file arg.h.

: n (0) {}

chomp::homology::argflags::~argflags (  )  [inline]

The destructor.

Definition at line 113 of file arg.h.

{}


Member Function Documentation

bool chomp::homology::argflags::get ( int  flag  )  const [inline]

Returns true if any of the given flags is set or false otherwise.

Definition at line 122 of file arg.h.

References n.

{return !!(n & flag);}

void chomp::homology::argflags::set ( int  flag  )  [inline]

Sets the given flag.

Definition at line 116 of file arg.h.

References n.

{n |= flag;}

void chomp::homology::argflags::unset ( int  flag  )  [inline]

Unsets (clears) the given flag.

Definition at line 119 of file arg.h.

References n.

{n &= ~flag;}


Member Data Documentation

The interger variable that stores the flags.

Definition at line 126 of file arg.h.

Referenced by get(), set(), and unset().


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