-
Notifications
You must be signed in to change notification settings - Fork 1
FEAT: adds conn and mplb mocks #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| }; | ||
|
|
||
| } // namespace sim | ||
| } // namespace sims |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not Sims 4?
| } // 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| virtual std::shared_ptr<INewFlow> create_flow(INewMPLB& mplb) = 0; | |
| virtual std::shared_ptr<INewFlow> create_flow(const INewMPLB& mplb) = 0; |
| 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| [[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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because flow and mplb have smart pointers to each other. In case of usage std::shared_ptr there will be loop dependencies
| sim::INewMPLB& m_mplb; | |
| std::weak_ptr<sim::INewMPLB> m_mplb; |
No description provided.