My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
net.h
Go to the documentation of this file.
1 /*
2  * net.h - net class definitions
3  *
4  * Copyright (C) 2003, 2004, 2005, 2006, 2007 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: net.h 1825 2011-03-11 20:42:14Z ela $
22  *
23  */
24 
25 #ifndef __NET_H__
26 #define __NET_H__
27 
28 class circuit;
29 class node;
30 class nodelist;
31 class nodeset;
32 class analysis;
33 class dataset;
34 class environment;
35 template <class type_t> class ptrlist;
36 
37 class net : public object
38 {
39  public:
40  net ();
41  net (const char *);
42  net (net &);
43  ~net ();
44  circuit * getRoot (void) { return root; }
45  void setRoot (circuit * c) { root = c; }
46  void insertCircuit (circuit *);
47  void removeCircuit (circuit *, int dropping = 1);
48  int containsCircuit (circuit *);
49  int checkCircuitChain (void);
50  void list (void);
51  void reducedCircuit (circuit *);
54  void insertedCircuit (circuit *);
55  void insertedNode (node *);
56  void insertAnalysis (analysis *);
57  void removeAnalysis (analysis *);
58  dataset * runAnalysis (int &);
59  void getDroppedCircuits (nodelist * nodes = NULL);
60  void deleteUnusedCircuits (nodelist * nodes = NULL);
61  int getPorts (void) { return nPorts; }
62  int getReduced (void) { return reduced; }
63  void setReduced (int r) { reduced = r; }
64  int getVoltageSources (void) { return nSources; }
65  void setVoltageSources (int n) { nSources = n; }
66  analysis * findAnalysis (char *);
67  analysis * findAnalysis (int);
68  analysis * findSecondOrder (void);
70  char * getChild (analysis *);
71  void orderAnalysis (void);
74  void sortChildAnalyses (analysis *);
75  int containsAnalysis (analysis *, int);
76  environment * getEnv (void) { return env; }
77  void setEnv (environment * e) { env = e; }
78  int countPorts (void);
79  int countNodes (void);
80  int isNonLinear (void);
81  void addNodeset (nodeset *);
82  void delNodeset (void);
83  nodeset * getNodeset (void) { return nset; }
84  void setSrcFactor (nr_double_t f) { srcFactor = f; }
85  nr_double_t getSrcFactor (void) { return srcFactor; }
86 
87  private:
88  nodeset * nset;
89  circuit * drop;
90  circuit * root;
91  ptrlist<analysis> * actions;
92  ptrlist<analysis> * orgacts;
93  environment * env;
94  int nPorts;
95  int nSources;
96  int nCircuits;
97  int reduced;
98  int inserted;
99  int insertedNodes;
100  nr_double_t srcFactor;
101 };
102 
103 #endif /* __NET_H__ */