Skip to content

refactor: update GetRawData to return std::span - #42

Merged
Machillka merged 1 commit into
mainfrom
core
Sep 17, 2026
Merged

Machillka merged 1 commit into
mainfrom
core

Conversation

@Machillka

@Machillka Machillka commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Refactor
    • Updated memory stream data access to provide read-only, non-owning byte views.
    • Updated prefab and scene serialization workflows to copy captured data into stored buffers.
    • Adjusted integration tests to work with the updated memory stream interface.

@Machillka
Machillka merged commit f6fab4b into main Sep 17, 2026
3 of 4 checks passed
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: bde8aa09-9671-470c-9f30-7348eb323126

📥 Commits

Reviewing files that changed from the base of the PR and between e155356 and 49fa874.

📒 Files selected for processing (5)
  • engine/Runtime/Core/include/ChikaEngine/io/MemoryStream.h
  • engine/Runtime/Core/src/io/MemoryStream.cpp
  • engine/Runtime/Framework/src/prefab/Prefab.cpp
  • engine/Runtime/Framework/src/scene/scene.cpp
  • tests/integration/ColliderAuthoringTests.cpp

📝 Walkthrough

Walkthrough

MemoryStream::GetRawData() now returns a read-only std::span. Prefab capture and scene backup code copy the span into byte vectors. Integration tests use value bindings for the returned data.

Changes

MemoryStream raw data API

Layer / File(s) Summary
Read-only raw data flow
engine/Runtime/Core/include/ChikaEngine/io/MemoryStream.h, engine/Runtime/Core/src/io/MemoryStream.cpp, engine/Runtime/Framework/src/prefab/Prefab.cpp, engine/Runtime/Framework/src/scene/scene.cpp, tests/integration/ColliderAuthoringTests.cpp
GetRawData() returns [[nodiscard]] std::span<const std::byte> and is callable on const streams. Prefab capture and scene backup copy the returned bytes into vectors. Integration tests bind the returned data by value.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Refactor

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch core

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant