Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / ace / Dynamic_Service.h
blobed866b3f78eb926a70a2d4c7271c9a94fe0c0803
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Dynamic_Service.h
7 * @author Prashant Jain <pjain@cs.wustl.edu>
8 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
9 */
10 //=============================================================================
12 #ifndef ACE_DYNAMIC_SERVICE_H
13 #define ACE_DYNAMIC_SERVICE_H
15 #include /**/ "ace/pre.h"
17 #include /**/ "ace/config-all.h"
18 #include "ace/Global_Macros.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/Dynamic_Service_Base.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
28 class ACE_Service_Object;
30 /**
31 * @class ACE_Dynamic_Service
33 * @brief Provides a general interface to retrieve arbitrary objects
34 * from the ACE service repository.
36 * Uses "name" for lookup in the ACE service repository. Obtains
37 * the object and returns it as the appropriate type.
39 template <class TYPE>
40 class ACE_Dynamic_Service : public ACE_Dynamic_Service_Base
42 public:
43 /// Return instance using @a name to search the Service_Repository.
44 static TYPE* instance (const ACE_TCHAR *name);
45 static TYPE* instance (const ACE_TCHAR *name, bool no_global);
47 static TYPE* instance (const ACE_Service_Gestalt* repo,
48 const ACE_TCHAR *name);
49 static TYPE* instance (const ACE_Service_Gestalt* repo,
50 const ACE_TCHAR *name, bool no_global);
52 #if defined (ACE_USES_WCHAR)
54 /// Return instance using @a name to search the Service_Repository.
55 static TYPE* instance (const ACE_ANTI_TCHAR *name);
57 static TYPE* instance (const ACE_ANTI_TCHAR *name, bool no_global);
59 static TYPE* instance (const ACE_Service_Gestalt* repo,
60 const ACE_ANTI_TCHAR *name);
61 static TYPE* instance (const ACE_Service_Gestalt* repo,
62 const ACE_ANTI_TCHAR *name, bool no_global);
63 #endif // ACE_USES_WCHAR
65 private:
66 ACE_Dynamic_Service () = delete;
67 ACE_Dynamic_Service (const ACE_Dynamic_Service&) = delete;
68 ACE_Dynamic_Service& operator= (const ACE_Dynamic_Service&) = delete;
71 ACE_END_VERSIONED_NAMESPACE_DECL
73 #if defined (__ACE_INLINE__)
74 #include "ace/Dynamic_Service.inl"
75 #endif /* __ACE_INLINE__ */
77 # include "ace/Dynamic_Service.cpp"
79 #include /**/ "ace/post.h"
81 #endif /* ACE_DYNAMIC_SERVICE_H */