diff options
Diffstat (limited to 'ace/DLL.h')
-rw-r--r-- | ace/DLL.h | 99 |
1 files changed, 31 insertions, 68 deletions
diff --git a/ace/DLL.h b/ace/DLL.h index 022521ae6a7..3554b558542 100644 --- a/ace/DLL.h +++ b/ace/DLL.h @@ -1,4 +1,4 @@ -// -*- C++ -*- +/* -*- C++ -*- */ //============================================================================= /** @@ -24,8 +24,6 @@ #include "ace/Global_Macros.h" #include "ace/os_include/os_dlfcn.h" -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - class ACE_DLL_Handle; /** @@ -34,7 +32,7 @@ class ACE_DLL_Handle; * @brief Provides an abstract interface for handling various DLL * operations. * - * This class is a wrapper over the various methods for utilizing + * This class is an wrapper over the various methods for utilizing * a dynamically linked library (DLL), which is called a shared * library on some platforms. Operations open(), close(), and * symbol() have been implemented to help opening/closing and @@ -45,36 +43,18 @@ class ACE_Export ACE_DLL public: // = Initialization and termination methods. - /** - * Default constructor. By default, the close() operation on the - * object will be invoked before it is destroyed. - * @param close_handle_on_destruction Indicates whether or not the - * close() method will be called to close an open DLL when this - * object is destroyed. By default, close() will be called. - * Set this parameter to 0 for situations where the DLL's lifetime - * is controlled in a scope other than that of this ACE_DLL object. - * For example, termination by ACE_DLL_Manager via ACE::fini(). - */ + /// Default constructor. By default, the close() operation on the + /// object will be invoked before it is destroyed. explicit ACE_DLL (int close_handle_on_destruction = 1); /** - * This constructor performs the actions of open() during construction. - * @param dll_name The name or path of the DLL to load. - * @param open_mode Flags to alter the actions taken when loading the DLL. - * The possible values are: - * @li @c RTLD_LAZY (this the default): loads identifier symbols but - * not the symbols for functions, which are loaded dynamically - * on-demand. - * @li @c RTLD_NOW: performs all necessary relocations when - * @a dll_name is first loaded - * @li RTLD_GLOBAL: makes symbols available for relocation - * processing of any other DLLs. - * @param close_handle_on_destruction Indicates whether or not the - * close() method will be called to close an open DLL when this - * object is destroyed. By default, close() will be called. - * Set this parameter to 0 for situations where the DLL's lifetime - * is controlled in a scope other than that of this ACE_DLL object. - * For example, termination by ACE_DLL_Manager via ACE::fini(). + * This constructor opens and dynamically links @a dll_name. The + * default mode is <RTLD_LAZY>, which loads identifier symbols but + * not the symbols for functions, which are loaded dynamically + * on-demand. Other supported modes include: <RTLD_NOW>, which + * performs all necessary relocations when @a dll_name is first + * loaded and <RTLD_GLOBAL>, which makes symbols available for + * relocation processing of any other DLLs. */ explicit ACE_DLL (const ACE_TCHAR *dll_name, int open_mode = ACE_DEFAULT_SHLIB_MODE, @@ -84,23 +64,16 @@ public: ACE_DLL (const ACE_DLL &); /** - * This method opens and dynamically links a specified DLL. - * @param dll_name The name or path of the DLL to load. - * @param open_mode Flags to alter the actions taken when loading the DLL. - * The possible values are: - * @li @c RTLD_LAZY (this the default): loads identifier symbols but - * not the symbols for functions, which are loaded dynamically - * on-demand. - * @li @c RTLD_NOW: performs all necessary relocations when - * @a dll_name is first loaded - * @li RTLD_GLOBAL: makes symbols available for relocation - * processing of any other DLLs. - * @param close_handle_on_destruction Indicates whether or not the - * close() method will be called to close an open DLL when this - * object is destroyed. By default, close() will be called. - * Set this parameter to 0 for situations where the DLL's lifetime - * is controlled in a scope other than that of this ACE_DLL object. - * For example, termination by ACE_DLL_Manager via ACE::fini(). + * This method opens and dynamically links @a dll_name. The default + * mode is <RTLD_LAZY>, which loads identifier symbols but not the + * symbols for functions, which are loaded dynamically on-demand. + * Other supported modes include: <RTLD_NOW>, which performs all + * necessary relocations when @a dll_name>is first loaded and + * <RTLD_GLOBAL>, which makes symbols available for relocation + * processing of any other DLLs. + * @param dll_name The name of the dll. + * @param open_mode How the dll is opened. + * @param close_handle_on_destruction Close the handle when object is destroyed. * @retval -1 On failure * @retval 0 On success. */ @@ -113,21 +86,16 @@ public: /** * Called when the DLL object is destroyed -- invokes close() if the - * @a close_handle_on_destruction flag was set to non-zero in the - * constructor or open() method. + * <close_handle_on_destruction> flag is set in the constructor or open() + * method. */ ~ACE_DLL (void); - /** - * Look up a named symbol in the DLL. DLL must be successfully opened - * before calling symbol(). - * @param symbol_name The symbol name to look up. - * @param ignore_errors If set to 1, allows you to probe a dll without - * generating error messages in the log. Handy for determining - * the capabilities of a library. - * @return Returns the value of @a symbol_name if it is a valid symbol - * in the DLL. Otherwise, returns 0. - */ + /// If @a symbol_name is in the symbol table of the DLL a pointer to + /// the @a symbol_name is returned. Otherwise, returns 0. Setting + /// ignore_errors = 1 allows you to probe a dll without generating + /// error messages in the log. Handy for determining the capabilities + /// of a library. void *symbol (const ACE_TCHAR *symbol_name, int ignore_errors = 0); /// Returns a pointer to a string explaining that an error occured. You @@ -145,7 +113,7 @@ public: /// Set the handle for the DLL object. By default, the close() //operation on / the object will be invoked before it is destroyed. - int set_handle (ACE_SHLIB_HANDLE handle, + int set_handle (ACE_SHLIB_HANDLE handle, int close_handle_on_destruction = 1); private: @@ -156,11 +124,6 @@ private: ACE_SHLIB_HANDLE handle = 0); - // Disallow assignment since we don't handle it. - void operator= (const ACE_DLL &); - -private: - /// Open mode. int open_mode_; @@ -178,9 +141,9 @@ private: /// Flag to record if the last operation had an error. int error_; + // = Disallow copying and assignment since we don't handle these. + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_DLL &)) }; -ACE_END_VERSIONED_NAMESPACE_DECL - #include /**/ "ace/post.h" #endif /* ACE_DLL_H */ |