00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Dynamic_Service.h 00006 * 00007 * Dynamic_Service.h,v 4.24 2006/05/30 19:19:27 mesnier_p Exp 00008 * 00009 * @author Prashant Jain <pjain@cs.wustl.edu> 00010 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> 00011 */ 00012 //============================================================================= 00013 00014 #ifndef ACE_DYNAMIC_SERVICE_H 00015 #define ACE_DYNAMIC_SERVICE_H 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "ace/config-all.h" 00020 #include "ace/Global_Macros.h" 00021 00022 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00023 # pragma once 00024 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00025 00026 #include "ace/Dynamic_Service_Base.h" 00027 00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00029 00030 class ACE_Service_Object; 00031 00032 /** 00033 * @class ACE_Dynamic_Service 00034 * 00035 * @brief Provides a general interface to retrieve arbitrary objects 00036 * from the ACE service repository. 00037 * 00038 * Uses "name" for lookup in the ACE service repository. Obtains 00039 * the object and returns it as the appropriate type. 00040 */ 00041 template <class TYPE> 00042 class ACE_Dynamic_Service : public ACE_Dynamic_Service_Base 00043 { 00044 public: 00045 /// Return instance using @a name to search the Service_Repository. 00046 static TYPE* instance (const ACE_TCHAR *name); 00047 static TYPE* instance (const ACE_TCHAR *name, bool no_global); 00048 00049 static TYPE* instance (const ACE_Service_Gestalt* repo, 00050 const ACE_TCHAR *name); 00051 static TYPE* instance (const ACE_Service_Gestalt* repo, 00052 const ACE_TCHAR *name, bool no_global); 00053 00054 #if defined (ACE_USES_WCHAR) 00055 00056 /// Return instance using @a name to search the Service_Repository. 00057 static TYPE* instance (const ACE_ANTI_TCHAR *name); 00058 00059 static TYPE* instance (const ACE_ANTI_TCHAR *name, bool no_global); 00060 00061 static TYPE* instance (const ACE_Service_Gestalt* repo, 00062 const ACE_ANTI_TCHAR *name); 00063 static TYPE* instance (const ACE_Service_Gestalt* repo, 00064 const ACE_ANTI_TCHAR *name, bool no_global); 00065 #endif // ACE_USES_WCHAR 00066 00067 private: 00068 ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Service ()) 00069 ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Service (const ACE_Dynamic_Service&)) 00070 ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Service& operator= (const ACE_Dynamic_Service&)) 00071 }; 00072 00073 ACE_END_VERSIONED_NAMESPACE_DECL 00074 00075 #if defined (__ACE_INLINE__) 00076 #include "ace/Dynamic_Service.inl" 00077 #endif /* __ACE_INLINE__ */ 00078 00079 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00080 # include "ace/Dynamic_Service.cpp" 00081 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00082 00083 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00084 # pragma implementation ("Dynamic_Service.cpp") 00085 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00086 00087 #include /**/ "ace/post.h" 00088 00089 #endif /* ACE_DYNAMIC_SERVICE_H */