Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / tests / Service_Config_DLL.h
blobbe3e9db1a1a4000d8baf86aa69ee653dd187d147
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Service_Config_DLL.h
7 * @author Ossama Othman <ossama@uci.edu>
8 */
9 //=============================================================================
11 #ifndef SERVICE_CONFIG_DLL_H
12 #define SERVICE_CONFIG_DLL_H
14 #include /**/ "ace/pre.h"
16 #include "Service_Config_DLL_Export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/Service_Object.h"
23 #include "ace/Task.h"
25 /**
26 * @class Service_Config_DLL
28 * @brief The Service_Config_DLL that is instantiated when the
29 * client-side test module/library is dynamically loaded.
31 * This class is the implementation used for all service instances
32 * (i.e. those declared using the ACE_FACTORY_* macros).
34 class Service_Config_DLL_Export Service_Config_DLL : public ACE_Task_Base
36 public:
37 /// Constructor.
38 Service_Config_DLL ();
40 /// Initializes object when dynamic linking occurs.
41 virtual int init (int argc, ACE_TCHAR *argv[]);
43 /// Terminates object when dynamic unlinking occurs.
44 virtual int fini ();
46 /// Run by a daemon thread.
47 /**
48 * Each thread will invoke the Service Configurator via this
49 * method unless the object is the "FINAL" object.
51 virtual int svc ();
53 private:
54 /// Directives to be passed to be processed by the Service
55 /// Configurator in separate threads.
56 ACE_TCHAR directive_[2][BUFSIZ];
59 /**
60 * @class Refuses_Init
62 * @brief The Refuses_Init service simply tests for proper operation
63 * when a service's init() hook returns -1.
65 class Service_Config_DLL_Export Refuses_Init : public ACE_Service_Object
67 public:
68 // Constructor; required for factory function.
69 Refuses_Init () {}
71 /// Initializes object when dynamic linking occurs.
72 virtual int init (int argc, ACE_TCHAR *argv[]);
74 /// Terminates object when dynamic unlinking occurs.
75 virtual int fini ();
77 /// Returns information on a service object.
78 virtual int info (ACE_TCHAR **info_string, size_t length = 0) const;
81 ACE_FACTORY_DECLARE (Service_Config_DLL, Service_Config_DLL)
82 ACE_FACTORY_DECLARE (Service_Config_DLL, Refuses_Init)
84 #include /**/ "ace/post.h"
86 #endif /* SERVICE_CONFIG_DLL_H */