Draft
Conversation
PaulRalnikov
requested changes
Nov 17, 2025
| }; | ||
|
|
||
| } // namespace sim No newline at end of file | ||
| } // namespace sims No newline at end of file |
Collaborator
There was a problem hiding this comment.
Why not Sims 4?
Suggested change
| } // namespace sims | |
| } // namespace sim |
| class INewFlowFactory { | ||
| public: | ||
| virtual std::shared_ptr<INewFlow> create_flow() = 0; | ||
| virtual std::shared_ptr<INewFlow> create_flow(INewMPLB& mplb) = 0; |
Collaborator
There was a problem hiding this comment.
Suggested change
| virtual std::shared_ptr<INewFlow> create_flow(INewMPLB& mplb) = 0; | |
| virtual std::shared_ptr<INewFlow> create_flow(const INewMPLB& mplb) = 0; |
Comment on lines
+11
to
+14
| FlowFactoryMock(const YAML::Node& flow_node, | ||
| std::shared_ptr<sim::IHost> sender, | ||
| std::shared_ptr<sim::IHost> receiver); | ||
| std::shared_ptr<sim::INewFlow> create_flow() final; | ||
| std::shared_ptr<sim::INewFlow> create_flow(sim::INewMPLB& mplb) final; |
Collaborator
There was a problem hiding this comment.
Do not take flow_node, concrete factory should take just concrete list of arguments specified for concrete flow. And I think flows need smart pointer to mplb, not references
Suggested change
| FlowFactoryMock(const YAML::Node& flow_node, | |
| std::shared_ptr<sim::IHost> sender, | |
| std::shared_ptr<sim::IHost> receiver); | |
| std::shared_ptr<sim::INewFlow> create_flow() final; | |
| std::shared_ptr<sim::INewFlow> create_flow(sim::INewMPLB& mplb) final; | |
| FlowFactoryMock(); | |
| std::shared_ptr<sim::INewFlow> create_flow(std::shared_ptr<sim::INewMPLB> mplb) final; |
source/new_i_mocks/new_flow_mock.cpp
Outdated
| [[maybe_unused]] std::shared_ptr<sim::IHost> a_receiver, | ||
| [[maybe_unused]] std::shared_ptr<sim::INewMPLB> a_mplb) | ||
| : m_id(std::move(a_id)) { | ||
| [[maybe_unused]] sim::INewMPLB& a_mplb) |
Collaborator
There was a problem hiding this comment.
Suggested change
| [[maybe_unused]] sim::INewMPLB& a_mplb) | |
| [[maybe_unused]] std::weak_ptr<sim::INewMPLB> a_mplb) |
source/new_i_mocks/new_flow_mock.hpp
Outdated
| NewFlowMock(Id a_id, std::shared_ptr<sim::IHost> a_sender, | ||
| std::shared_ptr<sim::IHost> a_receiver, | ||
| std::shared_ptr<sim::INewMPLB> a_mplb); | ||
| sim::INewMPLB& a_mplb); |
Collaborator
There was a problem hiding this comment.
Suggested change
| sim::INewMPLB& a_mplb); | |
| std::weak_ptr<sim::INewMPLB> a_mplb); |
source/new_i_mocks/new_flow_mock.hpp
Outdated
| private: | ||
| Id m_id; | ||
| sim::FlowContext m_context; | ||
| sim::INewMPLB& m_mplb; |
Collaborator
There was a problem hiding this comment.
Because flow and mplb have smart pointers to each other. In case of usage std::shared_ptr there will be loop dependencies
Suggested change
| sim::INewMPLB& m_mplb; | |
| std::weak_ptr<sim::INewMPLB> m_mplb; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.