My Project
Loading...
Searching...
No Matches
factory
cf_switches.h
Go to the documentation of this file.
1
/* emacs edit mode for this file is -*- C++ -*- */
2
3
/**
4
*
5
* @file cf_switches.h
6
*
7
* header to cf_switches.cc.
8
*
9
**/
10
11
12
#ifndef INCL_CF_SWITCHES_H
13
#define INCL_CF_SWITCHES_H
14
15
// #include "config.h"
16
17
/** const int CFSwitchesMax
18
*
19
* const CFSwitchesMax - maximum number of switches.
20
*
21
**/
22
const
int
CFSwitchesMax
= 15;
23
24
/** class CFSwitches
25
*
26
* class CFSwitches - manages boolean switches.
27
*
28
* An object of class `CFSwitches' is simply an array of booleans
29
* with some comfortable access methods (`On()', `isOn()', etc.).
30
* Each object may contain `CFSwitchesMax' switches. When a new
31
* object of type `CFSwitches' is created, all its switches are
32
* turned off.
33
*
34
* Note: No range checking is done when accessing switches.
35
*
36
* switches: the switches
37
*
38
**/
39
class
CFSwitches
40
{
41
private
:
42
bool
switches
[
CFSwitchesMax
];
43
44
public
:
45
// constructors, destructors
46
CFSwitches
();
47
~CFSwitches
() {}
48
49
// selectors
50
/// switch 's' on
51
void
On
(
int
s
) {
switches
[
s
] =
true
; }
52
/// switch 's' off
53
void
Off
(
int
s
) {
switches
[
s
] =
false
; }
54
/// check if 's' is on
55
bool
isOn
(
int
s
)
const
{
return
switches
[
s
]; }
56
/// check if 's' is off
57
bool
isOff
(
int
s
)
const
{
return
!
switches
[
s
]; }
58
};
59
/** CFSwitches cf_glob_switches;
60
*
61
* cf_glob_switches - factory switches.
62
*
63
* This is the only object of type CFSwitches in factory. It is
64
* used either directly in the low level algorithms or by the
65
* functions On(), Off(), isOn() defined in canonicalform.cc.
66
*
67
**/
68
// extern CFSwitches& cf_glob_switches;
69
// CFSwitches& cf_glob_switches = CFSwitches::getInstance();
70
EXTERN_INST_VAR
CFSwitches
cf_glob_switches
;
71
72
#endif
/* ! INCL_CF_SWITCHES_H */
cf_glob_switches
EXTERN_INST_VAR CFSwitches cf_glob_switches
CFSwitches cf_glob_switches;.
Definition:
cf_switches.h:70
CFSwitchesMax
const int CFSwitchesMax
const int CFSwitchesMax
Definition:
cf_switches.h:22
CFSwitches
class CFSwitches
Definition:
cf_switches.h:40
CFSwitches::isOff
bool isOff(int s) const
check if 's' is off
Definition:
cf_switches.h:57
CFSwitches::On
void On(int s)
switch 's' on
Definition:
cf_switches.h:51
CFSwitches::CFSwitches
CFSwitches()
CFSwitches::CFSwitches ()
Definition:
cf_switches.cc:31
CFSwitches::~CFSwitches
~CFSwitches()
Definition:
cf_switches.h:47
CFSwitches::Off
void Off(int s)
switch 's' off
Definition:
cf_switches.h:53
CFSwitches::switches
bool switches[CFSwitchesMax]
Definition:
cf_switches.h:42
CFSwitches::isOn
bool isOn(int s) const
check if 's' is on
Definition:
cf_switches.h:55
s
const CanonicalForm int s
Definition:
facAbsFact.cc:51
EXTERN_INST_VAR
#define EXTERN_INST_VAR
Definition:
globaldefs.h:9
Generated on Mon Feb 27 2023 10:53:48 for My Project by
doxygen 1.9.5
for
Singular