My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
property.h
Go to the documentation of this file.
1 /*
2  * property.h - generic property class definitions
3  *
4  * Copyright (C) 2003, 2004, 2006, 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: property.h 1825 2011-03-11 20:42:14Z ela $
22  *
23  */
24 
25 #ifndef __PROPERTY_H__
26 #define __PROPERTY_H__
27 
28 class variable;
29 class vector;
30 
37 };
38 
39 class property
40 {
41  public:
42  property ();
43  property (const char *);
44  property (const char *, const char *);
45  property (const char *, nr_double_t);
46  property (const char *, variable *);
47  property (const property &);
48  virtual ~property ();
49  property * getNext (void) { return next; }
50  void setNext (property * p) { next = p; }
51  void setName (char *);
52  char * getName (void);
53  vector * getVector (void);
54  nr_double_t getDouble (void);
55  int getInteger (void);
56  char * getString (void);
57  char * getReference (void);
58  void set (nr_double_t);
59  void set (int);
60  void set (char *);
61  void set (variable *);
62  property * findProperty (const char *);
63  char * toString (void);
64  bool isDefault (void) { return def; }
65  void setDefault (bool d) { def = d; }
66 
67  private:
68  bool def;
69  int type;
70  char * name;
71  char * str;
72  char * txt;
73  nr_double_t value;
74  variable * var;
75  property * next;
76 };
77 
78 #endif /* __PROPERTY_H__ */