ACE+TAO-7_0_8
[ACE_TAO.git] / ACE / tests / Service_Config_DLL.h
blobca66ec748dbaf2cab31983d4efa472e232e57810
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:
38 /// Constructor.
39 Service_Config_DLL (void);
41 /// Initializes object when dynamic linking occurs.
42 virtual int init (int argc, ACE_TCHAR *argv[]);
44 /// Terminates object when dynamic unlinking occurs.
45 virtual int fini ();
47 /// Run by a daemon thread.
48 /**
49 * Each thread will invoke the Service Configurator via this
50 * method unless the object is the "FINAL" object.
52 virtual int svc ();
54 private:
56 /// Directives to be passed to be processed by the Service
57 /// Configurator in separate threads.
58 ACE_TCHAR directive_[2][BUFSIZ];
62 /**
63 * @class Refuses_Init
65 * @brief The Refuses_Init service simply tests for proper operation
66 * when a service's init() hook returns -1.
68 class Service_Config_DLL_Export Refuses_Init : public ACE_Service_Object
70 public:
71 // Constructor; required for factory function.
72 Refuses_Init () {}
74 /// Initializes object when dynamic linking occurs.
75 virtual int init (int argc, ACE_TCHAR *argv[]);
77 /// Terminates object when dynamic unlinking occurs.
78 virtual int fini ();
80 /// Returns information on a service object.
81 virtual int info (ACE_TCHAR **info_string, size_t length = 0) const;
84 ACE_FACTORY_DECLARE (Service_Config_DLL, Service_Config_DLL)
85 ACE_FACTORY_DECLARE (Service_Config_DLL, Refuses_Init)
87 #include /**/ "ace/post.h"
89 #endif /* SERVICE_CONFIG_DLL_H */