00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: WFMSubAgent.h 00014 00015 Author: Arvin Schnell <arvin@suse.de> 00016 Maintainer: Arvin Schnell <arvin@suse.de> 00017 00018 /-*/ 00019 00020 #ifndef WFMSubAgent_h 00021 #define WFMSubAgent_h 00022 00023 #include <string> 00024 00025 using std::string; 00026 00027 #include <y2/Y2Component.h> 00028 00029 00033 class WFMSubAgent 00034 { 00035 00036 public: 00037 00041 WFMSubAgent (const string&, int); 00042 00046 ~WFMSubAgent (); 00047 00051 bool start (); 00052 00059 bool start_and_check (bool, int*); 00060 00064 string get_name () const { return my_name; } 00065 00069 int get_handle () const { return my_handle; } 00070 00075 Y2Component* comp () { return my_comp; } 00076 00082 SCRAgent* agent () { return my_agent ? my_agent : (my_comp ? my_comp->getSCRAgent () : 0); } 00083 00084 private: 00085 00089 const string my_name; 00090 00094 const int my_handle; 00095 00099 Y2Component* my_comp; 00100 00104 SCRAgent* my_agent; 00105 00106 WFMSubAgent (const WFMSubAgent&); // disallow 00107 void operator = (const WFMSubAgent&); // disallow 00108 00109 }; 00110 00111 00112 inline bool 00113 wfmsubagent_less (const WFMSubAgent* a, int handle) // FIXME 00114 { 00115 return a->get_handle () < handle; 00116 } 00117 00118 00119 #endif // WFMSubAgent_h