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

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends

PProcess Class Reference

#include <pprocess.h>

Inheritance diagram for PProcess:
Inheritance graph
[legend]
Collaboration diagram for PProcess:
Collaboration graph
[legend]

List of all members.

Public Types

Construction
enum  Priority {
  LowestPriority, LowPriority, NormalPriority, HighPriority,
  HighestPriority, NumPriorities
}
 

Codes for thread priorities.

More...
enum  AutoDeleteFlag { AutoDeleteThread, NoAutoDeleteThread }
 

Codes for thread autodelete flag.

More...

Public Member Functions

virtual int _main (void *arg=NULL)
PTime GetStartTime () const
PTimerListGetTimerList ()
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)
Overrides from class PObject
Comparison Compare (const PObject &obj) const
Overrides from class PThread
virtual void Terminate ()
virtual PString GetThreadName () const
virtual void SetThreadName (const PString &name)
Overrides from PObject
void PrintOn (ostream &strm) const
Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const

Static Public Member Functions

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

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)

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

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

Control functions

virtual void Restart ()
virtual BOOL IsTerminated () const
void WaitForTermination () const
BOOL WaitForTermination (const PTimeInterval &maxWait) const
virtual void Suspend (BOOL susp=TRUE)
virtual void Resume ()
virtual BOOL IsSuspended () const
virtual void SetPriority (Priority priorityLevel)
virtual Priority GetPriority () const
virtual void SetAutoDelete (AutoDeleteFlag deletion=AutoDeleteThread)
void SetNoAutoDelete ()
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 PThreadIdentifier GetCurrentThreadId ()
static void Yield ()
static PThreadCreate (const PNotifier &notifier, INT parameter=0, AutoDeleteFlag deletion=AutoDeleteThread, Priority priorityLevel=NormalPriority, const PString &threadName=PString::Empty(), PINDEX stackSize=10000)

Run Time Type functions

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

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.


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

Generated by  Doxygen 1.6.0   Back to index