1 |
#ifndef SWIG_LIBRARY_H |
2 |
#define SWIG_LIBRARY_H |
3 |
|
4 |
#include <vector> |
5 |
#include <string> |
6 |
|
7 |
#include "type.h" |
8 |
#include "module.h" |
9 |
#include "symchar.h" |
10 |
#include "extmethod.h" |
11 |
|
12 |
/** |
13 |
Handles the loading of ASCEND a4c files into memory, then the |
14 |
listing of the contents of those loaded files. Creates output |
15 |
when loaded files contain errors, although a standardised |
16 |
method for reporting errors is desired for reporting back |
17 |
via SWIG. |
18 |
*/ |
19 |
class Library{ |
20 |
public: |
21 |
Library(std::string defaultpath=DEFAULT_ASCENDLIBRARY); |
22 |
~Library(); |
23 |
void load(const char *filename); |
24 |
void listModules(const int &module_type=0) const; |
25 |
Type &findType(SymChar name); |
26 |
std::vector<Module> getModules(); |
27 |
std::vector<Type> getModuleTypes(const Module&); |
28 |
|
29 |
// External Function library |
30 |
std::vector<ExtMethod> getExtMethods(); |
31 |
static void extMethodTraverse(void *,void *); |
32 |
void appendToExtMethodVector(void *); |
33 |
|
34 |
// Destroy types from the library |
35 |
void clear(); |
36 |
|
37 |
private: |
38 |
std::vector<ExtMethod> extmethod_vector; |
39 |
|
40 |
static void displayModule(void *m); |
41 |
}; |
42 |
|
43 |
#endif |
44 |
|