Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
object.h
Go to the documentation of this file.
1 /*
2  * object.h - generic object class definitions
3  *
4  * Copyright (C) 2003, 2004, 2005, 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: object.h 1871 2013-03-06 12:53:05Z crobarcro $
22  *
23  */
24 
31 #ifndef __OBJECT_H__
32 #define __OBJECT_H__
33 
34 #define MCREATOR(val) \
35  val (); \
36  static struct define_t miscdef; \
37  static struct define_t * definition (void) { return &miscdef; }
38 
39 namespace qucs {
40 
41 class property;
42 class variable;
43 class vector;
44 
52 class object
53 {
54  public:
55  object ();
56  object (const char *);
57  object (const object &);
58  virtual ~object ();
59  object * getNext (void) { return next; }
60  void setNext (object * o) { next = o; }
61  object * getPrev (void) { return prev; }
62  void setPrev (object * o) { prev = o; }
63  void setName (const char *);
64  char * getName (void);
65  void addProperty (property *);
66  property * addProperty (const char *, const char *);
67  property * addProperty (const char *, nr_double_t);
68  property * addProperty (const char *, variable *);
69  void setProperty (const char *, char *);
70  void setProperty (const char *, nr_double_t);
71  void setScaledProperty (const char *, nr_double_t);
72  void setProperty (const char *, variable *);
73  vector * getPropertyVector (const char *);
74  char * getPropertyString (const char *);
75  char * getPropertyReference (const char *);
76  nr_double_t getPropertyDouble (const char *);
77  nr_double_t getScaledProperty (const char *);
78  int getPropertyInteger (const char *);
79  bool hasProperty (const char *);
80  bool isPropertyGiven (const char *);
81  void copyProperties (property *);
82  void deleteProperties (void);
83  int countProperties (void);
84  char * propertyList (void);
85 
86  private:
87  char * name;
88  object * next;
89  object * prev;
90  property * prop;
91  char * ptxt;
92 };
93 
94 } // namespace qucs
95 
96 #endif /* __OBJECT_H__ */
void setProperty(const char *, char *)
Definition: object.cpp:104
char * getPropertyReference(const char *)
Definition: object.cpp:167
nr_double_t getPropertyDouble(const char *)
Definition: object.cpp:176
int getPropertyInteger(const char *)
Definition: object.cpp:198
void setNext(object *o)
Definition: object.h:60
bool hasProperty(const char *)
Definition: object.cpp:206
object * next
Definition: object.h:88
nr_double_t getScaledProperty(const char *)
Definition: object.cpp:185
bool isPropertyGiven(const char *)
Definition: object.cpp:213
object * getNext(void)
Definition: object.h:59
void setScaledProperty(const char *, nr_double_t)
Definition: object.cpp:133
vector * getPropertyVector(const char *)
Definition: object.cpp:150
object * prev
Definition: object.h:89
int countProperties(void)
Definition: object.cpp:242
void setPrev(object *o)
Definition: object.h:62
void setName(const char *)
Definition: object.cpp:78
void deleteProperties(void)
Definition: object.cpp:232
void addProperty(property *)
Definition: object.cpp:89
generic object class.
Definition: object.h:52
property * prop
Definition: object.h:90
object * getPrev(void)
Definition: object.h:61
virtual ~object()
Definition: object.cpp:71
char * ptxt
Definition: object.h:91
char * propertyList(void)
Definition: object.cpp:249
char * getName(void)
Definition: object.cpp:84
char * name
Definition: object.h:87
char * getPropertyString(const char *)
Definition: object.cpp:159
void copyProperties(property *)
Definition: object.cpp:223