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

Diff of /trunk/pygtk/type.cpp

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

revision 1289 by johnpye, Tue Jan 23 04:25:51 2007 UTC revision 1290 by johnpye, Mon Feb 26 04:54:45 2007 UTC
# Line 16  extern "C"{ Line 16  extern "C"{
16  #include <compiler/dimen.h>  #include <compiler/dimen.h>
17  #include <compiler/symtab.h>  #include <compiler/symtab.h>
18  #include <compiler/instance_io.h>  #include <compiler/instance_io.h>
19  #include <compiler/instantiate.h>  #include <compiler/type_desc.h>
20  #include <compiler/bintoken.h>  #include <compiler/bintoken.h>
21  #include <linear/mtx.h>  #include <linear/mtx.h>
22  #include <solver/calc.h>  #include <solver/calc.h>
# Line 177  Type::getMethods() const{ Line 177  Type::getMethods() const{
177    
178  Method  Method
179  Type::getMethod(const SymChar &name) const{  Type::getMethod(const SymChar &name) const{
180      struct gl_list_t *l = GetInitializationList(getInternalType());      if(GetBaseType(t)!=model_type){
     if(l==NULL){  
181          stringstream ss;          stringstream ss;
182          ss << "No methods present in type '" << getName() << "'";          ss << "Type '" << getName() << "' is not a MODEL";
183          throw runtime_error(ss.str());          throw runtime_error(ss.str());
184      }      }
185    
186      struct InitProcedure *m;      struct InitProcedure *m;
187      m = SearchProcList(l,name.getInternalType());      m = FindMethod(t,name.getInternalType());
188    
189      if(m==NULL){      if(m==NULL){
190          stringstream ss;          stringstream ss;
191          ss << "No method named '" << name << "' in type '" << getName() << "'";          ss << "No method named '" << name << "' in type '" << getName() << "'";
192          throw runtime_error(ss.str());          throw runtime_error(ss.str());
193          return NULL;          return NULL;
194      }      }
195    
196      return Method(m);      return Method(m);
197  }    }  
198    

Legend:
Removed from v.1289  
changed lines
  Added in v.1290

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