summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/Ice/DynamicLibrary.h52
-rw-r--r--cpp/include/Ice/DynamicLibraryF.h26
2 files changed, 78 insertions, 0 deletions
diff --git a/cpp/include/Ice/DynamicLibrary.h b/cpp/include/Ice/DynamicLibrary.h
new file mode 100644
index 00000000000..a8f3f3f38ed
--- /dev/null
+++ b/cpp/include/Ice/DynamicLibrary.h
@@ -0,0 +1,52 @@
+// **********************************************************************
+//
+// Copyright (c) 2002
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#ifndef ICE_DYNAMIC_LIBRARY_H
+#define ICE_DYNAMIC_LIBRARY_H
+
+#include <Ice/DynamicLibraryF.h>
+#include <IceUtil/Shared.h>
+
+namespace IceInternal
+{
+
+class DynamicLibrary : public ::IceUtil::Shared
+{
+public:
+
+ DynamicLibrary();
+ ~DynamicLibrary();
+
+ bool load(const std::string&);
+
+#ifdef WIN32
+ typedef FARPROC symbol_type;
+#else
+ typedef void* symbol_type;
+#endif
+
+ symbol_type getSymbol(const std::string&); // Returns 0 if no match found
+
+ const std::string& getErrorMessage() const; // Error message for last failure
+
+private:
+
+#ifdef WIN32
+ HINSTANCE _hnd;
+#else
+ void* _hnd;
+#endif
+
+ std::string _err;
+};
+
+}
+
+#endif
diff --git a/cpp/include/Ice/DynamicLibraryF.h b/cpp/include/Ice/DynamicLibraryF.h
new file mode 100644
index 00000000000..56c8e503d95
--- /dev/null
+++ b/cpp/include/Ice/DynamicLibraryF.h
@@ -0,0 +1,26 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#ifndef ICE_DYNAMIC_LIBRARY_F_H
+#define ICE_DYNAMIC_LIBRARY_F_H
+
+#include <Ice/Handle.h>
+
+namespace IceInternal
+{
+
+class DynamicLibrary;
+ICE_API void incRef(DynamicLibrary*);
+ICE_API void decRef(DynamicLibrary*);
+typedef Handle<DynamicLibrary> DynamicLibraryPtr;
+
+}
+
+#endif