My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sweep.h
Go to the documentation of this file.
1 /*
2  * sweep.h - variable sweep class definitions
3  *
4  * Copyright (C) 2004, 2008 Stefan Jahn <stefan@lkcc.org>
5  *
6  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this package; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * $Id: sweep.h 1825 2011-03-11 20:42:14Z ela $
22  *
23  */
24 
25 #ifndef __SWEEP_H__
26 #define __SWEEP_H__
27 
28 enum sweep_type {
29  SWEEP_UNKNOWN = -1, // not yet defined
30  SWEEP_CONSTANT, // constant value
31  SWEEP_LINEAR, // linear
32  SWEEP_LOGARITHMIC, // logarithmic
33  SWEEP_LIST // list of values
34 };
35 
36 class object;
37 
38 class sweep : public object
39 {
40  public:
41  sweep ();
42  sweep (const char *);
43  sweep (sweep &);
44  ~sweep ();
45  int getSize (void) { return size; }
46  int getType (void) { return type; }
47  nr_double_t get (int);
48  nr_double_t next (void);
49  nr_double_t prev (void);
50  void set (int, nr_double_t);
51  void setSize (int);
52  char * toString (void);
53  void reverse (void);
54  void reset (void) { counter = 0; };
55  object * getParent (void) { return parent; }
56  void setParent (object * p) { parent = p; }
57 
58  protected:
59  int type;
60 
61  private:
62  nr_double_t * data;
63  int size;
64  char * txt;
65  int counter;
66  object * parent;
67 };
68 
69 class linsweep : public sweep
70 {
71  public:
72  linsweep ();
73  linsweep (const char *);
74  ~linsweep ();
75  void create (nr_double_t, nr_double_t, int);
76 };
77 
78 class logsweep : public sweep
79 {
80  public:
81  logsweep ();
82  logsweep (const char *);
83  ~logsweep ();
84  void create (nr_double_t, nr_double_t, int);
85 };
86 
87 class consweep : public sweep
88 {
89  public:
90  consweep ();
91  consweep (const char *);
92  ~consweep ();
93  void create (nr_double_t);
94 };
95 
96 class lstsweep : public sweep
97 {
98  public:
99  lstsweep ();
100  lstsweep (const char *);
101  ~lstsweep ();
102  void create (int);
103 };
104 
105 #endif /* __SWEEP_H__ */