source: git/factory/cf_switches.h

spielwiese
Last change on this file was f53c82, checked in by Hans Schoenemann <hannes@…>, 3 years ago
add SW_USE_FL_FAC_0A
  • Property mode set to 100644
File size: 1.7 KB
Line 
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**/
22const 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**/
39class CFSwitches
40{
41private:
42    bool switches [CFSwitchesMax];
43
44public:
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();
70EXTERN_INST_VAR CFSwitches cf_glob_switches;
71
72#endif /* ! INCL_CF_SWITCHES_H */
Note: See TracBrowser for help on using the repository browser.