Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

corecontext.h

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 
00003    this file is part of rcssserver3D
00004    Fri May 9 2003
00005    Copyright (C) 2002,2003 Koblenz University
00006    Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
00007    $Id: corecontext.h,v 1.5 2004/04/08 13:38:32 rollmark Exp $
00008 
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; version 2 of the License.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021 
00022         CoreContext
00023 
00024 
00025         HISTORY:
00026                 05.07.2002 MK
00027                         - initial version
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     // types
00058     //
00059 private:
00060     typedef std::list< boost::shared_ptr<Leaf> > TObjectStack;
00061 
00062     //
00063     // functions
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     // members
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 } // namespace zeitgeist
00145 
00146 #endif //ZEITGEIST_CORECONTEXT_H

Generated on Thu Apr 6 15:25:37 2006 for rcssserver3d by  doxygen 1.4.4