Skip to content

Commit

Permalink
#128 Add detail::make_react_graph() as preparation for hiding react_g…
Browse files Browse the repository at this point in the history
…raph's implementation
  • Loading branch information
YarikTH committed Aug 24, 2023
1 parent bab602b commit 68f6006
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions include/ureact/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ namespace detail
class context_internals
{
public:
explicit context_internals(
std::shared_ptr<react_graph> graph = std::make_shared<react_graph>() );
explicit context_internals( std::shared_ptr<react_graph> graph = make_react_graph() );

UREACT_WARN_UNUSED_RESULT react_graph& get_graph();
UREACT_WARN_UNUSED_RESULT const react_graph& get_graph() const;
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/detail/context.inl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ UREACT_FUNC context get()

if( !graphPtr )
{
s_instance = graphPtr = std::make_shared<detail::react_graph>();
s_instance = graphPtr = detail::make_react_graph();
}

return context{ std::move( graphPtr ) };
Expand Down
5 changes: 5 additions & 0 deletions include/ureact/detail/graph_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ UREACT_WARN_UNUSED_RESULT inline bool react_graph::topological_queue::fetch_next
return !m_next_data.empty();
}

inline std::shared_ptr<react_graph> make_react_graph()
{
return std::make_shared<react_graph>();
}

} // namespace detail

UREACT_END_NAMESPACE
Expand Down

0 comments on commit 68f6006

Please sign in to comment.