/[ascend]/trunk/pygtk/interface/variable.cpp
ViewVC logotype

Contents of /trunk/pygtk/interface/variable.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 237 - (show annotations) (download) (as text)
Mon Jan 30 06:10:26 2006 UTC (14 years ago) by johnpye
File MIME type: text/x-c++src
File size: 857 byte(s)
Incidence matrix now reports the mouseover-ed variable on the console
1 #include <iostream>
2 #include <stdexcept>
3 using namespace std;
4
5 #include "variable.h"
6 #include "simulation.h"
7
8 extern "C"{
9 #include <utilities/ascConfig.h>
10 #include <utilities/ascMalloc.h>
11
12 #include <general/dstring.h>
13 #include <compiler/compiler.h>
14 #include <compiler/symtab.h>
15 #include <compiler/instance_enum.h>
16 #include <compiler/instance_io.h>
17
18 }
19
20 Variable::Variable(){
21 sim=NULL;
22 var=NULL;
23
24 // default ctor
25 }
26
27 Variable::Variable(const Variable &old) : sim(old.sim), var(old.var){
28 // copy ctor
29 }
30
31 Variable::Variable(Simulation *sim, struct var_variable *var) : sim(sim), var(var){
32 if(var==NULL)throw runtime_error("Variable::Variable: var is NULL");
33 }
34
35 const string
36 Variable::getName() const{
37 char *n = WriteInstanceNameString((struct Instance *)var_instance(var),sim->getModel().getInternalType());
38 string name = n;
39 ascfree(n);
40
41 return name;
42 }

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22