1 #ifndef __YAFSYSTEM_H
2 #define __YAFSYSTEM_H
3 
4 #include <yafray_constants.h>
5 
6 #ifdef WIN32
7 	#include <io.h>
8 	#include <windows.h>
9 #endif
10 
11 #include <list>
12 #include <string>
13 
14 __BEGIN_YAFRAY
15 
16 class YAFRAYCORE_EXPORT dynamicLoadedLibrary_t
17 {
18 	public:
19 	  dynamicLoadedLibrary_t();
20 	  dynamicLoadedLibrary_t(const std::string &library);
21 	  dynamicLoadedLibrary_t(const dynamicLoadedLibrary_t &src);
22 	  ~dynamicLoadedLibrary_t();
23 
24 	  bool isOpen();
25 	  void* getSymbol(const char *name);
26 
27 	protected:
28 
29 	  void open(const std::string &library);
30 	  void close();
addReference()31   	void addReference() { (*refcount)++; };
removeReference()32   	void removeReference() { (*refcount)--; };
isUsed()33 	bool isUsed()const {return ((*refcount)>0);};
34 
35 
36 	int *refcount;
37 #ifdef WIN32
38 	HINSTANCE handle;
39 #else
40 	void *handle;
41 #endif
42 };
43 
44 __END_YAFRAY
45 
46 #endif
47