Code::Blocks  SVN r11506
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
PipedProcess Class Reference

#include <pipedprocess.h>

Inheritance diagram for PipedProcess:
Collaboration diagram for PipedProcess:

Public Member Functions

 PipedProcess (PipedProcess **pvThis, wxEvtHandler *parent, int id=wxID_ANY, bool pipe=true, const wxString &dir=wxEmptyString, int index=-1)
 
 ~PipedProcess () override
 
virtual int Launch (const wxString &cmd, unsigned int pollingInterval=100)
 
virtual void SendString (const wxString &text)
 
virtual bool HasInput ()
 
virtual int GetPid ()
 
void ForfeitStreams ()
 
- Public Member Functions inherited from wxProcess
 wxProcess (wxEvtHandler *parent=NULL, int id=-1)
 
 wxProcess (int flags)
 
virtual ~wxProcess ()
 
void CloseOutput ()
 
void Detach ()
 
wxInputStreamGetErrorStream () const
 
wxInputStreamGetInputStream () const
 
wxOutputStreamGetOutputStream () const
 
long GetPid () const
 
bool IsErrorAvailable () const
 
bool IsInputAvailable () const
 
bool IsInputOpened () const
 
void Redirect ()
 
void SetPriority (unsigned priority)
 

Protected Member Functions

void OnTerminate (int pid, int status) override
 
virtual void OnTimer (wxTimerEvent &event)
 
virtual void OnIdle (wxIdleEvent &event)
 

Protected Attributes

wxEvtHandlerm_Parent
 
wxTimer m_timerPollProcess
 
int m_Id
 
int m_Pid
 
int m_Index
 When there are multiple processes started you could use this to distinguish between different processes. More...
 
bool m_Stopped
 

Private Attributes

PipedProcess ** m_pvThis
 

Additional Inherited Members

- Static Public Member Functions inherited from wxProcess
static bool Exists (int pid)
 
static wxKillError Kill (int pid, wxSignal sig=wxSIGTERM, int flags=wxKILL_NOCHILDREN)
 
static wxProcessOpen (const wxString &cmd, int flags=wxEXEC_ASYNC)
 

Detailed Description

Definition at line 18 of file pipedprocess.h.

Constructor & Destructor Documentation

◆ PipedProcess()

PipedProcess::PipedProcess ( PipedProcess **  pvThis,
wxEvtHandler parent,
int  id = wxID_ANY,
bool  pipe = true,
const wxString dir = wxEmptyString,
int  index = -1 
)

Definition at line 111 of file pipedprocess.cpp.

References wxString::empty(), UnixFilename(), and wxSetWorkingDirectory().

◆ ~PipedProcess()

PipedProcess::~PipedProcess ( )
override

Definition at line 129 of file pipedprocess.cpp.

Member Function Documentation

◆ ForfeitStreams()

void PipedProcess::ForfeitStreams ( )

Definition at line 158 of file pipedprocess.cpp.

References wxTextInputStream::GetInputStream().

◆ GetPid()

virtual int PipedProcess::GetPid ( )
inlinevirtual

Definition at line 29 of file pipedprocess.h.

References wxProcess::OnTerminate().

◆ HasInput()

bool PipedProcess::HasInput ( )
virtual

◆ Launch()

int PipedProcess::Launch ( const wxString cmd,
unsigned int  pollingInterval = 100 
)
virtual

Definition at line 134 of file pipedprocess.cpp.

References wxEXEC_ASYNC, wxEXEC_MAKE_GROUP_LEADER, and wxExecute().

◆ OnIdle()

void PipedProcess::OnIdle ( wxIdleEvent event)
protectedvirtual

Definition at line 238 of file pipedprocess.cpp.

◆ OnTerminate()

void PipedProcess::OnTerminate ( int  pid,
int  status 
)
overrideprotectedvirtual

Reimplemented from wxProcess.

Definition at line 217 of file pipedprocess.cpp.

References cbEVT_PIPEDPROCESS_TERMINATED, and wxPostEvent().

◆ OnTimer()

void PipedProcess::OnTimer ( wxTimerEvent event)
protectedvirtual

Definition at line 233 of file pipedprocess.cpp.

References wxWakeUpIdle().

◆ SendString()

void PipedProcess::SendString ( const wxString text)
virtual

Definition at line 146 of file pipedprocess.cpp.

References _T, and wxTextOutputStream::WriteString().

Referenced by DebuggerGDB::DoSendCommand().

Member Data Documentation

◆ m_Id

int PipedProcess::m_Id
protected

Definition at line 38 of file pipedprocess.h.

◆ m_Index

int PipedProcess::m_Index
protected

When there are multiple processes started you could use this to distinguish between different processes.

You could also use the id, but then you must preallocate too many ids and with the growing number of threads available in contemporary machines, this becomes unfeasible. It is sent back in the X variable of the CodeBlocksEvent.

Definition at line 46 of file pipedprocess.h.

◆ m_Parent

wxEvtHandler* PipedProcess::m_Parent
protected

Definition at line 36 of file pipedprocess.h.

◆ m_Pid

int PipedProcess::m_Pid
protected

Definition at line 39 of file pipedprocess.h.

◆ m_pvThis

PipedProcess** PipedProcess::m_pvThis
private

Definition at line 50 of file pipedprocess.h.

◆ m_Stopped

bool PipedProcess::m_Stopped
protected

Definition at line 48 of file pipedprocess.h.

◆ m_timerPollProcess

wxTimer PipedProcess::m_timerPollProcess
protected

Definition at line 37 of file pipedprocess.h.


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