PTLib
Version 2.10.10
|
Class for a process that is a dynamically loaded library. More...
#include <pprocess.h>
Public Member Functions | |
virtual void | Main () |
< Dummy Main() as libraries do not have one. | |
Construction | |
PLibraryProcess (const char *manuf="", const char *name="", WORD majorVersionNum=1, WORD minorVersionNum=0, CodeStatus statusCode=ReleaseCode, WORD buildNum=1) | |
Create a new process instance. | |
![]() | |
PTimerList * | GetTimerList () |
Get the list of timers handled by the application. | |
void | PreInitialise (int argc, char **argv, char **envp) |
Internal initialisation function called directly from InternalMain() . | |
virtual int | InternalMain (void *arg=NULL) |
Main function for process, called from real main after initialisation. | |
~PProcess () | |
PDirectory | PXGetHomeDir () |
virtual void | PXOnSignal (int) |
virtual void | PXOnAsyncSignal (int) |
void | PXCheckSignals () |
void | PXAbortIOBlock (int fd) |
Comparison | Compare (const PObject &obj) const |
Compare two process instances. | |
virtual void | Terminate () |
Terminate the process. | |
virtual PString | GetThreadName () const |
Get the name of the thread. | |
virtual void | SetThreadName (const PString &name) |
Change the name of the thread. | |
PProcess (const char *manuf="", const char *name="", WORD majorVersion=1, WORD minorVersion=0, CodeStatus status=ReleaseCode, WORD buildNumber=1, bool library=false) | |
Create a new process instance. | |
virtual void | OnThreadStart (PThread &thread) |
Callback for when a thread is started by the PTLib system. | |
virtual void | OnThreadEnded (PThread &thread) |
Callback for when a thread is ended if wqas started in the PTLib system. | |
virtual bool | OnInterrupt (bool terminating) |
Callback for when a ^C (SIGINT) or termination request (SIGTERM) is received by process. | |
void | SetTerminationValue (int value) |
Set the termination value for the process. | |
int | GetTerminationValue () const |
Get the termination value for the process. | |
PArgList & | GetArguments () |
Get the programme arguments. | |
virtual const PString & | GetManufacturer () const |
Get the name of the manufacturer of the software. | |
virtual const PString & | GetName () const |
Get the name of the process. | |
virtual PString | GetVersion (PBoolean full=true) const |
Get the version of the software. | |
const PFilePath & | GetFile () const |
Get the processes executable image file path. | |
PProcessIdentifier | GetProcessID () const |
Get the platform dependent process identifier for the process. | |
PTime | GetStartTime () const |
Return the time at which the program was started. | |
PString | GetUserName () const |
Get the effective user name of the owner of the process, eg "root" etc. | |
PBoolean | SetUserName (const PString &username, PBoolean permanent=false) |
Set the effective owner of the process. | |
PString | GetGroupName () const |
Get the effective group name of the owner of the process, eg "root" etc. | |
PBoolean | SetGroupName (const PString &groupname, PBoolean permanent=false) |
Set the effective group of the process. | |
int | GetMaxHandles () const |
Get the maximum file handle value for the process. | |
PBoolean | SetMaxHandles (int newLimit) |
Set the maximum number of file handles for the process. | |
virtual PString | GetConfigurationFile () |
Get the default file to use in PConfig instances. | |
void | SetConfigurationPath (const PString &path) |
Set the default file or set of directories to search for use in PConfig. | |
![]() | |
bool | IsAutoDelete () const |
int | PXBlockOnChildTerminate (int pid, const PTimeInterval &timeout) |
int | PXBlockOnIO (int handle, int type, const PTimeInterval &timeout) |
void | PXAbortBlock () const |
void | PrintOn (ostream &strm) const |
Standard stream print function. | |
PThread (PINDEX, AutoDeleteFlag deletion=AutoDeleteThread, Priority priorityLevel=NormalPriority, const PString &threadName=PString::Empty()) | |
Create a new thread instance. | |
~PThread () | |
Destroy the thread, this simply calls the Terminate() function with all its restrictions and penalties. | |
virtual void | Restart () |
Restart a terminated thread using the same stack priority etc that was current when the thread terminated. | |
virtual PBoolean | IsTerminated () const |
Determine if the thread has been terminated or ran to completion. | |
void | WaitForTermination () const |
Block and wait for the thread to terminate. | |
PBoolean | WaitForTermination (const PTimeInterval &maxWait) const |
Block and wait for the thread to terminate. | |
virtual void | Suspend (PBoolean susp=true) |
Suspend or resume the thread. | |
virtual void | Resume () |
Resume thread execution, this is identical to Suspend(false) . | |
virtual PBoolean | IsSuspended () const |
Determine if the thread is currently suspended. | |
virtual void | SetPriority (Priority priorityLevel) |
Set the priority of the thread relative to other threads in the current process. | |
virtual Priority | GetPriority () const |
Get the current priority of the thread in the current process. | |
virtual void | SetAutoDelete (AutoDeleteFlag deletion=AutoDeleteThread) |
Set the flag indicating thread object is to be automatically deleted when the thread ends. | |
void | SetNoAutoDelete () |
Reet the flag indicating thread object is to be automatically deleted when the thread ends. | |
virtual PThreadIdentifier | GetThreadId () const |
Get operating system specific thread identifier for this thread. | |
bool | GetTimes (Times ×) |
Get the thread execution times. | |
![]() | |
virtual | ~PObject () |
virtual PObject * | Clone () const |
Create a copy of the class on the heap. | |
virtual PINDEX | HashFunction () const |
This function yields a hash value required by the PDictionary class. | |
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const |
Determine the byte wise comparison of two objects. | |
bool | operator== (const PObject &obj) const |
Compare the two objects. | |
bool | operator!= (const PObject &obj) const |
Compare the two objects. | |
bool | operator< (const PObject &obj) const |
Compare the two objects. | |
bool | operator> (const PObject &obj) const |
Compare the two objects. | |
bool | operator<= (const PObject &obj) const |
Compare the two objects. | |
bool | operator>= (const PObject &obj) const |
Compare the two objects. | |
virtual const char * | GetClass (unsigned ancestor=0) const |
Get the current dynamic type of the object instance. | |
PBoolean | IsClass (const char *cls) const |
virtual PBoolean | InternalIsDescendant (const char *clsName) const |
Determine if the dynamic type of the current instance is a descendent of the specified class. | |
virtual void | ReadFrom (istream &strm) |
Input the contents of the object from the stream. |
Additional Inherited Members | |
![]() | |
enum | CodeStatus { AlphaCode, BetaCode, ReleaseCode, NumCodeStatuses } |
Release status for the program. More... | |
![]() | |
enum | Priority { LowestPriority, LowPriority, NormalPriority, HighPriority, HighestPriority, NumPriorities } |
Codes for thread priorities. More... | |
enum | AutoDeleteFlag { AutoDeleteThread, NoAutoDeleteThread } |
Codes for thread autodelete flag. More... | |
![]() | |
enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 } |
Result of the comparison operation performed by the Compare() function. More... | |
![]() | |
static void | PreShutdown () |
Internal shutdown function called directly from the ~PProcess InternalMain() . | |
static void | PostShutdown () |
static void | PXShowSystemWarning (PINDEX code) |
static void | PXShowSystemWarning (PINDEX code, const PString &str) |
static PString | GetOSClass () |
Get the class of the operating system the process is running on, eg "unix". | |
static PString | GetOSName () |
Get the name of the operating system the process is running on, eg "Linux". | |
static PString | GetOSHardware () |
Get the hardware the process is running on, eg "sparc". | |
static PString | GetOSVersion () |
Get the version of the operating system the process is running on, eg "2.0.33". | |
static bool | IsOSVersion (unsigned major, unsigned minor=0, unsigned build=0) |
See if operating system is later than the version specified. | |
static PDirectory | GetOSConfigDir () |
Get the configuration directory of the operating system the process is running on, eg "/etc" for Unix, "c:\windows" for Win95 or "c:\winnt\system32\drivers\etc" for NT. | |
static PString | GetLibVersion () |
Get the version of the PTLib library the process is running on, eg "2.5beta3". | |
static PProcess & | Current () |
Get the current processes object instance. | |
static PBoolean | IsInitialised () |
Determine if the current processes object instance has been initialised. | |
static PProcessIdentifier | GetCurrentProcessID () |
Get the platform dependent process identifier for the currentprocess. | |
![]() | |
typedef std::map < PThreadIdentifier, PThread * > | ThreadMap |
![]() | |
void | Construct () |
PDICTIONARY (PXFdDict, POrdinalKey, PThread) | |
void | CommonConstruct () |
void | CommonDestruct () |
virtual void | _PXShowSystemWarning (PINDEX code, const PString &str) |
void | CreateConfigFilesDictionary () |
![]() | |
bool | m_library |
int | terminationValue |
PString | manufacturer |
PString | productName |
WORD | majorVersion |
WORD | minorVersion |
CodeStatus | status |
WORD | buildNumber |
PFilePath | executableFile |
PStringArray | configurationPaths |
PArgList | arguments |
int | maxHandles |
PTime | programStartTime |
bool | m_shuttingDown |
ThreadMap | m_activeThreads |
PMutex | m_activeThreadMutex |
PTimerList | timers |
PProcessIdentifier | m_processID |
int | pxSignals |
PAbstractDictionary * | configFiles |
PXFdDict | ioBlocks [3] |
![]() |
Class for a process that is a dynamically loaded library.
|
inline |
Create a new process instance.
manuf | Name of manufacturer |
name | Name of product |
majorVersionNum | Major version number of the product |
minorVersionNum | Minor version number of the product |
statusCode | Development status of the product |
buildNum | Build number of the product |
|
inlinevirtual |