wxIScan
wxExtThread Class Reference

Extended thread class. More...

#include <wxextthread.h>

Inheritance diagram for wxExtThread:
wxImagePanelThread

List of all members.

Public Types

enum  {
  ID_ENTRY = 65312,
  ID_EXIT
}

Public Member Functions

 wxExtThread (wxEvtHandler *poEvtHandler, int nEventInt=0)
 Standard constructor.
virtual ~wxExtThread ()
 Virtual destructor.
virtual ExitCode Entry ()
 Thread execution starts here.
virtual void OnExit ()
 Thread termination.
virtual void AddPendingEvent (const long nEventId)
 Helper function to send events to the owning event handler.

Protected Attributes

wxEvtHandler * m_poEvtHandler
 A pointer to the event handler that owns this thread.
int m_nEventInt
 An event value (e. g. for identifying the thread).

Detailed Description

Extended thread class.

wxExtThread extends the wxThread class by some methods that send messages to the owning wxEventHandler object in order to signal thread entry and exit.

Definition at line 22 of file wxextthread.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
ID_ENTRY 
ID_EXIT 

Definition at line 81 of file wxextthread.h.

    {
        ID_ENTRY= 65312,
        ID_EXIT
    };

Constructor & Destructor Documentation

wxExtThread::wxExtThread ( wxEvtHandler *  poEvtHandler,
int  nEventInt = 0 
) [inline]

Standard constructor.

Parameters:
poEvtHandlerA pointer to the event handler that owns the thread.
nEventIntA possible ID to post to the event handler.

Definition at line 29 of file wxextthread.h.

References m_nEventInt, and m_poEvtHandler.

      : wxThread()
    {
        m_poEvtHandler= poEvtHandler;
        m_nEventInt= nEventInt;
    }
virtual wxExtThread::~wxExtThread ( ) [inline, virtual]

Virtual destructor.

Definition at line 37 of file wxextthread.h.

    {
    }

Member Function Documentation

virtual void wxExtThread::AddPendingEvent ( const long  nEventId) [inline, virtual]

Helper function to send events to the owning event handler.

Parameters:
nEventIdmultipurpose interface event (e. g. an identifier for the thread)

Definition at line 66 of file wxextthread.h.

References m_nEventInt, and m_poEvtHandler.

Referenced by Entry(), and OnExit().

    {
        wxCommandEvent oEvent( wxEVT_COMMAND_MENU_SELECTED, nEventId );

        oEvent.SetInt( m_nEventInt );
        m_poEvtHandler->AddPendingEvent( oEvent );
    }
virtual ExitCode wxExtThread::Entry ( ) [inline, virtual]

Thread execution starts here.

Reimplemented in wxImagePanelThread.

Definition at line 42 of file wxextthread.h.

References AddPendingEvent(), and ID_ENTRY.

    {
        // Send the entry event.
        AddPendingEvent( ID_ENTRY );

        // Return with exit code 0 (success).
        return 0;
    }
virtual void wxExtThread::OnExit ( ) [inline, virtual]

Thread termination.

Note: This handler function ist called when the thread exits whether it terminates normally or is stopped by a call to Delete() (but NOT when it is KILLed!).

Definition at line 56 of file wxextthread.h.

References AddPendingEvent(), and ID_EXIT.

    {
        // Send the exit event.
        AddPendingEvent( ID_EXIT );
    }

Member Data Documentation

int wxExtThread::m_nEventInt [protected]

An event value (e. g. for identifying the thread).

Definition at line 77 of file wxextthread.h.

Referenced by AddPendingEvent(), wxImagePanelThread::Entry(), and wxExtThread().

wxEvtHandler* wxExtThread::m_poEvtHandler [protected]

A pointer to the event handler that owns this thread.

Definition at line 76 of file wxextthread.h.

Referenced by AddPendingEvent(), wxImagePanelThread::Entry(), and wxExtThread().


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