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
00021 class ScriptingAgent : public SCRAgent
00022 {
00023
00024 public:
00025
00029 ScriptingAgent ();
00030
00036 ScriptingAgent (const string& file);
00037
00041 ~ScriptingAgent ();
00042
00048 virtual YCPValue Read (const YCPPath &path, const YCPValue &arg = YCPNull (), const YCPValue &opt = YCPNull ());
00049
00053 virtual YCPBoolean Write (const YCPPath &path, const YCPValue &value,
00054 const YCPValue &arg = YCPNull ());
00055
00059 virtual YCPList Dir (const YCPPath &path);
00060
00064 virtual YCPValue Execute (const YCPPath &path, const YCPValue &value =
00065 YCPNull (), const YCPValue &arg = YCPNull ());
00066
00070 virtual YCPMap Error (const YCPPath &path);
00071
00077 YCPValue otherCommand (const YCPTerm &term);
00078
00084 virtual YCPBoolean RegisterAgent (const YCPPath &path, const YCPValue &value);
00085
00089 virtual YCPBoolean UnregisterAgent (const YCPPath &path);
00090
00094 virtual YCPBoolean UnregisterAllAgents ();
00095
00099 virtual YCPBoolean UnmountAgent (const YCPPath &path);
00100
00101 private:
00102
00106 typedef vector<SCRSubAgent*> SubAgents;
00107 SubAgents agents;
00108
00109
00114 YCPValue MountAgent (const YCPPath &path);
00115
00119 YCPValue MountAllAgents ();
00120
00124 YCPValue UnmountAllAgents ();
00125
00129 YCPBoolean RegisterNewAgents ();
00130
00141 YCPValue executeSubagentCommand (const char *command,
00142 const YCPPath &path,
00143 const YCPValue &arg = YCPNull (),
00144 const YCPValue &optpar = YCPNull ());
00145
00150 SubAgents::iterator findByPath (const YCPPath &path);
00151
00157 void parseConfigFiles (const string &directory);
00158
00163 void parseSingleConfigFile (const string &file);
00164
00165 };
00166
00167
00168 #endif // ScriptingAgent_h