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 |
} |