Qucs-core
0.0.19
|
00001 /* 00002 * net.h - net class definitions 00003 * 00004 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Stefan Jahn <stefan@lkcc.org> 00005 * 00006 * This is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2, or (at your option) 00009 * any later version. 00010 * 00011 * This software is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this package; see the file COPYING. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 * $Id$ 00022 * 00023 */ 00024 00025 #ifndef __NET_H__ 00026 #define __NET_H__ 00027 00028 #include <string> 00029 #include "ptrlist.h" 00030 00031 namespace qucs { 00032 00033 class circuit; 00034 class node; 00035 class nodelist; 00036 class nodeset; 00037 class analysis; 00038 class dataset; 00039 class environment; 00040 00041 00042 class net : public object 00043 { 00044 public: 00045 net (); 00046 net (const std::string &); 00047 net (net &); 00048 ~net (); 00049 circuit * getRoot (void) { return root; } 00050 void setRoot (circuit * c) { root = c; } 00051 void insertCircuit (circuit *); 00052 void removeCircuit (circuit *, int dropping = 1); 00053 int containsCircuit (circuit *); 00054 int checkCircuitChain (void); 00055 void list (void); 00056 void reducedCircuit (circuit *); 00057 node * findConnectedNode (node *); 00058 node * findConnectedCircuitNode (node *); 00059 void insertedCircuit (circuit *); 00060 void insertedNode (node *); 00061 void insertAnalysis (analysis *); 00062 void removeAnalysis (analysis *); 00063 dataset * runAnalysis (int &); 00064 void getDroppedCircuits (nodelist * nodes = NULL); 00065 void deleteUnusedCircuits (nodelist * nodes = NULL); 00066 int getPorts (void) { return nPorts; } 00067 int getReduced (void) { return reduced; } 00068 void setReduced (int r) { reduced = r; } 00069 int getVoltageSources (void) { return nSources; } 00070 void setVoltageSources (int n) { nSources = n; } 00071 analysis * findAnalysis (const std::string &) const; 00072 analysis * findAnalysis (int); 00073 analysis * findSecondOrder (void); 00074 analysis * getChildAnalysis (analysis *); 00075 const char * getChild (analysis *) const; 00076 void orderAnalysis (void); 00077 analysis * findLastOrder (analysis *); 00078 ptrlist<analysis> * findLastOrderChildren (analysis *); 00079 void sortChildAnalyses (analysis *); 00080 int containsAnalysis (analysis *, int); 00081 environment * getEnv (void) { return env; } 00082 void setEnv (environment * e) { env = e; } 00083 int countPorts (void); 00084 int countNodes (void); 00085 int isNonLinear (void); 00086 void addNodeset (nodeset *); 00087 void delNodeset (void); 00088 nodeset * getNodeset (void) { return nset; } 00089 void setSrcFactor (nr_double_t f) { srcFactor = f; } 00090 nr_double_t getSrcFactor (void) { return srcFactor; } 00091 void setActionNetAll(net *); 00092 00093 private: 00094 nodeset * nset; 00095 circuit * drop; 00096 circuit * root; 00097 ptrlist<analysis> * actions; 00098 ptrlist<analysis> * orgacts; 00099 environment * env; 00100 int nPorts; 00101 int nSources; 00102 int nCircuits; 00103 int reduced; 00104 int inserted; 00105 int insertedNodes; 00106 nr_double_t srcFactor; 00107 }; 00108 00109 } // namespace qucs 00110 00111 #endif /* __NET_H__ */