Public Member Functions | Private Attributes
CFSwitches Class Reference

class CFSwitches More...

#include <cf_switches.h>

Public Member Functions

 CFSwitches ()
 CFSwitches::CFSwitches () More...
 
 ~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...
 

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::CFSwitches ( )

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
38  On(SW_USE_QGCD);
39 }
void On(int s)
switch &#39;s&#39; on
Definition: cf_switches.h:51
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
Definition: cf_defs.h:34
bool switches[CFSwitchesMax]
Definition: cf_switches.h:42
int i
Definition: cfEzgcd.cc:125
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::~CFSwitches ( )
inline

Definition at line 47 of file cf_switches.h.

47 {}

Member Function Documentation

◆ isOff()

bool CFSwitches::isOff ( int  s) const
inline

check if 's' is off

Definition at line 57 of file cf_switches.h.

57 { return ! switches[s]; }
const CanonicalForm int s
Definition: facAbsFact.cc:55
bool switches[CFSwitchesMax]
Definition: cf_switches.h:42

◆ isOn()

bool CFSwitches::isOn ( int  s) const
inline

check if 's' is on

Definition at line 55 of file cf_switches.h.

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

◆ Off()

void CFSwitches::Off ( int  s)
inline

switch 's' off

Definition at line 53 of file cf_switches.h.

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

◆ On()

void CFSwitches::On ( int  s)
inline

switch 's' on

Definition at line 51 of file cf_switches.h.

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

Field Documentation

◆ switches

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: