Skip to content

improve singleton subclass#311

Merged
cheebinhoh merged 2 commits into
mainfrom
feature/improve-singleton-subclass
Apr 7, 2026
Merged

improve singleton subclass#311
cheebinhoh merged 2 commits into
mainfrom
feature/improve-singleton-subclass

Conversation

@cheebinhoh

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts the singleton construction pattern to better support singleton subclasses that should not be publicly constructible (e.g., Dmn_Runtime_Manager), by moving construction into Dmn_Singleton and restricting the runtime manager constructor.

Changes:

  • Update Dmn_Singleton<T>::createInstance() to construct via std::shared_ptr<T>(new T(...)) instead of std::make_shared<T>(...).
  • Make Dmn_Runtime_Manager constructor non-public and add friendship for its Dmn_Singleton specialization.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
include/dmn-singleton.hpp Changes singleton instantiation mechanism to allow friend-only construction of subclasses.
include/dmn-runtime.hpp Restricts Dmn_Runtime_Manager construction and grants Dmn_Singleton friend access.

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

Comment thread include/dmn-singleton.hpp
Comment thread include/dmn-singleton.hpp
Comment thread include/dmn-singleton.hpp
@cheebinhoh cheebinhoh merged commit 06b1623 into main Apr 7, 2026
8 of 9 checks passed
@cheebinhoh cheebinhoh deleted the feature/improve-singleton-subclass branch April 7, 2026 00:02
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