00001 #ifndef __ARC_INFO_CACHE_H__
00002 #define __ARC_INFO_CACHE_H__
00003
00004 #include <string>
00005 #include <list>
00006 #include <arc/ArcConfig.h>
00007 #include <arc/XMLNode.h>
00008 #include <arc/ArcRegex.h>
00009 #include <arc/infosys/InformationInterface.h>
00010 #ifdef WIN32
00011 #include <io.h>
00012 #endif
00013
00014 namespace Arc {
00015
00017
00018 class InfoCache {
00019 protected:
00020 std::string path_base;
00021 public:
00022 bool Query(const char *xml_path, const char *q, XMLNodeContainer &result);
00023 bool Query(const std::string &xml_path, std::string &q, XMLNodeContainer &result) { return Query(xml_path.c_str(), q.c_str(), result); };
00024 bool Set(const char *xml_path, XMLNode &value);
00025 bool Set(const std::string &xml_path, XMLNode &value) { return Set(xml_path.c_str(), value) ; };
00026 bool Get(const char *xml_path, XMLNodeContainer &result);
00027 bool Get(const std::string &xml_path, XMLNodeContainer &result) { return Get(xml_path.c_str(), result); };
00028 bool Unset(const char *xml_path);
00029 bool Unset(const std::string &xml_path) { return Unset(xml_path.c_str()); };
00031
00035 InfoCache(const Config &cfg, const std::string &service_id);
00036 ~InfoCache();
00037 };
00038
00039 class InfoCacheInterface: public InformationInterface {
00040 protected:
00041 InfoCache cache;
00042 virtual void Get(const std::list<std::string>& path,XMLNodeContainer& result);
00043 virtual void Get(XMLNode xpath,XMLNodeContainer& result);
00044 public:
00045 InfoCacheInterface(Config &cfg, std::string &service_id);
00046 virtual ~InfoCacheInterface(void);
00047 InfoCache& Cache(void) { return cache; };
00048 };
00049
00050 }
00051
00052 #endif // __ARC_INFO_CACHE_H__