00001 /* 00002 * DummyAgent.h 00003 * 00004 * A dummy agent, only for testing purposes 00005 * 00006 * Author: Klaus Kaempf <kkaempf@suse.de> 00007 * Michal Svec <msvec@suse.cz> 00008 * Petr Blahos <pblahos@suse.cz> 00009 * Gabriele Strattner <gs@suse.de> 00010 * 00011 * $Id: DummyAgent.h,v 1.3 2004/01/19 09:32:20 visnov Exp $ 00012 * 00013 */ 00014 00015 #ifndef DummyAgent_h 00016 #define DummyAgent_h 00017 00018 #include <scr/SCRAgent.h> 00019 #include <Y2.h> 00020 00025 class DummyAgent : public SCRAgent 00026 { 00027 private: 00031 YCPList readList; 00032 YCPList writeList; 00033 YCPList execList; 00034 00038 YCPValue defaultValue; 00039 YCPMap defaultMap; 00040 00044 int readCalls; 00045 int writeCalls; 00046 int execCalls; 00047 00048 YCPValue checkPath (const YCPPath& path, const YCPMap& map, const YCPValue& defaultVal); 00049 00050 public: 00051 DummyAgent (); 00052 00058 YCPValue Read(const YCPPath& path, const YCPValue& arg = YCPNull(), const YCPValue& opt = YCPNull()); 00059 00064 YCPBoolean Write(const YCPPath& path, const YCPValue& value, const YCPValue& arg = YCPNull()); 00065 00070 YCPValue Execute(const YCPPath& path, const YCPValue& value, const YCPValue& arg = YCPNull()); 00071 00075 YCPList Dir(const YCPPath& path); 00076 00080 YCPValue otherCommand(const YCPTerm& term); 00081 }; 00082 00083 00084 #endif // DummyAgent_h