MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / findSubNode

Method findSubNode

src/utils/Profiler.cpp:53–71  ·  view source on GitHub ↗

Return a pointer to a sub node with a given name

Source from the content-addressed store, hash-verified

51
52// Return a pointer to a sub node with a given name
53ProfileNode* ProfileNode::findSubNode(const char* name) {
54
55 // Try to find the node among the child nodes
56 ProfileNode* child = mChildNode;
57 while (child != nullptr) {
58 if (child->mName == name) {
59 return child;
60 }
61 child = child->mSiblingNode;
62 }
63
64 // The nose has not been found. Therefore, we create it
65 // and add it to the profiler tree
66 ProfileNode* newNode = new ProfileNode(name, this);
67 newNode->mSiblingNode = mChildNode;
68 mChildNode = newNode;
69
70 return newNode;
71}
72
73// Called when we enter the block of code corresponding to this profile node
74void ProfileNode::enterBlockOfCode() {

Callers 1

startProfilingBlockMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected