MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / onUpdate

Method onUpdate

Source/Node/Node.cpp:792–805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

790}
791
792void Node::onUpdate(const Update& func) {
793 auto updateItem = getUpdateItem();
794 auto funcRef = std::make_shared<Update>();
795 std::weak_ptr<Update> weak(funcRef);
796 *funcRef = [func, weak](double deltaTime) {
797 std::shared_ptr<Update> ref(weak);
798 return func(deltaTime);
799 };
800 updateItem->scheduledThreadFuncs.push_back(funcRef);
801 if (_flags.isOff(Node::Running)) return;
802 if (!updateItem->scheduled()) {
803 _scheduler->schedule(updateItem->scheduledItem.get());
804 }
805}
806
807void Node::clearUpdate() {
808 if (!_updateItem) return;

Callers 2

node_on_updateFunction · 0.45
invokeUpdateFunction · 0.45

Calls 5

isOffMethod · 0.80
scheduledMethod · 0.80
getMethod · 0.65
push_backMethod · 0.45
scheduleMethod · 0.45

Tested by

no test coverage detected