summaryrefslogtreecommitdiff
path: root/ACE/ace/Dynamic_Service_Base.h
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:30 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:30 +0000
commit7a52d43a162b23d9e85e7b955e9b2c8e9caf550e (patch)
tree66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/ace/Dynamic_Service_Base.h
parent0e49389337be86641451a5c36c24bf742fe97523 (diff)
downloadATCD-7a52d43a162b23d9e85e7b955e9b2c8e9caf550e.tar.gz
Repo restructuring
Diffstat (limited to 'ACE/ace/Dynamic_Service_Base.h')
-rw-r--r--ACE/ace/Dynamic_Service_Base.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/ACE/ace/Dynamic_Service_Base.h b/ACE/ace/Dynamic_Service_Base.h
new file mode 100644
index 00000000000..7713d3f7e08
--- /dev/null
+++ b/ACE/ace/Dynamic_Service_Base.h
@@ -0,0 +1,79 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file Dynamic_Service_Base.h
+ *
+ * $Id$
+ *
+ * @author Prashant Jain <pjain@cs.wustl.edu>
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef ACE_DYNAMIC_SERVICE_BASE_H
+#define ACE_DYNAMIC_SERVICE_BASE_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/ACE_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ACE_Service_Gestalt;
+class ACE_Service_Type;
+
+/**
+ * @class ACE_Dynamic_Service_Base
+ *
+ * @brief Base class for all ACE_Dynamic_Service instantiations.
+ *
+ * Factors out common code shared by all ACE_Dynamic_Service
+ * instantiations, this avoid code bloat.
+ */
+class ACE_Export ACE_Dynamic_Service_Base
+{
+
+public:
+ /// Dump the current static of the object
+ void dump (void) const;
+
+protected:
+ /// Return instance using @a name to search the (default) Service_Repository.
+ static void* instance (const ACE_TCHAR *name);
+ /// Perform the default repo search, but optionally skip searching the global repo.
+ static void* instance (const ACE_TCHAR *name, bool no_global);
+
+ /// Return instance using @a name to search the specific @a repo instance.
+ static void* instance (const ACE_Service_Gestalt* repo,
+ const ACE_TCHAR *name);
+
+ static void* instance (const ACE_Service_Gestalt* repo,
+ const ACE_TCHAR *name,
+ bool no_global);
+
+ /// No need to create, or assign instances of this class
+ ACE_Dynamic_Service_Base (void);
+ ~ACE_Dynamic_Service_Base (void);
+ const ACE_Dynamic_Service_Base& operator= (const ACE_Dynamic_Service_Base&);
+
+private:
+ /// Implement the service search policy, i.e. "look for the service first
+ /// locally and then globally"
+ static const ACE_Service_Type *find_i (const ACE_Service_Gestalt* &repo,
+ const ACE_TCHAR *name,
+ bool no_global);
+
+ /// The dependency declaration class needs access to the service search
+ /// policy, implemented by find_i()
+ friend class ACE_Dynamic_Service_Dependency;
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* ACE_DYNAMIC_SERVICE_BASE_H */