VkProgram(3x) VkProgram(3x)
VkProgram - Object-oriented interface to subprogram execution
VkCallbackObject :
#include <Vk/VkProgram.h>
PUBLIC PROTOCOL SUMMARY
Constructor/Destructor
VkProgram(const char* cmd, int killChildOnExit = 1);
virtual void ~VkProgram(void);
Control Functions [Toc] [Back]
virtual VkSubProcess run(void);
Setup Functions [Toc] [Back]
void redirectIn(int do_redirect);
PROTECTED PROTOCOL SUMMARY [Toc] [Back] Protected Data Members
char* _cmd;
const int _killChildOnExit;
int _redirectIn;
The VkProgram class is an object-oriented interface to fork/exec.
It spawns a program and passes the output back to the application.
FUNCTION DESCRIPTIONS [Toc] [Back] VkProgram()
VkProgram(const char* cmd,
int killChildOnExit = 1);
virtual void ~VkProgram(void);
Sets up the VkProgram object. The first argument specifies a
command to execute when the run() method is called. The second
argument indicates that the running child, if any, should be killed
whenever this process exits.
run()
virtual VkSubProcess run(void);
Page 1
VkProgram(3x) VkProgram(3x)
Forks and execs a child process, running the command specified in
the constructor. Returns the VkSubProcess object created as a
result.
redirectIn()
void redirectIn(int do_redirect);
If the argument is non-zero, indicates that an input pipe should be
setup when the child process is created, giving the application the
ability to send input to the process.
DATA MEMBER DESCRIPTIONS [Toc] [Back] _cmd
char* _cmd;
The command to be executed.
_killChildOnExit
const int _killChildOnExit;
Whether to set the child process options so that it terminates
whenever the parent process terminates.
_redirectIn
int _redirectIn;
Whether to setup an input pipe.
exitCallback
static const const char* exitCallback;
This callback is called when the child process exits. The callData
is an integer (cast to type void *) that reports the exit status.
This callback is passed on to an instance of VkSubProcess, so the
VkCallbackObject passed as the first argument is actually an
instance of VkSubProcess.
stdoutCallback
static const const char* stdoutCallback;
This callback is called when the child process has output directed
to stdout. The VkCallbackObject pointer passed as the first argument
is a VkInput object, because this callback is passed down a chain of
objects that ultimately ends with a VkInput object that handled
input from stdout.
Page 2
VkProgram(3x) VkProgram(3x)
stderrCallback
static const const char* stderrCallback;
This callback is called when the child process has output directed
to stderr. The VkCallbackObject pointer passed as the first argument
is a VkInput object, because this callback is passed down a chain of
objects that ultimately ends with a VkInput object that handled
input from stderr.
INHERITED MEMBER FUNCTIONS [Toc] [Back] Inherited from VkCallbackObject
callCallbacks() className(), addCallback(), removeCallback(),
removeAllCallbacks(), hasCallbacks(), cloneCallbacks(),
cloneCallback()
KNOWN DERIVED CLASSES [Toc] [Back]VIEWKIT 2.1 CHANGES
Control Funtions
virtual VkSubProcess run(VkScreen *screen);
this additional API provides support for multi-screen
applications...
CLASSES USED BY THIS CLASS
VkSubProcess
SEE ALSO
VkCallbackObject, VkSubProcess
ViewKit Programmer's Guide
The X Window System, DEC Press, Bob Sheifler and Jim Gettys
The X Window System Toolkit, DEC Press, Paul Asente and Ralph Swick
The OSF/Motif Programmers Reference, Prentice Hall, OSF
PPPPaaaaggggeeee 3333 [ Back ]
|