The Original CHomP Software
Public Types | Public Member Functions | Private Attributes | List of all members
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>

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). More...
 
 ~argflags ()
 The destructor. More...
 
void set (int flag)
 Sets the given flag. More...
 
void unset (int flag)
 Unsets (clears) the given flag. More...
 
bool get (int flag) const
 Returns true if any of the given flags is set or false otherwise. More...
 

Private Attributes

int n
 The interger variable that stores the flags. More...
 

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 99 of file arg.h.

Member Enumeration Documentation

◆ names

A list of specific names for the flags.

Enumerator
obligatory 
hasdefault 
filled 
breakinterpreting 
toomany 
missingvalue 
readerror 
ignorevalue 

Definition at line 103 of file arg.h.

Constructor & Destructor Documentation

◆ argflags()

chomp::homology::argflags::argflags ( )
inline

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

Definition at line 109 of file arg.h.

109: n (0) {}
int n
The interger variable that stores the flags.
Definition: arg.h:125

◆ ~argflags()

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

The destructor.

Definition at line 112 of file arg.h.

112{}

Member Function Documentation

◆ get()

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 121 of file arg.h.

121{return !!(n & flag);}

References n.

◆ set()

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

Sets the given flag.

Definition at line 115 of file arg.h.

115{n |= flag;}

References n.

◆ unset()

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

Unsets (clears) the given flag.

Definition at line 118 of file arg.h.

118{n &= ~flag;}

References n.

Member Data Documentation

◆ n

int chomp::homology::argflags::n
private

The interger variable that stores the flags.

Definition at line 125 of file arg.h.

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


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