Logo Search packages:      
Sourcecode: pwlib version File versions

PProcess Class Reference

#include <pprocess.h>

Inheritance diagram for PProcess:

PThread PObject PServiceProcess

List of all members.


Detailed Description

This class represents an operating system process. This is a running "programme" in the context of the operating system. Note that there can only be one instance of a PProcess class in a given programme.

The instance of a PProcess or its GUI descendent PApplication# is usually a static variable created by the application writer. This is the initial "anchor" point for all data structures in an application. As the application writer never needs to access the standard system main()# function, it is in the library, the programmes execution begins with the virtual function PThread::Main()# on a process.

Definition at line 366 of file pprocess.h.


Construction

enum  CodeStatus { AlphaCode, BetaCode, ReleaseCode, NumCodeStatuses }
 Release status for the program. More...
 PProcess (const char *manuf="", const char *name="", WORD majorVersion=1, WORD minorVersion=0, CodeStatus status=ReleaseCode, WORD buildNumber=1)

Comparison functions

enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
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

I/O functions

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

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 PProcessCurrent ()
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 ()

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 ()

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...

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 PXOnAsyncSignal (int)
virtual void PXOnSignal (int)
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)
virtual void Terminate ()
Overrides from PObject
void PrintOn (ostream &strm) const

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

virtual void _PXShowSystemWarning (PINDEX code, const PString &str)
void CommonConstruct ()
void CommonDestruct ()
void CreateConfigFilesDictionary ()
void InitialiseProcessThread ()

Protected Attributes

PAbstractDictionaryconfigFiles
PXFdDict ioBlocks [3]
int pxSignals

Private Member Functions

void Construct ()
 PCLASSINFO (PProcess, PThread)
 PDICTIONARY (PXFdDict, POrdinalKey, PThread)

Private Attributes

PArgList arguments
WORD buildNumber
PStringList configurationPaths
PFilePath executableFile
WORD majorVersion
PString manufacturer
int maxHandles
WORD minorVersion
PString productName
PTime programStartTime
CodeStatus status
int terminationValue
PTimerList timers

Static Private Attributes

static int p_argc
static char ** p_argv
static char ** p_envp

Friends

class PApplication
class PHouseKeepingThread
class PServiceProcess
class PThread
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