Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PServiceProcess Class Reference

#include <svcproc.h>

Inheritance diagram for PServiceProcess:

PProcess PThread PObject

List of all members.


Detailed Description

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.

Definition at line 236 of file svcproc.h.


Comparison functions

virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator>= (const PObject &obj) const
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }

Process information functions

PArgListGetArguments ()
const PFilePathGetFile () const
PString GetGroupName () const
virtual const PStringGetManufacturer () const
int GetMaxHandles () const
virtual const PStringGetName () const
DWORD GetProcessID () const
int GetTerminationValue () const
PString GetUserName () const
virtual PString GetVersion (BOOL full=TRUE) const
void SetConfigurationPath (const PString &path)
BOOL SetGroupName (const PString &groupname, BOOL permanent=FALSE)
BOOL SetMaxHandles (int newLimit)
void SetTerminationValue (int value)
BOOL SetUserName (const PString &username, BOOL permanent=FALSE)
static BOOL IsInitialised ()

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
virtual BOOL InternalIsDescendant (const char *clsName) const
BOOL IsClass (const char *cls) const
static const char * Class ()

Miscellaneous functions

PSystemLog::Level GetLogLevel () const
void SetLogLevel (PSystemLog::Level level)
static PServiceProcessCurrent ()

Control functions

virtual Priority GetPriority () const
virtual BOOL IsSuspended () const
virtual BOOL IsTerminated () const
virtual void Restart ()
virtual void Resume ()
virtual void SetAutoDelete (AutoDeleteFlag deletion=AutoDeleteThread)
void SetNoAutoDelete ()
virtual void SetPriority (Priority priorityLevel)
virtual void Suspend (BOOL susp=TRUE)
BOOL WaitForTermination (const PTimeInterval &maxWait) const
void WaitForTermination () const
static void Sleep (const PTimeInterval &delay)
 Suspend the current thread for the specified amount of time.

Miscellaneous

virtual PThreadIdentifier GetThreadId () const
virtual void Main ()=0
static PThreadCreate (const PNotifier &notifier, INT parameter=0, AutoDeleteFlag deletion=AutoDeleteThread, Priority priorityLevel=NormalPriority, const PString &threadName=PString::Empty(), PINDEX stackSize=10000)
static PThreadIdentifier GetCurrentThreadId ()
static void Yield ()

I/O functions

virtual void ReadFrom (istream &strm)
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

Public Types

Construction
enum  AutoDeleteFlag { AutoDeleteThread, NoAutoDeleteThread }
 Codes for thread autodelete flag. More...
enum  Priority {
  LowestPriority, LowPriority, NormalPriority, HighPriority,
  HighestPriority, NumPriorities
}
 Codes for thread priorities. More...
Construction
enum  CodeStatus { AlphaCode, BetaCode, ReleaseCode, NumCodeStatuses }
 Release status for the program. More...

Public Member Functions

virtual int _main (void *arg=NULL)
PTime GetStartTime () const
PTimerList * GetTimerList ()
void PXAbortBlock () const
void PXAbortIOBlock (int fd)
int PXBlockOnChildTerminate (int pid, const PTimeInterval &timeout)
int PXBlockOnIO (int handle, int type, const PTimeInterval &timeout)
void PXCheckSignals ()
int PXGetArgc () const
char ** PXGetArgv () const
char ** PXGetEnvp () const
PDirectory PXGetHomeDir ()
virtual void Terminate ()
Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const
Overrides from class PObject
Comparison Compare (const PObject &obj) const
Overrides from class PThread
virtual PString GetThreadName () const
virtual void SetThreadName (const PString &name)
Callback functions
virtual void OnContinue ()
virtual void OnControl ()=0
virtual BOOL OnPause ()
virtual BOOL OnStart ()=0
virtual void OnStop ()
Overrides from PObject
void PrintOn (ostream &strm) const
Construction
 PServiceProcess (const char *manuf, const char *name, WORD majorVersion, WORD minorVersion, CodeStatus status, WORD buildNumber)

Static Public Member Functions

static void PreInitialise (int argc, char **argv, char **envp)
static void PreShutdown ()
static void PXShowSystemWarning (PINDEX code, const PString &str)
static void PXShowSystemWarning (PINDEX code)
Operating System information functions
static PString GetOSClass ()
static PDirectory GetOSConfigDir ()
static PString GetOSHardware ()
static PString GetOSName ()
static PString GetOSVersion ()

Protected Member Functions

void _PXShowSystemWarning (PINDEX num, const PString &str)
void CommonConstruct ()
void CommonDestruct ()
void CreateConfigFilesDictionary ()
void InitialiseProcessThread ()
int InitialiseService ()
void PXOnAsyncSignal (int)
void PXOnSignal (int)

Protected Attributes

PAbstractDictionaryconfigFiles
PSystemLog::Level currentLogLevel
 Current log level for PSYSTEMLOG# calls.
BOOL debugMode
 Flag to indicate service is run in simulation mode.
PXFdDict ioBlocks [3]
BOOL isTerminating
PString pidFileToRemove
int pxSignals
PString systemLogFileName

Private Member Functions

 PCLASSINFO (PServiceProcess, PProcess)

Friends

class PApplication
class PHouseKeepingThread
class PServiceProcess
void PSystemLog::Output (PSystemLog::Level, const char *)
class PTrace::Block
void PXSigHandler (int)
void PXSignalHandler (int)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index