diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-04-01 20:42:16 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-04-01 20:42:16 +0000 |
commit | f8c70c81e385fd549756b4f660b4b6860a3e913c (patch) | |
tree | fe040c2fb9621655f7389ff0ddf6c55c66ce536a /cpp/include/Ice/DynamicLibrary.h | |
parent | initial check-in (diff) | |
download | ice-f8c70c81e385fd549756b4f660b4b6860a3e913c.tar.bz2 ice-f8c70c81e385fd549756b4f660b4b6860a3e913c.tar.xz ice-f8c70c81e385fd549756b4f660b4b6860a3e913c.zip |
adding DynamicLibrary
Diffstat (limited to 'cpp/include/Ice/DynamicLibrary.h')
-rw-r--r-- | cpp/include/Ice/DynamicLibrary.h | 52 |
1 files changed, 52 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 |