1 |
/* ASCEND modelling environment |
2 |
Copyright (C) 2006 Carnegie Mellon University |
3 |
|
4 |
This program is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
6 |
the Free Software Foundation; either version 2, or (at your option) |
7 |
any later version. |
8 |
|
9 |
This program is distributed in the hope that it will be useful, |
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
GNU General Public License for more details. |
13 |
|
14 |
You should have received a copy of the GNU General Public License |
15 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 |
*/ |
17 |
|
18 |
#ifndef ASCXX_LIBRARY_H |
19 |
#define ASCXX_LIBRARY_H |
20 |
|
21 |
#include "extmethod.h" |
22 |
#include "type.h" |
23 |
#include "module.h" |
24 |
#include "symchar.h" |
25 |
#include "annotation.h" |
26 |
#include "units.h" |
27 |
|
28 |
#include <vector> |
29 |
#include <string> |
30 |
#include <set> |
31 |
|
32 |
/** |
33 |
Handles the loading of ASCEND a4c files into memory, then the |
34 |
listing of the contents of those loaded files. Creates output |
35 |
when loaded files contain errors, although a standardised |
36 |
method for reporting errors is desired for reporting back |
37 |
via SWIG. |
38 |
*/ |
39 |
class Library{ |
40 |
public: |
41 |
Library(const char *defaultpath=NULL); |
42 |
~Library(); |
43 |
|
44 |
void load(const char *filename); |
45 |
void loadString(const char *str, const char *nameprefix); |
46 |
static const char *getLoadErrorMessage(int status); |
47 |
|
48 |
void listModules(const int module_type=0); |
49 |
Type &findType(const SymChar &nametofind); |
50 |
std::vector<Module> getModules(const int module_type=0); |
51 |
std::vector<Type> getModuleTypes(const Module&); |
52 |
|
53 |
// External Function library |
54 |
std::vector<ExtMethod> getExtMethods(); |
55 |
static void extMethodTraverse(void *,void *); |
56 |
void appendToExtMethodVector(void *); |
57 |
|
58 |
// Destroy types from the library |
59 |
void clear(); |
60 |
|
61 |
AnnotationDatabase getAnnotationDatabase(); |
62 |
|
63 |
/// get a listing of all units available in the library |
64 |
std::vector<UnitsM> getUnits() const; |
65 |
std::set<Type> getRealAtomTypes() const; |
66 |
|
67 |
private: |
68 |
std::vector<ExtMethod> extmethod_vector; |
69 |
|
70 |
}; |
71 |
|
72 |
#endif |