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

zeitgeist::CoreContext Class Reference

This class is responsible for representing a browsing context within the object hierarchy. More...

#include <corecontext.h>

List of all members.

Public Member Functions

 CoreContext (const boost::shared_ptr< Core > &core, const boost::shared_ptr< Leaf > &root)
 constructs a core context
virtual ~CoreContext ()
boost::shared_ptr< LeafNew (const std::string &className, const std::string &pathStr)
 constructs a new class of type 'className' below the node described by 'pathStr'.
bool Delete (const std::string &name)
boost::shared_ptr< LeafSelect (const std::string &pathStr)
 selects the currenlty active object to be the one described the by path expression pathStr.
bool Install (const boost::shared_ptr< Leaf > &leaf, const std::string &pathStr, bool isNamed=false)
 inserts the object 'leaf' below the object described by the path expression 'pathStr' into the hierarchy and returns true on success
boost::shared_ptr< LeafGet (const std::string &pathStr)
 returns a reference to the object described by the path expression pathStr
bool Test (const std::string &pathStr)
 returns true if the object referenced by the path expression pathStr exists
boost::shared_ptr< LeafGetObject () const
 returns the currently selected object
boost::shared_ptr< CoreGetCore () const
 returns the core this context belongs to
void ListObjects () const
 prints the children of the currently selected object to stdout
void Push ()
 pushs the current active object on the object stack
void Pop ()
 makes the top of the object stack the current object, no change if stack is empty
void Dir () const
 prints the objects on the stack to stdout

Private Types

typedef std::list< boost::shared_ptr<
Leaf > > 
TObjectStack

Private Member Functions

 CoreContext (const CoreContext &obj)
CoreContextoperator= (const CoreContext &obj)

Private Attributes

boost::shared_ptr< CoremCore
 pointer to the core object this context belongs to
boost::shared_ptr< LeafmObject
 the current active object
std::string mPath
 the current working path
TObjectStack mObjectStack
 the object stack


Detailed Description

This class is responsible for representing a browsing context within the object hierarchy.

It is usually created by the Core object.

Why was the browsing context separated from the Core?

Well, the usage scenario of the framework envisions multiple clients browsing the same object hierarchy. Therefore it was necessary to place the current browsing context into a distinct object.

Definition at line 54 of file corecontext.h.


Member Typedef Documentation

typedef std::list< boost::shared_ptr<Leaf> > zeitgeist::CoreContext::TObjectStack [private]
 

Definition at line 60 of file corecontext.h.


Constructor & Destructor Documentation

CoreContext::CoreContext const boost::shared_ptr< Core > &  core,
const boost::shared_ptr< Leaf > &  root
 

constructs a core context

Parameters:
'core' is the core this context belongs to
'root' is the root of the core

Definition at line 34 of file corecontext.cpp.

CoreContext::~CoreContext  )  [virtual]
 

Definition at line 38 of file corecontext.cpp.

zeitgeist::CoreContext::CoreContext const CoreContext obj  )  [private]
 


Member Function Documentation

bool CoreContext::Delete const std::string &  name  ) 
 

Definition at line 69 of file corecontext.cpp.

References Get().

Here is the call graph for this function:

void CoreContext::Dir  )  const
 

prints the objects on the stack to stdout

Definition at line 185 of file corecontext.cpp.

References mObjectStack.

boost::shared_ptr< Leaf > CoreContext::Get const std::string &  pathStr  ) 
 

returns a reference to the object described by the path expression pathStr

Definition at line 145 of file corecontext.cpp.

References mCore, and mObject.

Referenced by Delete(), and Select().

boost::shared_ptr<Core> zeitgeist::CoreContext::GetCore  )  const [inline]
 

returns the core this context belongs to

Definition at line 107 of file corecontext.h.

References mCore.

boost::shared_ptr<Leaf> zeitgeist::CoreContext::GetObject  )  const [inline]
 

returns the currently selected object

Definition at line 104 of file corecontext.h.

References mObject.

bool CoreContext::Install const boost::shared_ptr< Leaf > &  leaf,
const std::string &  pathStr,
bool  isNamed = false
 

inserts the object 'leaf' below the object described by the path expression 'pathStr' into the hierarchy and returns true on success

Definition at line 95 of file corecontext.cpp.

References salt::Path::Back(), salt::Path::Front(), salt::Path::IsAbsolute(), salt::Path::IsEmpty(), mCore, mObject, salt::Path::PopBack(), and salt::Path::PopFront().

Referenced by New().

Here is the call graph for this function:

void CoreContext::ListObjects  )  const
 

prints the children of the currently selected object to stdout

Definition at line 155 of file corecontext.cpp.

References mObject.

boost::shared_ptr< Leaf > CoreContext::New const std::string &  className,
const std::string &  pathStr
 

constructs a new class of type 'className' below the node described by 'pathStr'.

The function assumes that only compatible classes are created this way. Compatible means 'starting at Leaf' in the hierarchy. It returns a reference to the constructed object.

Definition at line 43 of file corecontext.cpp.

References Install(), mCore, and mObject.

Here is the call graph for this function:

CoreContext& zeitgeist::CoreContext::operator= const CoreContext obj  )  [private]
 

void CoreContext::Pop  ) 
 

makes the top of the object stack the current object, no change if stack is empty

Definition at line 176 of file corecontext.cpp.

References mObject, and mObjectStack.

void CoreContext::Push  ) 
 

pushs the current active object on the object stack

Definition at line 170 of file corecontext.cpp.

References mObject, and mObjectStack.

boost::shared_ptr< Leaf > CoreContext::Select const std::string &  pathStr  ) 
 

selects the currenlty active object to be the one described the by path expression pathStr.

It returns a reference to the selected object

Definition at line 83 of file corecontext.cpp.

References Get(), and mObject.

Here is the call graph for this function:

bool CoreContext::Test const std::string &  pathStr  ) 
 

returns true if the object referenced by the path expression pathStr exists

Definition at line 150 of file corecontext.cpp.

References mCore, and mObject.


Member Data Documentation

boost::shared_ptr<Core> zeitgeist::CoreContext::mCore [private]
 

pointer to the core object this context belongs to

Definition at line 132 of file corecontext.h.

Referenced by Get(), GetCore(), Install(), New(), and Test().

boost::shared_ptr<Leaf> zeitgeist::CoreContext::mObject [private]
 

the current active object

Definition at line 135 of file corecontext.h.

Referenced by Get(), GetObject(), Install(), ListObjects(), New(), Pop(), Push(), Select(), and Test().

TObjectStack zeitgeist::CoreContext::mObjectStack [private]
 

the object stack

Definition at line 141 of file corecontext.h.

Referenced by Dir(), Pop(), and Push().

std::string zeitgeist::CoreContext::mPath [private]
 

the current working path

Definition at line 138 of file corecontext.h.


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:50:04 2006 for rcssserver3d by  doxygen 1.4.4