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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 132 by johnpye, Wed Dec 21 00:14:13 2005 UTC revision 237 by johnpye, Mon Jan 30 06:10:26 2006 UTC
# Line 3  Line 3 
3  using namespace std;  using namespace std;
4    
5  #include "variable.h"  #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(){  Variable::Variable(){
21      throw runtime_error("Can't create new Variable objects");      sim=NULL;
22        var=NULL;
23    
24        // default ctor
25  }  }
26    
27  Variable::Variable(slv_system_t s, struct var_variable *var) : s(s), var(var){  Variable::Variable(const Variable &old) : sim(old.sim), var(old.var){
28      //cerr << "CREATED VARIABLE" << endl;      // copy ctor
     char *n=var_make_name(s,var);  
     name=n;  
     delete n;  
29  }  }
30    
31  Variable::~Variable(){  Variable::Variable(Simulation *sim, struct var_variable *var) : sim(sim), var(var){
32      //cerr << "DESTROYED VARIABLE" << endl;      if(var==NULL)throw runtime_error("Variable::Variable: var is NULL");
33  }  }
34    
35  const string &  const string
36  Variable::getName(){  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;      return name;
42  }  }

Legend:
Removed from v.132  
changed lines
  Added in v.237

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