class PServiceProcess

A process type that runs as a "background" service.

Inheritance:


Public Methods

[more] Construction
[more] Callback functions
[more] Miscellaneous functions

Protected Fields

[more]BOOL debugMode
Flag to indicate service is run in simulation mode
[more]PSystemLog::Level currentLogLevel
Current log level for PSYSTEMLOG calls


Inherited from PProcess:

Public Methods

Overrides from class PObject

Overrides from class PThread

Process information functions

Operating System information functions


Inherited from PThread:

Public Methods

Overrides from PObject

Control functions

Miscellaneous


Inherited from PObject:

Public Methods

Run Time Type functions

I/O functions

Public Members

Comparison functions


Documentation

A process type that runs as a "background" service. This may be a service under the Windows NT operating system, or a "daemon" under Unix, or a hidden application under Windows.
o Construction

o PServiceProcess( const char* manuf, const char* name, WORD majorVersion, WORD minorVersion, CodeStatus status, WORD buildNumber )
Create a new service process.
Parameters:
manuf - Name of manufacturer
name - Name of product
majorVersion - Major version number of the product
minorVersion - Minor version number of the product
- status Development status of the product
buildNumber - Build number of the product

o Callback functions

ovirtual BOOL OnStart() = 0
Called when the service is started. This typically initialises the service and returns TRUE if the service is ready to run. The Main() function is then executed.

Returns:
TRUE if service may start, FALSE if an initialisation failure occurred.

ovirtual void OnStop()
Called by the system when the service is stopped. One return from this function there is no guarentee that any more user code will be executed. Any cleaning up or closing of resource must be done in here.

ovirtual BOOL OnPause()
Called by the system when the service is to be paused. This will suspend any actions that the service may be executing. Usually this is less expensive in resource allocation etc than stopping and starting the service.

Returns:
TRUE if the service was successfully paused.

ovirtual void OnContinue()
Resume after the service was paused

ovirtual void OnControl() = 0
The Control menu option was used in the SysTray menu

o Miscellaneous functions

ostatic PServiceProcess& Current()
Get the current service process object.

Returns:
Pointer to service process.

ovoid SetLogLevel( PSystemLog::Level level )
Set the level at which errors are logged. Only messages higher than or equal to the specified level will be logged.

The default is LogError allowing fatal errors and ordinary\ errors to be logged and warning and information to be ignored.

If in debug mode then the default is LogInfo allowing all messages to be displayed.

Parameters:
level - New log level

oPSystemLog::Level GetLogLevel() const
Get the current level for logging.

Returns:
Log level.

oBOOL debugMode
Flag to indicate service is run in simulation mode

oPSystemLog::Level currentLogLevel
Current log level for PSYSTEMLOG calls


This class has no child classes.
Friends:
void PSystemLog::Output(PSystemLog::Level, const char *)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.