summaryrefslogtreecommitdiff
path: root/ace/DLL.h
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-11-01 22:17:39 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-11-01 22:17:39 +0000
commit53284e215e3d3351a7d7e9c4b68f14b427fb4377 (patch)
tree97236ece363cff48fd287c780db4290da39b02cb /ace/DLL.h
parent7b7c52ad2abd228138ba1a948d5e28bf6dc3b880 (diff)
downloadATCD-53284e215e3d3351a7d7e9c4b68f14b427fb4377.tar.gz
ChangeLogTag:Wed Nov 1 14:11:48 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'ace/DLL.h')
-rw-r--r--ace/DLL.h123
1 files changed, 65 insertions, 58 deletions
diff --git a/ace/DLL.h b/ace/DLL.h
index e1cbe76f70d..2a870fa08c1 100644
--- a/ace/DLL.h
+++ b/ace/DLL.h
@@ -1,18 +1,15 @@
/* -*- C++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// ace
-//
-// = FILENAME
-// DLL.h
-//
-// = AUTHOR
-// Kirthika Parameswaran <kirthika@cs.wustl.edu>
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file DLL.h
+ *
+ * $Id$
+ *
+ * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
+ */
+//=============================================================================
+
#ifndef ACE_DLL_H
#define ACE_DLL_H
@@ -24,80 +21,90 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+/**
+ * @class ACE_DLL
+ *
+ * @brief Provides an abstract interface for handling various DLL
+ * operations.
+ *
+ * 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
+ * extracting symbol information from a DLL, respectively.
+ */
class ACE_Export ACE_DLL
{
- // = TITLE
- // Provides an abstract interface for handling various DLL
- // operations.
- //
- // = DESCRIPTION
- // 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
- // extracting symbol information from a DLL, respectively.
public:
// = Initialization and termination methods.
+ /// Default constructor. By default, the <close> operation on the
+ /// object will be invoked before it is destroyed.
ACE_DLL (int close_on_destruction = 1);
- // Default constructor. By default, the <close> operation on the
- // object will be invoked before it is destroyed.
+ /**
+ * This constructor opens and dynamically links <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 <dll_name> is first
+ * loaded and <RTLD_GLOBAL>, which makes symbols available for
+ * relocation processing of any other DLLs.
+ */
ACE_DLL (const ACE_TCHAR *dll_name,
int open_mode = ACE_DEFAULT_SHLIB_MODE,
int close_on_destruction = 1);
- // This constructor opens and dynamically links <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 <dll_name> is first
- // loaded and <RTLD_GLOBAL>, which makes symbols available for
- // relocation processing of any other DLLs.
+ /**
+ * This method opens and dynamically links <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 <dll_name> is first loaded and
+ * <RTLD_GLOBAL>, which makes symbols available for relocation
+ * processing of any other DLLs. Returns -1 on failure and 0 on
+ * success.
+ */
int open (const ACE_TCHAR *dll_name,
int open_mode = ACE_DEFAULT_SHLIB_MODE,
int close_on_destruction = 1);
- // This method opens and dynamically links <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 <dll_name> is first loaded and
- // <RTLD_GLOBAL>, which makes symbols available for relocation
- // processing of any other DLLs. Returns -1 on failure and 0 on
- // success.
+ /// Call to close the DLL object.
int close (void);
- // Call to close the DLL object.
+ /**
+ * Called when the DLL object is destroyed -- invokes <close> if the
+ * <close_on_destruction> flag is set in the constructor or <open>
+ * method.
+ */
~ACE_DLL (void);
- // Called when the DLL object is destroyed -- invokes <close> if the
- // <close_on_destruction> flag is set in the constructor or <open>
- // method.
+ /// If <symbol_name> is in the symbol table of the DLL a pointer to
+ /// the <symbol_name> is returned. Otherwise, returns 0.
void *symbol (const ACE_TCHAR *symbol_name);
- // If <symbol_name> is in the symbol table of the DLL a pointer to
- // the <symbol_name> is returned. Otherwise, returns 0.
+ /// Returns a pointer to a string explaining why <symbol> or <open>
+ /// failed.
ACE_TCHAR *error (void);
- // Returns a pointer to a string explaining why <symbol> or <open>
- // failed.
+ /**
+ * Return the handle to the caller. If <become_owner> is non-0 then
+ * caller assumes ownership of the handle and the <ACE_DLL> object
+ * won't call <close> when it goes out of scope, even if
+ * <close_on_destruction> is set.
+ */
ACE_SHLIB_HANDLE get_handle (int become_owner = 0);
- // Return the handle to the caller. If <become_owner> is non-0 then
- // caller assumes ownership of the handle and the <ACE_DLL> object
- // won't call <close> when it goes out of scope, even if
- // <close_on_destruction> is set.
+ /// 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 close_on_destruction = 1);
- // Set the handle for the DLL object. By default, the <close> operation on the
- // object will be invoked before it is destroyed.
private:
+ /// This is a handle to the DLL.
ACE_SHLIB_HANDLE handle_;
- // This is a handle to the DLL.
+ /// This flag keeps track of whether we should close the handle
+ /// automatically when the destructor runs.
int close_on_destruction_;
- // This flag keeps track of whether we should close the handle
- // automatically when the destructor runs.
// = Disallow copying and assignment since we don't handle these.
ACE_UNIMPLEMENTED_FUNC (ACE_DLL (const ACE_DLL &))