Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

Y2ProgramComponent Class Reference

#include <Y2ProgramComponent.h>

Inheritance diagram for Y2ProgramComponent:

Y2Component List of all members.

Public Member Functions

 Y2ProgramComponent (string chroot_path, string binpath, const char *component_name, bool non_y2, int level)
 ~Y2ProgramComponent ()
string name () const
YCPValue evaluate (const YCPValue &command)
void result (const YCPValue &result)
void setServerOptions (int argc, char **argv)
YCPValue doActualWork (const YCPList &arglist, Y2Component *user_interface)

Private Member Functions

void launchExternalProgram (char **argv)
void terminateExternalProgram ()
YCPValue receiveFromExternal ()
void sendToExternal (const YCPValue &)
bool externalProgramOK () const

Private Attributes

string chroot_path
string bin_file
bool is_non_y2
string component_name
int argc
char ** argv
int to_external [2]
int from_external [2]
pid_t pid
Parser parser
int level

Constructor & Destructor Documentation

Y2ProgramComponent::Y2ProgramComponent string  chroot_path,
string  binpath,
const char *  component_name,
bool  non_y2,
int  level
 

Y2ProgramComponent::~Y2ProgramComponent  ) 
 

Frees internal data.


Member Function Documentation

YCPValue Y2ProgramComponent::doActualWork const YCPList arglist,
Y2Component user_interface
[virtual]
 

Launches the program with the previously set parameters

Reimplemented from Y2Component.

YCPValue Y2ProgramComponent::evaluate const YCPValue command  )  [virtual]
 

Let the server evaluate a command.

This method is only valid, if the component is a server.

Reimplemented from Y2Component.

bool Y2ProgramComponent::externalProgramOK  )  const [private]
 

Determines, if the external program is running.

void Y2ProgramComponent::launchExternalProgram char **  argv  )  [private]
 

Lauches the external programm in a new process.

Returns:
true, if this was successful.

string Y2ProgramComponent::name  )  const [virtual]
 

Returns the name of this component.

Implements Y2Component.

YCPValue Y2ProgramComponent::receiveFromExternal  )  [private]
 

Receives a YCP value from the external program.

void Y2ProgramComponent::result const YCPValue result  )  [virtual]
 

Tells this server, that the client doesn't need it's services any longer and that the exit code of the client is result.

This method is only valid, if the component is a server.

Reimplemented from Y2Component.

void Y2ProgramComponent::sendToExternal const YCPValue  )  [private]
 

Send a YCP value to the external program

void Y2ProgramComponent::setServerOptions int  argc,
char **  argv
[virtual]
 

Sets the commandline options of the server.

This method is only valid, if the component is a server.

Reimplemented from Y2Component.

void Y2ProgramComponent::terminateExternalProgram  )  [private]
 

Kills the external program (that is process) with SIGQUIT


Member Data Documentation

int Y2ProgramComponent::argc [private]
 

Stores options for a server program

char** Y2ProgramComponent::argv [private]
 

Stores options for a server program

string Y2ProgramComponent::bin_file [private]
 

Filename of the executable binary.

string Y2ProgramComponent::chroot_path [private]
 

Chroot path for the program.

string Y2ProgramComponent::component_name [private]
 

Name of the component that is implemented by the program

int Y2ProgramComponent::from_external[2] [private]
 

Filehandles of pipe from external programm

bool Y2ProgramComponent::is_non_y2 [private]
 

Specifies whether this component is a ycp program or a shell and such like.

int Y2ProgramComponent::level [private]
 

The component level this program was started in. For example programs started from floppy get the component level 0.

Parser Y2ProgramComponent::parser [private]
 

Used to parse the values the external program sends

pid_t Y2ProgramComponent::pid [private]
 

Process ID of external process. This is -1, if the process is not yet launched.

int Y2ProgramComponent::to_external[2] [private]
 

Filehandles of pipe to external programm


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:24 2007 for yast2-core by doxygen 1.3.6