/[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 238 by johnpye, Mon Jan 30 06:41:10 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  Variable::Variable(){  Variable::Variable(){
20      throw runtime_error("Can't create new Variable objects");      sim=NULL;
21        var=NULL;
22    
23        // default ctor
24  }  }
25    
26  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){
27      //cerr << "CREATED VARIABLE" << endl;      // copy ctor
     char *n=var_make_name(s,var);  
     name=n;  
     delete n;  
28  }  }
29    
30  Variable::~Variable(){  Variable::Variable(Simulation *sim, struct var_variable *var) : sim(sim), var(var){
31      //cerr << "DESTROYED VARIABLE" << endl;      if(var==NULL)throw runtime_error("Variable::Variable: var is NULL");
32  }  }
33    
34  const string &  const string
35  Variable::getName(){  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;      return name;
41  }  }

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

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