wxIScan
wxExtProcess Class Reference

An extended wxProcess based class. More...

#include <wxextprocess.h>

Inheritance diagram for wxExtProcess:
wxExtProcessDelTempFile

List of all members.

Public Member Functions

 wxExtProcess (wxEvtHandler *poParent, int nId=-1)
 Standard constructor copied from base class.
virtual ~wxExtProcess ()
 Virtual destructor.
virtual long Execute (const wxString &strCommand, int nSync=wxEXEC_ASYNC)
 Execute the external process and save the process id.
virtual void SetProcessId (long nProcessId)
 Set the process id of the external process.
virtual long GetProcessId ()
 Get the process id of the external process.
virtual wxKillError Kill (wxSignal nSignal=wxSIGNONE, int nFlags=wxKILL_NOCHILDREN)
 "Kill" a running process.

Protected Attributes

long m_nProcessId
 Holds the process id of the process.

Detailed Description

An extended wxProcess based class.

It extends wxProcess in a way that it is possible to kill an external process by saving the process id so you do not have to know it when you want to kill the process. Just call its member function Kill().

Definition at line 26 of file wxextprocess.h.


Constructor & Destructor Documentation

wxExtProcess::wxExtProcess ( wxEvtHandler *  poParent,
int  nId = -1 
) [inline]

Standard constructor copied from base class.

Parameters:
poParenta pointer to the event handler parent
nIdid of the wxEVT_END_PROCESS notification event

Definition at line 33 of file wxextprocess.h.

      : wxProcess( poParent, nId ), m_nProcessId( 0 )
    {
    }
virtual wxExtProcess::~wxExtProcess ( ) [inline, virtual]

Virtual destructor.

Definition at line 39 of file wxextprocess.h.

    {
    }

Member Function Documentation

virtual long wxExtProcess::Execute ( const wxString &  strCommand,
int  nSync = wxEXEC_ASYNC 
) [inline, virtual]

Execute the external process and save the process id.

Parameters:
strCommandcommand to execute
nSyncflag to indicate wether to execute the process synchronously or asynchronously

Definition at line 48 of file wxextprocess.h.

References m_nProcessId.

Referenced by wxIScanFrame::Execute().

    {
        m_nProcessId= ::wxExecute( strCommand, nSync, this );
        return m_nProcessId;
    }
virtual long wxExtProcess::GetProcessId ( ) [inline, virtual]

Get the process id of the external process.

Definition at line 63 of file wxextprocess.h.

References m_nProcessId.

Referenced by Kill().

    {
        return m_nProcessId;
    }
virtual wxKillError wxExtProcess::Kill ( wxSignal  nSignal = wxSIGNONE,
int  nFlags = wxKILL_NOCHILDREN 
) [inline, virtual]

"Kill" a running process.

Parameters:
nSignalsignal (see description of wxProcess)
nFlagsflags (see description of wxProcess)

Definition at line 72 of file wxextprocess.h.

References GetProcessId().

Referenced by wxIScanFrame::OnCmdStop(), and wxIScanFrame::~wxIScanFrame().

    {
        return wxProcess::Kill( GetProcessId(), nSignal, nFlags );
    }
virtual void wxExtProcess::SetProcessId ( long  nProcessId) [inline, virtual]

Set the process id of the external process.

Parameters:
nProcessIdprocess id of the external process

Definition at line 57 of file wxextprocess.h.

References m_nProcessId.

    {
        m_nProcessId= nProcessId;
    }

Member Data Documentation

long wxExtProcess::m_nProcessId [protected]

Holds the process id of the process.

Definition at line 79 of file wxextprocess.h.

Referenced by Execute(), GetProcessId(), and SetProcessId().


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