/[ascend]/trunk/pygtk/relation.cpp
ViewVC logotype

Contents of /trunk/pygtk/relation.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations) (download) (as text)
Mon Apr 24 02:23:08 2006 UTC (14 years, 1 month ago) by johnpye
File MIME type: text/x-c++src
File size: 913 byte(s)
Removed 'interface' directory in trunk/pygtk/interface (moved everything up a level)
Made corresponding changes to SCons* and spec files.
1 #include <iostream>
2 #include <stdexcept>
3 using namespace std;
4
5 #include "relation.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 Relation::Relation(){
21 sim=NULL;
22 rel=NULL;
23 }
24
25 Relation::Relation(const Relation &old) : sim(old.sim), rel(old.rel){
26 // copy ctor
27 }
28
29 Relation::Relation(Simulation *sim, struct rel_relation *rel) : sim(sim), rel(rel){
30 if(rel==NULL)throw runtime_error("Relation::Relation: rel is NULL");
31 }
32
33 const string
34 Relation::getName() const{
35 char *n = WriteInstanceNameString((struct Instance *)rel_instance(rel),sim->getModel().getInternalType());
36 string name = n;
37 ascfree(n);
38
39 return name;
40 }
41
42 const double
43 Relation::getResidual() const{
44 return rel_residual(rel);
45 }

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