1 | /* |
---|
2 | * ---------------------------------------------------------------------- |
---|
3 | * INTERFACE: Common Rappture Dictionary Header |
---|
4 | * |
---|
5 | * ====================================================================== |
---|
6 | * AUTHOR: Derrick S. Kearney, Purdue University |
---|
7 | * Copyright (c) 2004-2012 HUBzero Foundation, LLC |
---|
8 | * |
---|
9 | * See the file "license.terms" for information on usage and |
---|
10 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
11 | * ====================================================================== |
---|
12 | */ |
---|
13 | |
---|
14 | #ifndef _RpBINDINGS_DICT_H |
---|
15 | #define _RpBINDINGS_DICT_H |
---|
16 | |
---|
17 | #include "RpDict.h" |
---|
18 | #include "RpUnits.h" |
---|
19 | |
---|
20 | #ifdef __cplusplus |
---|
21 | extern "C" { |
---|
22 | #endif |
---|
23 | |
---|
24 | // forward declarations so we can compile the object file |
---|
25 | class RpLibrary; |
---|
26 | /* |
---|
27 | class RpUnits; |
---|
28 | */ |
---|
29 | |
---|
30 | #define DICT_TEMPLATE_L <long,RpLibrary*> |
---|
31 | #define DICT_TEMPLATE_U <long,std::string> |
---|
32 | #define DICT_TEMPLATE_V <size_t,void*> |
---|
33 | |
---|
34 | // global declaration of library and units dictionaries |
---|
35 | // for languages that cannot return rappture objects. |
---|
36 | // (fortran, matlab, ...) |
---|
37 | |
---|
38 | extern RpDict DICT_TEMPLATE_L ObjDict_Lib; |
---|
39 | extern RpDict DICT_TEMPLATE_U ObjDictUnits; |
---|
40 | extern RpDict DICT_TEMPLATE_V ObjDict_Void; |
---|
41 | |
---|
42 | |
---|
43 | int storeObject_Lib(RpLibrary* objectName, int key=0); |
---|
44 | int storeObject_UnitsStr(std::string objectName); |
---|
45 | size_t storeObject_Void(void* objectName, size_t key=0); |
---|
46 | |
---|
47 | RpLibrary* getObject_Lib(int objKey); |
---|
48 | const RpUnits* getObject_UnitsStr(int objKey); |
---|
49 | void* getObject_Void(size_t objKey); |
---|
50 | |
---|
51 | void cleanLibDict(); |
---|
52 | void cleanUnitsDict(); |
---|
53 | void cleanVoidDict(); |
---|
54 | |
---|
55 | #ifdef __cplusplus |
---|
56 | } |
---|
57 | #endif |
---|
58 | |
---|
59 | #endif // _RpBINDINGS_DICT_H |
---|