Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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$
22  *
23  */
24 
25 #ifndef __SWEEP_H__
26 #define __SWEEP_H__
27 
28 namespace qucs {
29 
30 enum sweep_type {
31  SWEEP_UNKNOWN = -1, // not yet defined
32  SWEEP_CONSTANT, // constant value
33  SWEEP_LINEAR, // linear
34  SWEEP_LOGARITHMIC, // logarithmic
35  SWEEP_LIST // list of values
36 };
37 
38 class object;
39 
40 class sweep : public object
41 {
42  public:
43  sweep ();
44  sweep (const char *);
45  sweep (sweep &);
46  ~sweep ();
47  int getSize (void) { return size; }
48  int getType (void) { return type; }
49  nr_double_t get (int);
50  nr_double_t next (void);
51  nr_double_t prev (void);
52  void set (int, nr_double_t);
53  void setSize (int);
54  char * toString (void);
55  void reverse (void);
56  void reset (void) { counter = 0; };
57  object * getParent (void) { return parent; }
58  void setParent (object * p) { parent = p; }
59 
60  protected:
61  int type;
62 
63  private:
64  nr_double_t * data;
65  int size;
66  char * txt;
67  int counter;
68  object * parent;
69 };
70 
71 class linsweep : public sweep
72 {
73  public:
74  linsweep ();
75  linsweep (const char *);
76  ~linsweep ();
77  void create (nr_double_t, nr_double_t, int);
78 };
79 
80 class logsweep : public sweep
81 {
82  public:
83  logsweep ();
84  logsweep (const char *);
85  ~logsweep ();
86  void create (nr_double_t, nr_double_t, int);
87 };
88 
89 class consweep : public sweep
90 {
91  public:
92  consweep ();
93  consweep (const char *);
94  ~consweep ();
95  void create (nr_double_t);
96 };
97 
98 class lstsweep : public sweep
99 {
100  public:
101  lstsweep ();
102  lstsweep (const char *);
103  ~lstsweep ();
104  void create (int);
105 };
106 
107 } // namespace qucs
108 
109 #endif /* __SWEEP_H__ */
int size
Definition: sweep.h:65
void setParent(object *p)
Definition: sweep.h:58
void create(nr_double_t, nr_double_t, int)
Definition: sweep.cpp:169
int getType(void)
Definition: sweep.h:48
int counter
Definition: sweep.h:67
sweep_type
Definition: sweep.h:30
void create(nr_double_t)
Definition: sweep.cpp:214
void reset(void)
Definition: sweep.h:56
int getSize(void)
Definition: sweep.h:47
generic object class.
Definition: object.h:52
void create(nr_double_t, nr_double_t, int)
Definition: sweep.cpp:192
int type
Definition: sweep.h:61
nr_double_t * data
Definition: sweep.h:64
void create(int)
Definition: sweep.cpp:236
void set(int, nr_double_t)
Definition: sweep.cpp:86
void setSize(int)
Definition: sweep.cpp:94
List int
Definition: parse_citi.y:183
nr_double_t prev(void)
Definition: sweep.cpp:151
nr_double_t next(void)
Definition: sweep.cpp:140
char * txt
Definition: sweep.h:66
object * getParent(void)
Definition: sweep.h:57
void reverse(void)
Definition: sweep.cpp:129
object * parent
Definition: sweep.h:68
char * toString(void)
Definition: sweep.cpp:110