ACE  6.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros
NT_Service.h File Reference
#include "ace/ACE.h"
#include "ace/OS_Log_Msg_Attributes.h"
#include "ace/Service_Object.h"
#include "ace/Task.h"
#include "ace/OS_NS_errno.h"
#include "ace/NT_Service.inl"

Classes

class  ACE_NT_Service
 Provide the base class which defines the interface for controlling an NT service. More...
 

Macros

#define ACE_NT_SERVICE_START_TIMEOUT   5000
 
#define ACE_NT_SERVICE_DEFINE(SVCNAME, SVCCLASS, SVCDESC)
 
#define ACE_NT_SERVICE_REFERENCE(SVCNAME)
 
#define ACE_NT_SERVICE_ENTRY(SVCDESC, SVCNAME)
 
#define ACE_NT_SERVICE_RUN(SVCNAME, SVCINSTANCE, RET)
 

Detailed Description

Id:
NT_Service.h 93117 2011-01-20 12:11:28Z mcorino
Author
Steve Huston shust.nosp@m.on@r.nosp@m.ivera.nosp@m.ce.c.nosp@m.om

Macro Definition Documentation

#define ACE_NT_SERVICE_DEFINE (   SVCNAME,
  SVCCLASS,
  SVCDESC 
)
Value:
ACE_NT_Service * _ace_nt_svc_obj_##SVCNAME = 0; \
VOID WINAPI ace_nt_svc_handler_##SVCNAME (DWORD fdwControl) { \
_ace_nt_svc_obj_##SVCNAME->handle_control(fdwControl); \
} \
VOID WINAPI ace_nt_svc_main_##SVCNAME (DWORD dwArgc, \
ACE_TCHAR **lpszArgv) { \
bool delete_svc_obj = false; \
if (_ace_nt_svc_obj_##SVCNAME == 0) { \
ACE_NEW (_ace_nt_svc_obj_##SVCNAME, SVCCLASS); \
if (_ace_nt_svc_obj_##SVCNAME == 0) \
return; \
delete_svc_obj = true; \
} \
else \
_ace_nt_svc_obj_##SVCNAME->inherit_log_msg_attributes (); \
_ace_nt_svc_obj_##SVCNAME->init(dwArgc, lpszArgv); \
_ace_nt_svc_obj_##SVCNAME->svc_handle( \
&ace_nt_svc_handler_##SVCNAME)); \
_ace_nt_svc_obj_##SVCNAME->open(); \
_ace_nt_svc_obj_##SVCNAME->wait(); \
_ace_nt_svc_obj_##SVCNAME->fini(); \
if (delete_svc_obj) { \
delete _ace_nt_svc_obj_##SVCNAME; \
_ace_nt_svc_obj_##SVCNAME = 0; \
} \
return; \
}
#define ACE_TEXT_RegisterServiceCtrlHandler
Definition: ace_wchar.h:316
virtual void handle_control(DWORD control_code)
Definition: NT_Service.cpp:91
char ACE_TCHAR
Definition: ace_wchar.h:100
Provide the base class which defines the interface for controlling an NT service. ...
Definition: NT_Service.h:99
#define ACE_NEW(POINTER, CONSTRUCTOR)
Definition: OS_Memory.h:221
#define ACE_NT_SERVICE_ENTRY (   SVCDESC,
  SVCNAME 
)
Value:
{ const_cast<ACE_TCHAR*> (SVCDESC), \
&ace_nt_svc_main_##SVCNAME }
char ACE_TCHAR
Definition: ace_wchar.h:100
#define ACE_NT_SERVICE_REFERENCE (   SVCNAME)
Value:
extern ACE_NT_Service * _ace_nt_svc_obj_##SVCNAME; \
extern VOID WINAPI ace_nt_svc_main_##SVCNAME (DWORD dwArgc, \
ACE_TCHAR **lpszArgv);
char ACE_TCHAR
Definition: ace_wchar.h:100
Provide the base class which defines the interface for controlling an NT service. ...
Definition: NT_Service.h:99
#define ACE_NT_SERVICE_RUN (   SVCNAME,
  SVCINSTANCE,
  RET 
)
Value:
ACE_TEXT_SERVICE_TABLE_ENTRY _ace_nt_svc_table[2] = \
{ \
ACE_NT_SERVICE_ENTRY(ACE_TEXT (#SVCNAME), SVCNAME), \
{ 0, 0 } \
}; \
_ace_nt_svc_obj_##SVCNAME = SVCINSTANCE; \
_ace_nt_svc_obj_##SVCNAME->capture_log_msg_attributes (); \
int RET = ACE_TEXT_StartServiceCtrlDispatcher(_ace_nt_svc_table);
#define ACE_TEXT_SERVICE_TABLE_ENTRY
Definition: ace_wchar.h:281
#define ACE_TEXT_StartServiceCtrlDispatcher
Definition: ace_wchar.h:331
int last_error(void)
Definition: OS_NS_errno.inl:10
#define ACE_TEXT(STRING)
Definition: ace_wchar.h:102
#define ACE_NT_SERVICE_ENTRY(SVCDESC, SVCNAME)
Definition: NT_Service.h:417
#define ACE_NT_SERVICE_START_TIMEOUT   5000