00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef ZEITGEIST_CORECONTEXT_H
00031 #define ZEITGEIST_CORECONTEXT_H
00032
00033 #include <string>
00034 #include <list>
00035 #include <boost/weak_ptr.hpp>
00036 #include <boost/shared_ptr.hpp>
00037
00038 namespace zeitgeist
00039 {
00040
00041 class Core;
00042 class Leaf;
00043
00054 class CoreContext
00055 {
00056
00057
00058
00059 private:
00060 typedef std::list< boost::shared_ptr<Leaf> > TObjectStack;
00061
00062
00063
00064
00065 public:
00070 CoreContext(const boost::shared_ptr<Core> &core,
00071 const boost::shared_ptr<Leaf> &root);
00072 virtual ~CoreContext();
00073
00080 boost::shared_ptr<Leaf> New(const std::string& className,
00081 const std::string& pathStr);
00082 bool Delete(const std::string& name);
00083
00087 boost::shared_ptr<Leaf> Select(const std::string& pathStr);
00088
00092 bool Install(const boost::shared_ptr<Leaf>& leaf, const std::string& pathStr,
00093 bool isNamed = false);
00094
00097 boost::shared_ptr<Leaf> Get(const std::string& pathStr);
00098
00101 bool Test(const std::string& pathStr);
00102
00104 boost::shared_ptr<Leaf> GetObject() const { return mObject; }
00105
00107 boost::shared_ptr<Core> GetCore() const { return mCore; }
00108
00111 void ListObjects() const;
00112
00114 void Push();
00115
00118 void Pop();
00119
00121 void Dir() const;
00122
00123 private:
00124 CoreContext(const CoreContext& obj);
00125 CoreContext& operator=(const CoreContext& obj);
00126
00127
00128
00129
00130 private:
00132 boost::shared_ptr<Core> mCore;
00133
00135 boost::shared_ptr<Leaf> mObject;
00136
00138 std::string mPath;
00139
00141 TObjectStack mObjectStack;
00142 };
00143
00144 }
00145
00146 #endif //ZEITGEIST_CORECONTEXT_H