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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 237 - (hide annotations) (download) (as text)
Mon Jan 30 06:10:26 2006 UTC (13 years, 11 months 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 johnpye 132 #include <iostream>
2     #include <stdexcept>
3     using namespace std;
4    
5     #include "variable.h"
6 johnpye 237 #include "simulation.h"
7 johnpye 132
8 johnpye 237 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 johnpye 132 Variable::Variable(){
21 johnpye 237 sim=NULL;
22     var=NULL;
23    
24     // default ctor
25 johnpye 132 }
26    
27 johnpye 237 Variable::Variable(const Variable &old) : sim(old.sim), var(old.var){
28     // copy ctor
29 johnpye 132 }
30    
31 johnpye 237 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 johnpye 132 }
34    
35 johnpye 237 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 johnpye 132 return name;
42     }

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