Skip to content

Pull Request: Feature - Terminal Logic Implementation#14

Merged
David-A-T-M merged 5 commits into
masterfrom
feat/Terminal
Feb 1, 2026
Merged

Pull Request: Feature - Terminal Logic Implementation#14
David-A-T-M merged 5 commits into
masterfrom
feat/Terminal

Conversation

@David-A-T-M
Copy link
Copy Markdown
Owner

Overview

This PR provides the full implementation for the Terminal class. It enables terminals to communicate through a Router, manage incoming/outgoing traffic via dedicated buffers, and reconstruct original data pages from network packets.

Changes Made

  • Core Logic: Implemented sendPage to handle page fragmentation using the nextPageID sequence.
  • Traffic Control: Added logic for processOutputBuffer and processInputBuffer to respect simulation cycle bandwidth (externalBW and internalBW).
  • Reassembly Pipeline:
    • Implemented findOrCreateReassembler with safety checks for pageID and pageLength.
    • Added handleCompletedPage to increment receivedPages counter and cleanup resources.
  • Safety & Memory:
    • Enforced deleted copy/move constructors as per design.
    • Used noexcept for getters and setters to ensure performance and stability.
  • Debugging Tools: Implemented toString() and operator<< for easier simulation tracking.

Related Issue

Closes # [Insert Issue Number Here]

Testing Performed

  • Verified that pages larger than outputCapacity are correctly handled (dropped or partially enqueued).
  • Confirmed that internalBW limits the number of packets processed from the input buffer per tick.
  • Tested simultaneous reassembly of multiple pages from different source IPs.

Construtors parameter changed from int to size_t, positive validation removed. getPageLength/ID now returns size_t, tests modified accordingly
Construtors parameter changed from int to size_t, tests modified accordingly
Construtors parameter changed from int to size_t, tests modified accordingly.
Implemented move semantics, and equality operators
@David-A-T-M David-A-T-M self-assigned this Feb 1, 2026
@David-A-T-M David-A-T-M linked an issue Feb 1, 2026 that may be closed by this pull request
4 tasks
Copy link
Copy Markdown
Owner Author

@David-A-T-M David-A-T-M left a comment

Choose a reason for hiding this comment

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

Ready to merge

@David-A-T-M David-A-T-M merged commit ea4d4ae into master Feb 1, 2026
6 checks passed
@David-A-T-M David-A-T-M deleted the feat/Terminal branch February 1, 2026 22:06
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.

Issue: Implementation of the Terminal Class Logic

1 participant