Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nodelist.h
Go to the documentation of this file.
1 /*
2  * nodelist.h - node list class definitions
3  *
4  * Copyright (C) 2003, 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 __NODELIST_H__
26 #define __NODELIST_H__
27 
28 namespace qucs {
29 
30 class node;
31 class net;
32 
33 struct nodelist_t {
34  int n;
35  char * name;
36  node ** nodes;
37  int nNodes;
38  int nAlloc;
39  int internal;
40  struct nodelist_t * next;
41 };
42 
43 class nodelist
44 {
45  public:
46  nodelist ();
47  nodelist (net *);
48  nodelist (const nodelist &);
49  ~nodelist ();
50  void add (char *, int intern = 0);
51  void append (char *, int intern = 0);
52  struct nodelist_t * getRoot (void) { return root; }
53  int length (void);
54  int contains (char *);
55  int getNodeNr (char *);
56  char * get (int);
57  int isInternal (int);
58  void addCircuitNode (struct nodelist_t *, node *);
59  void assignNodes (void);
60  void print (void);
61  struct nodelist_t * getNode (int);
62  struct nodelist_t * getLastNode (void);
63  char * getNodeString (int);
64  void sort (void);
65  struct nodelist_t * copy (struct nodelist_t *);
66  void add (struct nodelist_t *);
67  void append (struct nodelist_t *);
68  void release (struct nodelist_t *);
69  void remove (char *);
70  void remove (struct nodelist_t *, int keep = 0);
71  void remove (circuit *);
72  struct nodelist_t * create (char *, int);
73  void insert (struct nodelist_t *);
74  void insert (circuit *);
75  void delCircuitNode (struct nodelist_t *, node *);
76  void sortedNodes (node **, node **);
77  struct nodelist_t * getNode (char *);
78 
79  private:
80  struct nodelist_t ** narray;
81  struct nodelist_t * root;
82  struct nodelist_t * last;
83  char * txt;
84  int sorting;
85 };
86 
87 } // namespace qucs
88 
89 #endif /* __NODELIST_H__ */
void addCircuitNode(struct nodelist_t *, node *)
Definition: nodelist.cpp:295
char * txt
Definition: nodelist.h:83
struct nodelist_t * getRoot(void)
Definition: nodelist.h:52
int getNodeNr(char *)
Definition: nodelist.cpp:210
void assignNodes(void)
Definition: nodelist.cpp:271
void sortedNodes(node **, node **)
Definition: nodelist.cpp:484
void release(struct nodelist_t *)
Definition: nodelist.cpp:186
struct nodelist_t * getNode(int)
Definition: nodelist.cpp:233
void sort(void)
Definition: nodelist.cpp:451
struct nodelist_t * getLastNode(void)
Definition: nodelist.cpp:266
void delCircuitNode(struct nodelist_t *, node *)
Definition: nodelist.cpp:312
int contains(char *)
Definition: nodelist.cpp:200
base class for qucs circuit elements.
Definition: circuit.h:92
struct nodelist_t * root
Definition: nodelist.h:81
node ** nodes
Definition: nodelist.h:36
struct nodelist_t * copy(struct nodelist_t *)
Definition: nodelist.cpp:111
void append(char *, int intern=0)
Definition: nodelist.cpp:147
struct nodelist_t * next
Definition: nodelist.h:40
int length(void)
Definition: nodelist.cpp:193
struct nodelist_t * last
Definition: nodelist.h:82
Definition: net.h:39
List int
Definition: parse_citi.y:183
int isInternal(int)
Definition: nodelist.cpp:227
node
void insert(struct nodelist_t *)
Definition: nodelist.cpp:358
struct nodelist_t ** narray
Definition: nodelist.h:80
struct nodelist_t * create(char *, int)
Definition: nodelist.cpp:131
void add(char *, int intern=0)
Definition: nodelist.cpp:126
void print(void)
char * getNodeString(int)
Definition: nodelist.cpp:247