2 #include "ace/svc_export.h"
4 #if !defined (ACE_LACKS_PRAGMA_ONCE)
6 #endif /* ACE_LACKS_PRAGMA_ONCE */
8 #include "ace/Service_Config.h"
9 #include "ace/Reactor.h"
10 #include "ace/Service_Object.h"
13 class ACE_Svc_Export Timer_Service_1
: public ACE_Service_Object
16 // Demonstrates a simple timer service that can be configured
20 // Default constructor.
22 virtual int init (int argc
, ACE_TCHAR
*argv
[]);
23 // Initialization hook.
25 virtual int handle_timeout (const ACE_Time_Value
&,
29 virtual int handle_close (ACE_HANDLE
, ACE_Reactor_Mask
);
33 ACE_TCHAR name_
[BUFSIZ
];
34 // Keep track of which service this is!
39 TIMEOUT
= 4, // Wait 4 seconds between timeouts
40 MAX_TIMEOUTS
= 10 // Don't timeout for more than 10 times.
44 // Maximum number of timeouts before shutting down the test.
47 // Current number of timeouts.
50 class ACE_Svc_Export Timer_Service_2
: public Timer_Service_1
54 // Default constructor.
57 class ACE_Svc_Export Timer_Service_3
: public Timer_Service_1
61 // Default constructor.
64 // Declare both static and dynamic services.
65 ACE_STATIC_SVC_DECLARE_EXPORT (ACE_Svc
, Timer_Service_1
)
66 ACE_SVC_FACTORY_DECLARE (Timer_Service_1
)
67 ACE_SVC_FACTORY_DECLARE (Timer_Service_2
)
68 ACE_SVC_FACTORY_DECLARE (Timer_Service_3
)