Use =default for skeleton copy constructor
[ACE_TAO.git] / ACE / tests / Framework_Component_DLL.cpp
bloba5280fdd093ed6e27958db99a3b31ada69ba2fde
2 //=============================================================================
3 /**
4 * @file Framework_Component_DLL.cpp
6 * This is a simple server that can be loaded via the ACE
7 * Service Configuration framework and uses the singleton that
8 * also lives in this library.
10 * @author Don Hinton <dhinton@ieee.org>
12 //=============================================================================
14 #include "Framework_Component_DLL.h"
15 #include "ace/Service_Config.h"
16 #include "ace/Service_Object.h"
17 #include "ace/Framework_Component_T.h"
19 ACE_DLL_UNLOAD_POLICY (Framework_Component_DLL, ACE_DLL_UNLOAD_POLICY_LAZY)
21 Simple_Service::Simple_Service ()
23 FRAMEWORK_COMPONENT_DLL_TRACE ("Simple_Service::Simple_Service");
26 Simple_Service::~Simple_Service ()
28 FRAMEWORK_COMPONENT_DLL_TRACE ("Simple_Service::~Simple_Service");
31 const ACE_TCHAR *
32 Simple_Service::name ()
34 FRAMEWORK_COMPONENT_DLL_TRACE ("Simple_Service::dll_name");
35 return ACE_TEXT ("Simple_Service");
38 /***************************************************************************/
40 template <int which>
41 class Server_T : public ACE_Service_Object
43 public:
44 int init (int, ACE_TCHAR *[]) override
46 FRAMEWORK_COMPONENT_DLL_TRACE ("Server_T::init");
48 // Initialize the singleton
49 FWCT_DLL_Singleton_Adapter_T <Simple_Service> *ss = SS_SINGLETON::instance ();
51 ACE_DEBUG ((LM_DEBUG,
52 ACE_TEXT ("Server_T::init() dll_name: %s\n"),
53 ss->dll_name ()));
54 return 0;
57 int fini () override
59 FRAMEWORK_COMPONENT_DLL_TRACE ("Server_T::fini");
60 return 0;
64 using Server_1 = Server_T<1>;
65 FRAMEWORK_COMPONENT_DLL_SINGLETON_DECLARATION(Server_T<1>;)
66 ACE_FACTORY_DEFINE (Framework_Component_DLL, Server_1)
68 using Server_2 = Server_T<2>;
69 FRAMEWORK_COMPONENT_DLL_SINGLETON_DECLARATION(Server_T<2>;)
70 ACE_FACTORY_DEFINE (Framework_Component_DLL, Server_2)