My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 1825 2011-03-11 20:42:14Z ela $
22  *
23  */
24 
25 #ifndef __OBJECT_H__
26 #define __OBJECT_H__
27 
28 #define MCREATOR(val) \
29  val (); \
30  static struct define_t miscdef; \
31  static struct define_t * definition (void) { return &miscdef; }
32 
33 class property;
34 class variable;
35 class vector;
36 
37 class object
38 {
39  public:
40  object ();
41  object (const char *);
42  object (const object &);
43  virtual ~object ();
44  object * getNext (void) { return next; }
45  void setNext (object * o) { next = o; }
46  object * getPrev (void) { return prev; }
47  void setPrev (object * o) { prev = o; }
48  void setName (const char *);
49  char * getName (void);
50  void addProperty (property *);
51  property * addProperty (const char *, const char *);
52  property * addProperty (const char *, nr_double_t);
53  property * addProperty (const char *, variable *);
54  void setProperty (const char *, char *);
55  void setProperty (const char *, nr_double_t);
56  void setScaledProperty (const char *, nr_double_t);
57  void setProperty (const char *, variable *);
58  vector * getPropertyVector (const char *);
59  char * getPropertyString (const char *);
60  char * getPropertyReference (const char *);
61  nr_double_t getPropertyDouble (const char *);
62  nr_double_t getScaledProperty (const char *);
63  int getPropertyInteger (const char *);
64  bool hasProperty (const char *);
65  bool isPropertyGiven (const char *);
66  void copyProperties (property *);
67  void deleteProperties (void);
68  int countProperties (void);
69  char * propertyList (void);
70 
71  private:
72  char * name;
73  object * next;
74  object * prev;
75  property * prop;
76  char * ptxt;
77 };
78 
79 #endif /* __OBJECT_H__ */