Skip to content

append reset functionality#4

Merged
gauravharsha merged 2 commits intoGreen-Phys:mainfrom
gauravharsha:main
Nov 6, 2025
Merged

append reset functionality#4
gauravharsha merged 2 commits intoGreen-Phys:mainfrom
gauravharsha:main

Conversation

@gauravharsha
Copy link
Contributor

Modify reset function in timing for flexible operation inside and outside other active events.

@gauravharsha gauravharsha requested a review from Copilot November 6, 2025 16:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the reset() functionality in the timing utility to support resetting all events when called at the root level. Previously, reset() would silently return when called at root level; now it resets all root events and their children.

  • Added recursive reset_event_and_children() helper method to properly reset events and all descendants
  • Modified reset() to reset all root events when called at root level (when _current_event is nullptr)
  • Extended test coverage to verify root-level reset behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/green/utils/timing.h Added reset_event_and_children() helper method and updated reset() to handle root-level resets; updated documentation to reflect new behavior
test/utils_test.cpp Added clarifying comments and test assertions to verify root-level reset functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gauravharsha gauravharsha merged commit c6f8b5b into Green-Phys:main Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants