/[ascend]/trunk/pygtk/interface/extmethod.cpp
ViewVC logotype

Contents of /trunk/pygtk/interface/extmethod.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 212 - (show annotations) (download) (as text)
Tue Jan 24 13:20:47 2006 UTC (14 years, 2 months ago) by johnpye
File MIME type: text/x-c++src
File size: 1058 byte(s)
Changing nomenclature from ExtFn to ExtMethod
1 #include <stdexcept>
2 using namespace std;
3
4 #include "extmethod.h"
5
6 /*--- WARNING ---
7 In the C++ interface I'm trying to make the nomenclature
8 a bit more systematic. 'ExternalFunc' as listed end up
9 being things that you can call like 'asc_free_all_vars' --
10 they are effectively externally-defined methods on ASCEND
11 models, so I'll call then 'external methods'.
12
13 Meanwhile, external relations I will call 'ExtRelation'.
14
15 External functions, if ever implemented, will be for
16 functions like 'sin', 'exp', etc.
17 */
18
19 ExtMethod::ExtMethod(const struct ExternalFunc *e) : e(e) {
20 // nothing else
21 }
22
23 ExtMethod::ExtMethod(const ExtMethod &old) : e(old.e) {
24 // nothing else
25 }
26
27 ExtMethod::ExtMethod(){
28 throw runtime_error("Can't create empty ExtMethod");
29 }
30
31 const char *
32 ExtMethod::getName() const{
33 return ExternalFuncName(e);
34 }
35
36 const char *
37 ExtMethod::getHelp() const{
38 return e->help;
39 }
40
41 const unsigned long
42 ExtMethod::getNumInputs() const{
43 return NumberInputArgs(e);
44 }
45
46 const unsigned long
47 ExtMethod::getNumOutputs() const{
48 return NumberOutputArgs(e);
49 }

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