Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
CFSwitches Class Reference

class CFSwitches More...

#include <cf_switches.h>

Public Member Functions

 ~CFSwitches ()
 
void On (int s)
 switch 's' on More...
 
void Off (int s)
 switch 's' off More...
 
bool isOn (int s) const
 check if 's' is on More...
 
bool isOff (int s) const
 check if 's' is off More...
 

Static Public Member Functions

static CFSwitchesgetInstance ()
 

Private Member Functions

 CFSwitches ()
 CFSwitches::CFSwitches () More...
 

Private Attributes

bool switches [CFSwitchesMax]
 

Detailed Description

class CFSwitches

class CFSwitches - manages boolean switches.

An object of class `CFSwitches' is simply an array of booleans with some comfortable access methods (`On()', `isOn()', etc.). Each object may contain `CFSwitchesMax' switches. When a new object of type `CFSwitches' is created, all its switches are turned off.

Note: No range checking is done when accessing switches.

switches: the switches

Definition at line 39 of file cf_switches.h.

Constructor & Destructor Documentation

CFSwitches::CFSwitches ( )
private

CFSwitches::CFSwitches ()

CFSwitches::CFSwitches() - default constructor.

Turns all switches off.

Definition at line 27 of file cf_switches.cc.

28 {
29  for ( int i = 0; i < CFSwitchesMax; i++ )
30  switches[i] = false;
31 // and set the default (recommended) On-values:
32 #ifdef HAVE_NTL
34  //Off(SW_USE_NTL_SORT);
35 #endif
37  //On(SW_USE_EZGCD_P); // still testing
38  On(SW_USE_QGCD);
39 }
void On(int s)
switch &#39;s&#39; on
Definition: cf_switches.h:56
bool switches[CFSwitchesMax]
Definition: cf_switches.h:42
int i
Definition: cfEzgcd.cc:123
static const int SW_USE_CHINREM_GCD
set to 1 to use modular gcd over Z
Definition: cf_defs.h:38
static const int SW_USE_QGCD
set to 1 to use Encarnacion GCD over Q(a)
Definition: cf_defs.h:40
static const int SW_USE_EZGCD
set to 1 to use EZGCD over Z
Definition: cf_defs.h:32
const int CFSwitchesMax
const int CFSwitchesMax
Definition: cf_switches.h:22
CFSwitches::~CFSwitches ( )
inline

Definition at line 47 of file cf_switches.h.

47 {}

Member Function Documentation

static CFSwitches& CFSwitches::getInstance ( )
inlinestatic

Definition at line 49 of file cf_switches.h.

50  {
51  static CFSwitches singleton;
52  return singleton;
53  }
class CFSwitches
Definition: cf_switches.h:39
bool CFSwitches::isOff ( int  s) const
inline

check if 's' is off

Definition at line 62 of file cf_switches.h.

62 { return ! switches[s]; }
const CanonicalForm int s
Definition: facAbsFact.cc:55
bool switches[CFSwitchesMax]
Definition: cf_switches.h:42
bool CFSwitches::isOn ( int  s) const
inline

check if 's' is on

Definition at line 60 of file cf_switches.h.

60 { return switches[s]; }
const CanonicalForm int s
Definition: facAbsFact.cc:55
bool switches[CFSwitchesMax]
Definition: cf_switches.h:42
void CFSwitches::Off ( int  s)
inline

switch 's' off

Definition at line 58 of file cf_switches.h.

58 { switches[s] = false; }
const CanonicalForm int s
Definition: facAbsFact.cc:55
bool switches[CFSwitchesMax]
Definition: cf_switches.h:42
void CFSwitches::On ( int  s)
inline

switch 's' on

Definition at line 56 of file cf_switches.h.

56 { switches[s] = true; }
const CanonicalForm int s
Definition: facAbsFact.cc:55
bool switches[CFSwitchesMax]
Definition: cf_switches.h:42

Field Documentation

bool CFSwitches::switches[CFSwitchesMax]
private

Definition at line 42 of file cf_switches.h.


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