#include <corecontext.h>
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< Leaf > | New (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< Leaf > | Select (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< Leaf > | Get (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< Leaf > | GetObject () const |
returns the currently selected object | |
boost::shared_ptr< Core > | GetCore () 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) | |
CoreContext & | operator= (const CoreContext &obj) |
Private Attributes | |
boost::shared_ptr< Core > | mCore |
pointer to the core object this context belongs to | |
boost::shared_ptr< Leaf > | mObject |
the current active object | |
std::string | mPath |
the current working path | |
TObjectStack | mObjectStack |
the object stack |
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.
|
Definition at line 60 of file corecontext.h. |
|
constructs a core context
Definition at line 34 of file corecontext.cpp. |
|
Definition at line 38 of file corecontext.cpp. |
|
|
|
Definition at line 69 of file corecontext.cpp. References Get(). Here is the call graph for this function: ![]() |
|
prints the objects on the stack to stdout
Definition at line 185 of file corecontext.cpp. References mObjectStack. |
|
returns a reference to the object described by the path expression pathStr
Definition at line 145 of file corecontext.cpp. |
|
returns the core this context belongs to
Definition at line 107 of file corecontext.h. References mCore. |
|
returns the currently selected object
Definition at line 104 of file corecontext.h. References mObject. |
|
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: ![]() |
|
prints the children of the currently selected object to stdout
Definition at line 155 of file corecontext.cpp. References mObject. |
|
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: ![]() |
|
|
|
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. |
|
pushs the current active object on the object stack
Definition at line 170 of file corecontext.cpp. References mObject, and mObjectStack. |
|
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: ![]() |
|
returns true if the object referenced by the path expression pathStr exists
Definition at line 150 of file corecontext.cpp. |
|
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(). |
|
the current active object
Definition at line 135 of file corecontext.h. Referenced by Get(), GetObject(), Install(), ListObjects(), New(), Pop(), Push(), Select(), and Test(). |
|
the object stack
Definition at line 141 of file corecontext.h. |
|
the current working path
Definition at line 138 of file corecontext.h. |