#include <leaf.h>
Inheritance diagram for zeitgeist::Leaf:
Public Types | |
typedef std::list< boost::shared_ptr< Leaf > > | TLeafList |
Public Member Functions | |
Leaf (const std::string &name="<unnamed>") | |
constructs a leaf with the given name | |
virtual | ~Leaf () |
std::string & | GetName () |
returns a reference to the name of the leaf | |
const std::string & | GetName () const |
returns a constant reference to the name of the leaf | |
boost::weak_ptr< Node > & | GetParent () |
returns a pointer to the parent of the leaf | |
const boost::weak_ptr< Node > & | GetParent () const |
returns a constant pointer to the parent of the leaf | |
virtual boost::shared_ptr< Leaf > | GetChild (const std::string &name, bool recursive=false) |
defines an interface to get a pointer to a child (i.e. | |
virtual boost::shared_ptr< Leaf > | GetChildOfClass (const std::string &name, bool recursive=false) |
defines an interface to get a pointer to child of the given class type, which can be searched recursively. | |
virtual boost::shared_ptr< Leaf > | GetChildSupportingClass (const std::string &name, bool recursive=false) |
defines an interface to get the fist child supporting the class 'name' (i.e. | |
template<class CLASS> | |
boost::shared_ptr< CLASS > | FindChildSupportingClass (bool recursive=false) |
defines an interface to get the fist child supporting the class 'name' (i.e. | |
virtual void | GetChildren (const std::string &name, TLeafList &baseList, bool recursive=false) |
defines an interface to get a list of children. | |
virtual void | GetChildrenOfClass (const std::string &name, TLeafList &baseList, bool recursive=false) |
defines an interface to get a list to all children of type 'name'. | |
virtual void | GetChildrenSupportingClass (const std::string &name, TLeafList &baseList, bool recursive=false) |
defines an interface to get a list to all children supporting a class 'name' i.e. | |
template<class CLASS> | |
void | ListChildrenSupportingClass (TLeafList &list, bool recursive=false) |
constructs a list of all children supporting a class 'name' i.e. | |
virtual boost::weak_ptr< Node > | GetParentSupportingClass (const std::string &name) const |
defines an interface to get the first parent node on the way up the hierarchy that supports a class 'name', i.e. | |
template<class CLASS> | |
boost::weak_ptr< CLASS > | FindParentSupportingClass () const |
defines an interface to get the first parent node on the way up the hierarchy that supports a class 'name', i.e. | |
virtual bool | IsLeaf () const |
defines an interface to test if this node is a leaf. | |
virtual void | RemoveChildReference (const boost::shared_ptr< Leaf > &base) |
removes base from the set of children. | |
virtual bool | AddChildReference (const boost::shared_ptr< Leaf > &base) |
adds base to the set of children and sets the parent of base to be this node | |
void | Unlink () |
detaches this node and its hierarchy from its parent. | |
virtual void | UnlinkChildren () |
unlinks all child nodes | |
virtual void | Dump () const |
writes debug data to stdout | |
virtual void | UpdateCached () |
update variables from a script | |
const std::string & | GetFullPath () const |
constructs the full path of this node by walking up the tree. | |
void | ClearCachedData () const |
clears any cached data (e.g. | |
void | SetName (const std::string &name) |
sets the name of this node | |
virtual TLeafList::iterator | begin () |
virtual TLeafList::const_iterator | begin () const |
virtual TLeafList::iterator | end () |
virtual TLeafList::const_iterator | end () const |
Protected Member Functions | |
virtual void | UpdateCachedInternal () |
called from within UpdatCached; override to perform node specific updates | |
void | SetParent (const boost::shared_ptr< Node > &parent) |
Sets the parent of this node. | |
virtual void | OnLink () |
This method is called, when the hierarchy object has been linked to a parent. | |
virtual void | OnUnlink () |
This rountine is called, before the hierarchy object is removed from the parent. | |
Protected Attributes | |
boost::weak_ptr< Node > | mParent |
This pointer holds a link to the parent of this node. | |
Private Member Functions | |
Leaf (const Leaf &obj) | |
Leaf & | operator= (const Leaf &obj) |
Private Attributes | |
std::string | mName |
the name of the node | |
std::string * | mCachedFullPath |
temporary cached full path of this node in the hierarchy | |
Friends | |
class | Node |
A Leaf object can reside within the hierarchy, but cannot have children!
Definition at line 50 of file leaf.h.
|
|
|
constructs a leaf with the given name
|
|
|
|
|
|
adds base to the set of children and sets the parent of base to be this node
Reimplemented in zeitgeist::Node. |
|
Reimplemented in zeitgeist::Node. Definition at line 183 of file leaf.cpp. References gFakeChildren. |
|
Reimplemented in zeitgeist::Node. Definition at line 178 of file leaf.cpp. References gFakeChildren. Referenced by FindChildSupportingClass(), and ListChildrenSupportingClass(). |
|
clears any cached data (e.g. the cached full path and forces the node to recalculate all values Definition at line 170 of file leaf.cpp. References mCachedFullPath. Referenced by SetName(), and SetParent(). |
|
writes debug data to stdout
Reimplemented from zeitgeist::Object. Reimplemented in zeitgeist::Node. Definition at line 138 of file leaf.cpp. References zeitgeist::Object::Dump(), and GetName(). Referenced by zeitgeist::Node::Dump(). Here is the call graph for this function: ![]() |
|
Reimplemented in zeitgeist::Node. Definition at line 193 of file leaf.cpp. References gFakeChildren. |
|
Reimplemented in zeitgeist::Node. Definition at line 188 of file leaf.cpp. References gFakeChildren. Referenced by FindChildSupportingClass(), and ListChildrenSupportingClass(). |
|
defines an interface to get the fist child supporting the class 'name' (i.e. nodes of a type equal to or derived from the class 'name'), which can be searched recursively. The class Leaf will always return an empty reference. This implementation of FindChildSupportingClass does not rely on the associated zeitgeist class name but uses the c++ typeid system. Definition at line 112 of file leaf.h. References begin(), CLASS, and end(). Here is the call graph for this function: ![]() |
|
defines an interface to get the first parent node on the way up the hierarchy that supports a class 'name', i.e. is an instance of that class or is derived from it. This implementation of GetParentSupportingClass does not rely on the associated zeitgeist class name but uses the c++ typeid system. Definition at line 129 of file node.h. References GetParent(). Here is the call graph for this function: ![]() |
|
defines an interface to get a pointer to a child (i.e. node or leaf) with the given name, which can be searched recursively. The class Leaf will always return an empty reference Reimplemented in zeitgeist::Node. Definition at line 48 of file leaf.cpp. References GetParent(), and zeitgeist::Object::GetSelf(). Referenced by zeitgeist::Node::GetChild(). Here is the call graph for this function: ![]() |
|
defines an interface to get a pointer to child of the given class type, which can be searched recursively. The class Leaf will always return an empty reference Reimplemented in zeitgeist::Node. |
|
defines an interface to get a list of children. The Leaf class will always return an empty list Definition at line 74 of file leaf.cpp. References GetParent(), and zeitgeist::Object::GetSelf(). Referenced by zeitgeist::Node::GetChildren(). Here is the call graph for this function: ![]() |
|
defines an interface to get a list to all children of type 'name'. The Leaf class will always return an empty list Definition at line 87 of file leaf.cpp. Referenced by zeitgeist::Node::GetChildrenOfClass(). |
|
defines an interface to get a list to all children supporting a class 'name' i.e. they are an instance of that class or are derived from it. The Leaf class will always return an empty list Definition at line 91 of file leaf.cpp. Referenced by zeitgeist::Node::GetChildrenSupportingClass(). |
|
defines an interface to get the fist child supporting the class 'name' (i.e. nodes of a type equal to or derived from the class 'name'), which can be searched recursively. The class Leaf will always return an empty reference Reimplemented in zeitgeist::Node. |
|
constructs the full path of this node by walking up the tree. Cosecutive calls return a cached copy of the full path to avoid the expensive tree walk. Definition at line 144 of file leaf.cpp. References GetParent(), IsLeaf(), mCachedFullPath, and mName. Referenced by zeitgeist::Object::GetClass(), and zeitgeist::Object::GetCore(). Here is the call graph for this function: ![]() |
|
returns a constant reference to the name of the leaf
Definition at line 72 of file leaf.h. References mName. |
|
returns a reference to the name of the leaf
Definition at line 68 of file leaf.h. References mName. Referenced by oxygen::NetControl::AcceptTCPConnections(), oxygen::NetClient::CloseConnection(), oxygen::NetClient::Connect(), oxygen::NetControl::DoneSimulation(), Dump(), zeitgeist::Object::GetClass(), zeitgeist::Object::GetCore(), zeitgeist::Class::GetCore(), UniversalJointEffector::GetPredicate(), HingeEffector::GetPredicate(), Hinge2Effector::GetPredicate(), SoccerBase::GetSoccerVar(), oxygen::NetControl::InitSimulation(), oxygen::NetClient::ReadFragments(), oxygen::NetControl::ReadTCPMessages(), oxygen::NetControl::ReadUDPMessages(), and zeitgeist::Class::SupportsClass(). |
|
returns a constant pointer to the parent of the leaf
Definition at line 43 of file leaf.cpp. References mParent. |
|
returns a pointer to the parent of the leaf
Definition at line 38 of file leaf.cpp. References mParent. Referenced by FindParentSupportingClass(), GetChild(), GetChildren(), GetFullPath(), GetParentSupportingClass(), oxygen::SimControlNode::GetSimulationServer(), SayEffector::OnLink(), KickEffector::OnLink(), ForceEffector::OnLink(), oxygen::CollisionHandler::OnLink(), oxygen::Collider::OnLink(), CatchEffector::OnLink(), oxygen::Body::OnLink(), AgentStatePerceptor::Percept(), oxygen::Body::PostPhysicsUpdateInternal(), PanTiltEffector::Realize(), DriveEffector::Realize(), and SetParent(). |
|
defines an interface to get the first parent node on the way up the hierarchy that supports a class 'name', i.e. is an instance of that class or is derived from it. Definition at line 96 of file leaf.cpp. References GetParent(). Referenced by oxygen::Effector::GetAgentAspect(), and oxygen::BodyController::OnLink(). Here is the call graph for this function: ![]() |
|
defines an interface to test if this node is a leaf. Only the TLeaf class will return true Reimplemented in zeitgeist::Node. Definition at line 114 of file leaf.cpp. Referenced by GetFullPath(). |
|
constructs a list of all children supporting a class 'name' i.e. they are an instance of that class or are derived from it. This implementation of GetChildrenSupportingClass does not rely on the associated zeitgeist class name but uses the c++ typeid system. Definition at line 155 of file leaf.h. References begin(), CLASS, and end(). Here is the call graph for this function: ![]() |
|
|
|
|
|
removes base from the set of children.
Reimplemented in zeitgeist::Node. |
|
sets the name of this node
Definition at line 244 of file leaf.h. References ClearCachedData(), and mName. Referenced by oxygen::AgentAspect::AgentAspect(), oxygen::Camera::Camera(), Hinge2Effector::Hinge2Effector(), HingeEffector::HingeEffector(), oxygen::Transform::Transform(), and UniversalJointEffector::UniversalJointEffector(). Here is the call graph for this function: ![]() |
|
Sets the parent of this node. It has to be implemented 'very carefully'. The parent object always holds a shared pointer reference to mSelf. What we have to do is 'get' the shared reference, remove it from the old parent. Insert it into the new parent and change the parent pointer. Definition at line 198 of file leaf.cpp. References ClearCachedData(), GetParent(), zeitgeist::Object::GetSelf(), mParent, OnLink(), and OnUnlink(). Referenced by Unlink(). Here is the call graph for this function: ![]() |
|
detaches this node and its hierarchy from its parent.
Definition at line 128 of file leaf.cpp. References SetParent(). Here is the call graph for this function: ![]() |
|
unlinks all child nodes
Reimplemented in zeitgeist::Node. |
|
update variables from a script
Reimplemented in oxygen::SpadesServer, zeitgeist::Node, and SexpMonitor. |
|
called from within UpdatCached; override to perform node specific updates
Reimplemented in SoccerRuleAspect. |
|
|
|
temporary cached full path of this node in the hierarchy
Definition at line 299 of file leaf.h. Referenced by ClearCachedData(), and GetFullPath(). |
|
the name of the node
Definition at line 296 of file leaf.h. Referenced by GetFullPath(), GetName(), and SetName(). |
|
This pointer holds a link to the parent of this node. It has to be at least a Node, as that is the first class, which can hold children. We use a weak pointer to break the cyclic dependency. Definition at line 292 of file leaf.h. Referenced by GetParent(), oxygen::BaseNode::GetWorldTransform(), SetParent(), oxygen::Transform::SetWorldTransform(), oxygen::BaseNode::SetWorldTransform(), and oxygen::Transform::UpdateHierarchyInternal(). |