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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 238 - (hide annotations) (download) (as text)
Mon Jan 30 06:41:10 2006 UTC (14 years, 2 months ago) by johnpye
File MIME type: text/x-c++src
File size: 856 byte(s)
Added reporting of relation name to console onmouseover of incidence matrix
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 johnpye 132 Variable::Variable(){
20 johnpye 237 sim=NULL;
21     var=NULL;
22    
23     // default ctor
24 johnpye 132 }
25    
26 johnpye 237 Variable::Variable(const Variable &old) : sim(old.sim), var(old.var){
27     // copy ctor
28 johnpye 132 }
29    
30 johnpye 237 Variable::Variable(Simulation *sim, struct var_variable *var) : sim(sim), var(var){
31     if(var==NULL)throw runtime_error("Variable::Variable: var is NULL");
32 johnpye 132 }
33    
34 johnpye 237 const string
35     Variable::getName() const{
36     char *n = WriteInstanceNameString((struct Instance *)var_instance(var),sim->getModel().getInternalType());
37     string name = n;
38     ascfree(n);
39    
40 johnpye 132 return name;
41     }

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