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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 238 - (show 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 #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 Variable::Variable(){
20 sim=NULL;
21 var=NULL;
22
23 // default ctor
24 }
25
26 Variable::Variable(const Variable &old) : sim(old.sim), var(old.var){
27 // copy ctor
28 }
29
30 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 }
33
34 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 return name;
41 }

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