summaryrefslogtreecommitdiff
path: root/ace/DLL_Manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'ace/DLL_Manager.h')
-rw-r--r--ace/DLL_Manager.h98
1 files changed, 44 insertions, 54 deletions
diff --git a/ace/DLL_Manager.h b/ace/DLL_Manager.h
index 2bde7161251..856fbe4e861 100644
--- a/ace/DLL_Manager.h
+++ b/ace/DLL_Manager.h
@@ -1,4 +1,4 @@
-// -*- C++ -*-
+/* -*- C++ -*- */
//=============================================================================
/**
@@ -32,9 +32,6 @@
#define ACE_DEFAULT_DLL_MANAGER_SIZE 1024
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
/**
* @class ACE_DLL_Handle
*
@@ -51,12 +48,12 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* extracting symbol information from a DLL, respectively.
*
* Most of this class came from the original ACE_DLL class.
- * ACE_DLL is now just an interface that passed all it's calls
- * either directly or via ACE_DLL_Manager to this class for
- * execution.
+ * ACE_DLL is now just an interface that passed all it's calls
+ * either directly or via ACE_DLL_Manager to this class for
+ * execution.
*
*/
-class ACE_DLL_Handle
+class ACE_Export ACE_DLL_Handle
{
public:
@@ -70,42 +67,41 @@ public:
const ACE_TCHAR *dll_name () const;
/**
- * This method opens and dynamically links @a dll_name. The default
+ * 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 @a dll_name is first loaded and
+ * 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 (const ACE_TCHAR *dll_name,
int open_mode,
ACE_SHLIB_HANDLE handle);
/// Call to close the DLL object. If unload = 0, it only decrements
- /// the refcount, but if unload = 1, then it will actually unload
+ /// the refcount, but if unload = 1, then it will actually unload
/// the library when the refcount == 0;
int close (int unload = 0);
/// Return the current refcount.
sig_atomic_t refcount (void) const;
- /// If @a symbol_name is in the symbol table of the DLL a pointer to
- /// the @a symbol_name is returned. Otherwise, returns 0. Set the
+ /// If <symbol_name> is in the symbol table of the DLL a pointer to
+ /// the <symbol_name> is returned. Otherwise, returns 0. Set the
/// ignore_errors flag to supress logging errors if symbol_name isn't
/// found. This is nice if you just want to probe a dll to see what's
/// available, since missing functions in that case aren't really errors.
void *symbol (const ACE_TCHAR *symbol_name, int ignore_errors = 0);
/**
- * Return the handle to the caller. If @a become_owner is non-0 then
+ * Return the handle to the caller. If <become_owner> is non-0 then
* caller assumes ownership of the handle so we decrement the retcount.
*/
ACE_SHLIB_HANDLE get_handle (int become_owner = 0);
-
+
private:
-
/// Returns a pointer to a string explaining why <symbol> or <open>
/// failed. This is used internal to print out the error to the log,
/// but since this object is shared, we can't store or return the error
@@ -118,12 +114,6 @@ private:
void get_dll_names (const ACE_TCHAR *dll_name,
ACE_Array<ACE_TString> &try_names);
- // Disallow copying and assignment since we don't handle them.
- ACE_DLL_Handle (const ACE_DLL_Handle &);
- void operator= (const ACE_DLL_Handle &);
-
-private:
-
// Keep track of how many ACE_DLL objects have a reference to this
// dll.
sig_atomic_t refcount_;
@@ -144,6 +134,11 @@ private:
/// Synchronization variable for the MT_SAFE Repository
ACE_Thread_Mutex lock_;
#endif /* ACE_MT_SAFE */
+
+ // = Disallow copying and assignment since we don't handle these.
+ ACE_UNIMPLEMENTED_FUNC (ACE_DLL_Handle (const ACE_DLL_Handle &))
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_DLL_Handle &))
+
};
class ACE_Framework_Repository;
@@ -151,10 +146,10 @@ class ACE_Framework_Repository;
/**
* @class ACE_DLL_Manager
*
- * @brief This class is a singleton and serves as a factory and
- * repository for instances of ACE_DLL_Handle.
+ * @brief This class is a singleton and serves as a factory and
+ * repository for instances of ACE_DLL_Handle.
*
- * This class is a singleton whose lifetime is managed by the
+ * This class is a singleton whose lifetime is managed by the
* ACE_Framework_Repository. Although it is normally meant to be
* used directly only by ACE_DLL, applications can call the unload_policy()
* methods in order get/set the the dll unload policy. Unload policies include
@@ -162,28 +157,30 @@ class ACE_Framework_Repository;
* by using the ACE_DLL_UNLOAD_POLICY macro found in config-all.h. If a dll
* choses to set an unload policy, it will be used when the per-dll policy
* (the default) is in effect. If the per-dll policy is in effect and a dll
- * has not chosen to set a policy, the current per-process policy will be
- * used.
+ * has not chosen to set a policy, the current per-process policy will be
+ * used.
*
* The following policy macros are provided in config-all.h:
*
- * ACE_DLL_UNLOAD_POLICY_PER_PROCESS - Per-process policy that unloads dlls
+ * ACE_DLL_UNLOAD_POLICY_PER_PROCESS - Per-process policy that unloads dlls
* eagerly.
- *
- * ACE_DLL_UNLOAD_POLICY_PER_DLL - Apply policy on a per-dll basis. If the
- * dll doesn't use one of the macros below, the current per-process policy
+ *
+ * ACE_DLL_UNLOAD_POLICY_PER_DLL - Apply policy on a per-dll basis. If the
+ * dll doesn't use one of the macros below, the current per-process policy
* will be used.
*
- * ACE_DLL_UNLOAD_POLICY_LAZY - Don't unload dll when refcount reaches
+ * ACE_DLL_UNLOAD_POLICY_LAZY - Don't unload dll when refcount reaches
* zero, i.e., wait for either an explicit unload request or program exit.
*
- * ACE_DLL_UNLOAD_POLICY_DEFAULT - Default policy allows dlls to control
+ * ACE_DLL_UNLOAD_POLICY_DEFAULT - Default policy allows dlls to control
* their own destinies, but will unload those that don't make a choice eagerly.
*
*/
class ACE_Export ACE_DLL_Manager
{
public:
+ // This if to silence the compiler warnings, even though ACE_Framework_Repository
+ // always uses the instance method.
friend class ACE_Framework_Repository;
enum
@@ -194,10 +191,10 @@ public:
/// Return a unique instance
static ACE_DLL_Manager *instance (int size = ACE_DLL_Manager::DEFAULT_SIZE);
- /// Factory for ACE_DLL_Handle objects. If one already exits,
+ /// Factory for ACE_DLL_Handle objects. If one already exits,
/// its refcount is incremented.
- ACE_DLL_Handle *open_dll (const ACE_TCHAR *dll_name,
- int openmode,
+ ACE_DLL_Handle *open_dll (const ACE_TCHAR *dll_name,
+ int openmode,
ACE_SHLIB_HANDLE handle);
/// Close the underlying dll. Decrements the refcount.
@@ -206,19 +203,12 @@ public:
/// Returns the current per-process UNLOAD_POLICY.
u_long unload_policy (void) const;
- /// Set the per-process UNLOAD_POLICY. If the policy is changed from
+ /// Set the per-process UNLOAD_POLICY. If the policy is changed from
/// LAZY to EAGER, then it will also unload any dlls with zero
/// refcounts.
void unload_policy (u_long unload_policy);
protected:
-
- /// Default constructor.
- ACE_DLL_Manager (int size = ACE_DLL_Manager::DEFAULT_SIZE);
-
- /// Destructor.
- ~ACE_DLL_Manager (void);
-
// Allocate handle_vector_.
int open (int size);
@@ -232,16 +222,15 @@ protected:
int unload_dll (ACE_DLL_Handle *dll_handle, int force_unload = 0);
private:
+ /// Default constructor.
+ ACE_DLL_Manager (int size = ACE_DLL_Manager::DEFAULT_SIZE);
+
+ /// Destructor.
+ ~ACE_DLL_Manager (void);
/// Close the singleton instance.
static void close_singleton (void);
- // Disallow copying and assignment since we don't handle these.
- ACE_DLL_Manager (const ACE_DLL_Manager &);
- void operator= (const ACE_DLL_Manager &);
-
-private:
-
/// Vector containing all loaded handle objects.
ACE_DLL_Handle **handle_vector_;
@@ -254,7 +243,7 @@ private:
/// Unload strategy.
u_long unload_policy_;
- /// Pointer to a process-wide <ACE_DLL_Manager>.
+ /// Pointer to a process-wide <ACE_DLL_Manager>.
static ACE_DLL_Manager *instance_;
#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
@@ -262,9 +251,10 @@ private:
ACE_Thread_Mutex lock_;
#endif /* ACE_MT_SAFE */
+ // = Disallow copying and assignment since we don't handle these.
+ ACE_UNIMPLEMENTED_FUNC (ACE_DLL_Manager (const ACE_DLL_Manager &))
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_DLL_Manager &))
};
-ACE_END_VERSIONED_NAMESPACE_DECL
-
#include /**/ "ace/post.h"
#endif /* ACE_DLL_MANAGER_H */