00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef ScriptingAgent_h
00012 #define ScriptingAgent_h
00013
00014 #include <y2/Y2Component.h>
00015 #include <scr/SCRAgent.h>
00016 #include "SCRSubAgent.h"
00017
00018
00019 class ScriptingAgent : public SCRAgent
00020 {
00021
00022 public:
00023
00027 ScriptingAgent ();
00028
00034 ScriptingAgent (const string& file);
00035
00039 ~ScriptingAgent ();
00040
00046 virtual YCPValue Read (const YCPPath &path, const YCPValue &arg = YCPNull (), const YCPValue &opt = YCPNull ());
00047
00051 virtual YCPBoolean Write (const YCPPath &path, const YCPValue &value,
00052 const YCPValue &arg = YCPNull ());
00053
00057 virtual YCPList Dir (const YCPPath &path);
00058
00062 virtual YCPValue Execute (const YCPPath &path, const YCPValue &value =
00063 YCPNull (), const YCPValue &arg = YCPNull ());
00064
00068 virtual YCPMap Error (const YCPPath &path);
00069
00075 YCPValue otherCommand (const YCPTerm &term);
00076
00082 virtual YCPBoolean RegisterAgent (const YCPPath &path, const YCPValue &value);
00083
00087 virtual YCPBoolean UnregisterAgent (const YCPPath &path);
00088
00092 virtual YCPBoolean UnregisterAllAgents ();
00093
00097 virtual YCPBoolean UnmountAgent (const YCPPath &path);
00098
00099 private:
00100
00104 typedef vector<SCRSubAgent*> SubAgents;
00105 SubAgents agents;
00106
00107
00112 YCPValue MountAgent (const YCPPath &path);
00113
00117 YCPValue MountAllAgents ();
00118
00122 YCPValue UnmountAllAgents ();
00123
00134 YCPValue executeSubagentCommand (const char *command,
00135 const YCPPath &path,
00136 const YCPValue &arg = YCPNull (),
00137 const YCPValue &optpar = YCPNull ());
00138
00143 SubAgents::iterator findByPath (const YCPPath &path);
00144
00150 void parseConfigFiles (const string &directory);
00151
00156 void parseSingleConfigFile (const string &file);
00157
00158 };
00159
00160
00161 #endif // ScriptingAgent_h