/[ascend]/trunk/ascxx/method.cpp
ViewVC logotype

Contents of /trunk/ascxx/method.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2329 - (show annotations) (download) (as text)
Wed Dec 22 12:52:47 2010 UTC (7 years, 11 months ago) by jpye
File MIME type: text/x-c++src
File size: 878 byte(s)
Suppressing some console output.
Added test case that current crashes ASCEND/IPOPT with a memory error.
Issue with library.cpp not containing any way to free libascend memory.
1 #include <iostream>
2 #include <stdexcept>
3 using namespace std;
4
5 #include "method.h"
6
7 Method::Method() : initproc(NULL){
8 // cerr << "EMPTY METHOD CREATED" << endl;
9 }
10
11 Method::Method(const Method &old) : initproc(old.initproc){
12 // nothing else
13 }
14
15 Method::Method(struct InitProcedure *initproc) : initproc(initproc){
16 //cerr << "CREATED METHOD, name = " << SCP( initproc->name ) << "..."<< endl;
17 }
18
19 Method::~Method(){
20 //cerr << "DESTROYED METHOD" << endl;
21 }
22
23 struct InitProcedure *
24 Method::getInternalType() const{
25 if(initproc==NULL)throw runtime_error("NULL initproc value");
26 return initproc;
27 }
28
29 const char*
30 Method::getName() const{
31 if(initproc==NULL)throw runtime_error("NULL initproc value");
32 return SCP( ProcName(initproc) );
33 }
34
35 SymChar
36 Method::getSym() const{
37 /// @TODO this is not efficient. couldn't make it work the right way though...
38 return SymChar(getName());
39 }

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