source: git/factory/cf_switches.h @ 650f2d8

spielwiese
Last change on this file since 650f2d8 was 0349c20, checked in by Martin Lee <martinlee84@…>, 13 years ago
deleted unused cf_gcd_charp.cc, cfGEval.*, ffreval.* deleted factorization over Fp from fac_multivar.cc deleted some unused parameters git-svn-id: file:///usr/local/Singular/svn/trunk@14377 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id$ */
3
4#ifndef INCL_CF_SWITCHES_H
5#define INCL_CF_SWITCHES_H
6
7//{{{ docu
8//
9// cf_switches.h - header to cf_switches.cc.
10//
11//}}}
12
13#include <config.h>
14
15//{{{ const int CFSwitchesMax
16//{{{ docu
17//
18// const CFSwitchesMax - maximum number of switches.
19//
20//}}}
21const int CFSwitchesMax = 17;
22//}}}
23
24//{{{ class CFSwitches
25//{{{ docu
26//
27// class CFSwitches - manages boolean switches.
28//
29// An object of class `CFSwitches' is simply an array of booleans
30// with some comfortable access methods (`On()', `isOn()', etc.).
31// Each object may contain `CFSwitchesMax' switches.  When a new
32// object of type `CFSwitches' is created, all its switches are
33// turned off.
34//
35// Note: No range checking is done when accessing switches.
36//
37// switches: the switches
38//
39//}}}
40//{{{ inline method docu
41//
42// void On ( int s )
43// void Off ( int s )
44// bool isOn ( int s ) const
45// bool isOff ( int s ) const
46//
47// On(), Off() - switch `s' on or off, resp.
48//
49// isOn(), isOff() - return true iff `s' is on or off, resp.
50//
51//}}}
52class CFSwitches
53{
54private:
55    bool switches [CFSwitchesMax];
56
57public:
58    // constructors, destructors
59    CFSwitches ();
60    ~CFSwitches () {}
61
62    // selectors
63    void On ( int s ) { switches[s] = true; }
64    void Off ( int s ) { switches[s] = false; }
65    bool isOn ( int s ) const { return switches[s]; }
66    bool isOff ( int s ) const { return ! switches[s]; }
67};
68//}}}
69
70#endif /* ! INCL_CF_SWITCHES_H */
Note: See TracBrowser for help on using the repository browser.