Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
environment.h
Go to the documentation of this file.
1 /*
2  * environment.h - variable environment class definitions
3  *
4  * Copyright (C) 2004, 2006, 2007, 2009 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 
31 #include "equation.h"
32 
33 #ifndef __ENVIRONMENT_H__
34 #define __ENVIRONMENT_H__
35 
36 namespace qucs {
37 
38 class variable;
39 class checker;
40 class solver;
41 class dataset;
42 template <class type_t> class ptrlist;
43 
52 {
53  public:
54  environment ();
55  environment (const char *);
56  environment (const environment &);
57  virtual ~environment ();
58  void copy (const environment &);
59  void setName (char *);
60  char * getName (void);
61  void print (bool all = false);
62  void setDefinitions (struct definition_t * d) { defs = d; }
63  struct definition_t * getDefinitions (void) { return defs; }
64 
65  // variable specific functionality
66  void copyVariables (variable *);
67  void deleteVariables (void);
68  void addVariable (variable *, bool pass = true);
69  variable * getVariable (char *);
70 
71  // equation specific functionality
72  void setChecker (eqn::checker * c) { checkee = c; }
73  eqn::checker * getChecker (void) { return checkee; }
74  void setSolver (eqn::solver * s) { solvee = s; }
75  eqn::solver * getSolver (void) { return solvee; }
76  int equationChecker (int noundefined = 1);
77  int equationSolver (dataset *);
78  int runSolver (void);
79  void equationSolver (void);
80 
81  // subcircuit specific
82  qucs::vector getVector (char *);
83  void setDoubleConstant (char *, nr_double_t);
84  nr_double_t getDoubleConstant (char *);
85  void setDouble (char *, nr_double_t);
86  nr_double_t getDouble (char *);
87  void setDoubleReference (char *, char *);
88  char * getDoubleReference (char *);
90  void passConstants (void);
91  void fetchConstants (void);
92  variable * findValue (char *);
93  void setValue (char *, eqn::constant *);
94  void saveResults (void);
95 
96  // children functionality
97  void delChild (environment *);
98  void addChild (environment *);
99 
100  private:
101  char * name;
103  eqn::checker * checkee;
104  eqn::solver * solvee;
105  ptrlist<environment> * children;
106  bool iscopy;
107  struct definition_t * defs;
108 };
109 
110 } // namespace qucs
111 
112 #endif /* __ENVIRONMENT_H__ */
void setChecker(eqn::checker *c)
Definition: environment.h:72
void fetchConstants(void)
void setSolver(eqn::solver *s)
Definition: environment.h:74
void delChild(environment *)
variable * findValue(char *)
void setDefinitions(struct definition_t *d)
Definition: environment.h:62
void updateReferences(environment *)
void setValue(char *, eqn::constant *)
nr_double_t getDoubleConstant(char *)
void copyVariables(variable *)
eqn::checker * getChecker(void)
Definition: environment.h:73
void deleteVariables(void)
Houses the settings for netlist evaluation.
Definition: environment.h:51
void equationSolver(void)
eqn::checker * checkee
Definition: environment.h:103
void print(bool all=false)
void setName(char *)
void setDoubleConstant(char *, nr_double_t)
char * getDoubleReference(char *)
qucs::vector getVector(char *)
virtual ~environment()
Definition: environment.cpp:94
eqn::solver * solvee
Definition: environment.h:104
int equationChecker(int noundefined=1)
char * getName(void)
void setDouble(char *, nr_double_t)
eqn::solver * getSolver(void)
Definition: environment.h:75
struct definition_t * getDefinitions(void)
Definition: environment.h:63
void addChild(environment *)
nr_double_t getDouble(char *)
void copy(const environment &)
Definition: environment.cpp:80
void passConstants(void)
void setDoubleReference(char *, char *)
struct definition_t * defs
Definition: environment.h:107
variable * root
Definition: environment.h:102
void saveResults(void)
variable * getVariable(char *)
ptrlist< environment > * children
Definition: environment.h:105
void addVariable(variable *, bool pass=true)