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

Y2ProgramComponent.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                      __   __    ____ _____ ____                      |
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00005 |                       \ V / _` \___ \ | |   __) |                    |
00006 |                        | | (_| |___) || |  / __/                     |
00007 |                        |_|\__,_|____/ |_| |_____|                    |
00008 |                                                                      |
00009 |                               core system                            |
00010 |                                                        (C) SuSE GmbH |
00011 \----------------------------------------------------------------------/
00012 
00013    File:       Y2ProgramComponent.h
00014 
00015    Author:     Mathias Kettner <kettner@suse.de>
00016    Maintainer: Arvin Schnell <arvin@suse.de>
00017 
00018 /-*/
00019 // -*- c++ -*-
00020 
00021 /*
00022  * Component that starts an external Y2 program
00023  */
00024 
00025 #ifndef Y2ProgramComponent_h
00026 #define Y2ProgramComponent_h
00027 
00028 #include "Y2.h"
00029 #include <ycp/Parser.h>
00030 
00031 class Y2ProgramComponent : public Y2Component
00032 {
00036     string chroot_path;
00037 
00041     string bin_file;
00042 
00046     bool is_non_y2;
00047 
00051     string component_name;
00052 
00056     int argc;
00057 
00061     char **argv;
00062 
00066     int to_external[2];
00067 
00071     int from_external[2];
00072 
00077     pid_t pid;
00078 
00082     Parser parser;
00083 
00088     int level;
00089 
00090 public:
00091 
00092     Y2ProgramComponent (string chroot_path, string binpath,
00093                         const char *component_name, bool non_y2, int level);
00094 
00098     ~Y2ProgramComponent();
00099 
00103     string name() const;
00104 
00110     YCPValue evaluate(const YCPValue& command);
00111 
00118     void result(const YCPValue& result);
00119 
00125     void setServerOptions(int argc, char **argv);
00126 
00130     YCPValue doActualWork(const YCPList& arglist, Y2Component *user_interface);
00131 
00132 private:
00137     void launchExternalProgram(char** argv);
00138 
00142     void terminateExternalProgram();
00143 
00147     YCPValue receiveFromExternal();
00148 
00152     void sendToExternal(const YCPValue&);
00153 
00157     bool externalProgramOK() const;
00158 };
00159 
00160 
00161 #endif // Y2ProgramComponent_h

Generated on Fri Nov 9 18:15:22 2007 for yast2-core by doxygen 1.3.6