PTLib Version 2.12.9

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PThreadObj2Arg< ObjType, Arg1Type, Arg2Type > Class Template Reference

`#include <thread.h>`

Inheritance diagram for PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >:
[legend]
Collaboration diagram for PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >:
[legend]

## Public Types
typedef void(ObjType::* | ObjTypeFn )(Arg1Type, Arg2Type)
Public Types inherited from PThread
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
| PThreadObj2Arg (ObjType &obj, Arg1Type arg1, Arg2Type arg2, ObjTypeFn function, bool autoDel=false, const char *name=NULL, PThread::Priority priority=PThread::NormalPriority)
void | Main ()
| User override function for the main execution routine of the thread. More...
Public Member Functions inherited from PThread
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. More...
| PThread (PINDEX stack, AutoDeleteFlag deletion=AutoDeleteThread, Priority priorityLevel=NormalPriority, const PString &threadName=PString::Empty())
| Create a new thread instance. More...
| ~PThread ()
| Destroy the thread, this simply calls the `Terminate()` function with all its restrictions and penalties. More...
virtual void | Restart ()
| Restart a terminated thread using the same stack priority etc that was current when the thread terminated. More...
virtual void | Terminate ()
| Terminate the thread. More...
virtual PBoolean | IsTerminated () const
| Determine if the thread has been terminated or ran to completion. More...
void | WaitForTermination () const
| Block and wait for the thread to terminate. More...
PBoolean | WaitForTermination (const PTimeInterval &maxWait) const
| Block and wait for the thread to terminate. More...
virtual void | Suspend (PBoolean susp=true)
| Suspend or resume the thread. More...
virtual void | Resume ()
| Resume thread execution, this is identical to `Suspend(false)`. More...
virtual PBoolean | IsSuspended () const
| Determine if the thread is currently suspended. More...
virtual void | SetPriority (Priority priorityLevel)
| Set the priority of the thread relative to other threads in the current process. More...
virtual Priority | GetPriority () const
| Get the current priority of the thread in the current process. More...
virtual void | SetAutoDelete (AutoDeleteFlag deletion=AutoDeleteThread)
| Set the flag indicating thread object is to be automatically deleted when the thread ends. More...
void | SetNoAutoDelete ()
| Reet the flag indicating thread object is to be automatically deleted when the thread ends. More...
virtual PString | GetThreadName () const
| Get the name of the thread. More...
virtual void | SetThreadName (const PString &name)
| Change the name of the thread. More...
virtual PThreadIdentifier | GetThreadId () const
| Get operating system specific thread identifier for this thread. More...
bool | GetTimes (Times &times)
| Get the thread execution times. More...
Public Member Functions inherited from PObject
unsigned | GetTraceContextIdentifier () const
| Get PTRACE context identifier. More...
void | SetTraceContextIdentifier (unsigned id)
void | GetTraceContextIdentifier (PObject &obj)
void | GetTraceContextIdentifier (PObject *obj)
void | SetTraceContextIdentifier (const PObject &obj)
void | SetTraceContextIdentifier (const PObject *obj)
virtual | ~PObject ()
virtual PObject * | Clone () const
| Create a copy of the class on the heap. More...
template<class CLS >
CLS * | CloneAs () const
| As for Clone() but converts to specified type. More...
virtual PINDEX | HashFunction () const
| This function yields a hash value required by the `PDictionary` class. More...
virtual const char * | GetClass (unsigned ancestor=0) const
| Get the current dynamic type of the object instance. More...
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. More...
__inline const PObject * | PTraceObjectInstance () const
virtual Comparison | Compare (const PObject &obj) const
| Compare the two objects and return their relative rank. More...
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const
| Determine the byte wise comparison of two objects. More...
bool | operator== (const PObject &obj) const
| Compare the two objects. More...
bool | operator!= (const PObject &obj) const
| Compare the two objects. More...
bool | operator< (const PObject &obj) const
| Compare the two objects. More...
bool | operator> (const PObject &obj) const
| Compare the two objects. More...
bool | operator<= (const PObject &obj) const
| Compare the two objects. More...
bool | operator>= (const PObject &obj) const
| Compare the two objects. More...
virtual void | ReadFrom (istream &strm)
| Input the contents of the object from the stream. More...

## Protected Member Functions
ObjTypeFn | P_ALIGN_FIELD (m_function, 8)

## Protected Attributes
ObjType & | m_object
Arg1Type | m_arg1
Arg2Type | m_arg2
Protected Attributes inherited from PThread
enum PThread::Type | m_type
PINDEX | m_originalStackSize
PString | m_threadName
PMutex | m_threadNameMutex
PThreadIdentifier | m_threadId
LocalStorageList | m_localStorage
Protected Attributes inherited from PObject
unsigned | m_traceContextIdentifier

## Additional Inherited Members
Static Public Member Functions inherited from PThread
static void | Sleep (const PTimeInterval &delay)
| Suspend the current thread for the specified amount of time. More...
static PThreadIdentifier | GetCurrentThreadId ()
static PThread * | Current ()
| Get the currently running thread object instance. More...
static void | Yield ()
| Yield to another thread without blocking. More...
static PThread * | Create (const PNotifier &notifier, INT parameter=0, AutoDeleteFlag deletion=AutoDeleteThread, Priority priorityLevel=NormalPriority, const PString &threadName=PString::Empty(), PINDEX stackSize=0)
| Create a simple thread executing the specified notifier. More...
static PThread * | Create (const PNotifier &notifier, const PString &threadName)
Static Public Member Functions inherited from PObject
static const char * | Class ()
| Get the name of the class as a C string. More...
static __inline const PObject * | PTraceObjectInstance (const char *)
static __inline const PObject * | PTraceObjectInstance (const PObject *obj)
static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
| Internal function caled from CompareObjectMemoryDirect() More...
Protected Types inherited from PThread
enum | Type { e_IsAutoDelete, e_IsManualDelete, e_IsProcess, e_IsExternal }
typedef std::list< const LocalStorageBase * > | LocalStorageList
Friends inherited from PObject

## Member Typedef Documentation

template<class ObjType , typename Arg1Type , typename Arg2Type >

typedef void(ObjType::* PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::ObjTypeFn)(Arg1Type, Arg2Type)

## Constructor & Destructor Documentation

template<class ObjType , typename Arg1Type , typename Arg2Type >

PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::PThreadObj2Arg | ( | ObjType & | obj,
|  | Arg1Type | arg1,
|  | Arg2Type | arg2,
|  | ObjTypeFn | function,
|  | bool | autoDel = `false`,
|  | const char * | name = `NULL`,
|  | PThread::Priority | priority = `PThread::NormalPriority`
| ) |  |
| inline

References PThread::Resume().

## Member Function Documentation

template<class ObjType , typename Arg1Type , typename Arg2Type >

void PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::Main | ( |  | ) |
| inline virtual

User override function for the main execution routine of the thread.

A descendent class must provide the code that will be executed in the thread within this function.

Note that the correct way for a thread to terminate is to return from this function.

Implements PThread.

References PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::m_arg1, PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::m_arg2, and PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::m_object.

template<class ObjType , typename Arg1Type , typename Arg2Type >

ObjTypeFn PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::P_ALIGN_FIELD | ( | m_function | ,
|  | 8 |
| ) |  |
| protected

## Member Data Documentation

template<class ObjType , typename Arg1Type , typename Arg2Type >

Arg1Type PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::m_arg1
| protected

Referenced by PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::Main().

template<class ObjType , typename Arg1Type , typename Arg2Type >

Arg2Type PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::m_arg2
| protected

Referenced by PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::Main().

template<class ObjType , typename Arg1Type , typename Arg2Type >

ObjType& PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::m_object
| protected

Referenced by PThreadObj2Arg< ObjType, Arg1Type, Arg2Type >::Main().

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

- thread.h