diff --git a/include/ureact/adaptor/flatten.hpp b/include/ureact/adaptor/flatten.hpp index 22128a1..e19965c 100644 --- a/include/ureact/adaptor/flatten.hpp +++ b/include/ureact/adaptor/flatten.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include UREACT_BEGIN_NAMESPACE diff --git a/include/ureact/detail/node_base.hpp b/include/ureact/detail/node.hpp similarity index 87% rename from include/ureact/detail/node_base.hpp rename to include/ureact/detail/node.hpp index f83766c..f7d34aa 100644 --- a/include/ureact/detail/node_base.hpp +++ b/include/ureact/detail/node.hpp @@ -7,8 +7,8 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#ifndef UREACT_DETAIL_NODE_BASE_HPP -#define UREACT_DETAIL_NODE_BASE_HPP +#ifndef UREACT_DETAIL_NODE_HPP +#define UREACT_DETAIL_NODE_HPP #include #include @@ -40,12 +40,12 @@ Ret create_wrapped_node( Args&&... args ) return Ret{ create_node( std::forward( args )... ) }; } -class UREACT_API node_base : public reactive_node_interface +class UREACT_API node : public reactive_node_interface { public: - explicit node_base( context context ); + explicit node( context context ); - ~node_base() override; + ~node() override; UREACT_WARN_UNUSED_RESULT node_id get_node_id() const { @@ -95,7 +95,7 @@ class UREACT_API node_base : public reactive_node_interface friend class detach_functor; private: - UREACT_MAKE_NONCOPYABLE( node_base ); + UREACT_MAKE_NONCOPYABLE( node ); context m_context{}; @@ -109,7 +109,7 @@ class UREACT_API node_base : public reactive_node_interface UREACT_END_NAMESPACE #if UREACT_HEADER_ONLY -# include +# include #endif -#endif // UREACT_DETAIL_NODE_BASE_HPP +#endif // UREACT_DETAIL_NODE_HPP diff --git a/include/ureact/detail/node_base.inl b/include/ureact/detail/node.inl similarity index 67% rename from include/ureact/detail/node_base.inl rename to include/ureact/detail/node.inl index 24ebe35..ba565bd 100644 --- a/include/ureact/detail/node_base.inl +++ b/include/ureact/detail/node.inl @@ -7,55 +7,55 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#ifndef UREACT_DETAIL_NODE_BASE_INL -#define UREACT_DETAIL_NODE_BASE_INL +#ifndef UREACT_DETAIL_NODE_INL +#define UREACT_DETAIL_NODE_INL #include #include -#include +#include UREACT_BEGIN_NAMESPACE namespace detail { -UREACT_FUNC node_base::node_base( context context ) +UREACT_FUNC node::node( context context ) : m_context( std::move( context ) ) { assert( !get_graph().is_locked() && "Can't create node from callback" ); m_id = get_graph().register_node(); } -UREACT_FUNC node_base::~node_base() +UREACT_FUNC node::~node() { detach_from_all(); get_graph().unregister_node( m_id ); } -UREACT_FUNC react_graph& node_base::get_graph() +UREACT_FUNC react_graph& node::get_graph() { return get_internals( m_context ).get_graph(); } -UREACT_FUNC const react_graph& node_base::get_graph() const +UREACT_FUNC const react_graph& node::get_graph() const { return get_internals( m_context ).get_graph(); } -UREACT_FUNC void node_base::attach_to( node_id parentId ) +UREACT_FUNC void node::attach_to( node_id parentId ) { m_parents.add( parentId ); get_graph().attach_node( m_id, parentId ); } -UREACT_FUNC void node_base::detach_from( node_id parentId ) +UREACT_FUNC void node::detach_from( node_id parentId ) { get_graph().detach_node( m_id, parentId ); m_parents.remove( parentId ); } -UREACT_FUNC void node_base::detach_from_all() +UREACT_FUNC void node::detach_from_all() { for( node_id parentId : m_parents ) get_graph().detach_node( m_id, parentId ); @@ -66,4 +66,4 @@ UREACT_FUNC void node_base::detach_from_all() UREACT_END_NAMESPACE -#endif //UREACT_DETAIL_NODE_BASE_INL +#endif //UREACT_DETAIL_NODE_INL diff --git a/include/ureact/detail/observer_node.hpp b/include/ureact/detail/observer_node.hpp index 379e3a4..8f33b22 100644 --- a/include/ureact/detail/observer_node.hpp +++ b/include/ureact/detail/observer_node.hpp @@ -11,7 +11,7 @@ #define UREACT_DETAIL_OBSERVER_NODE_HPP #include -#include +#include UREACT_BEGIN_NAMESPACE @@ -19,12 +19,12 @@ namespace detail { class observer_node - : public node_base + : public node , public observer_interface { public: explicit observer_node( const context& context ) - : node_base( context ) + : node( context ) {} }; diff --git a/include/ureact/events.hpp b/include/ureact/events.hpp index 10aa15b..8721341 100644 --- a/include/ureact/events.hpp +++ b/include/ureact/events.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include // event ranges often needed along with events.hpp header #include @@ -24,13 +24,13 @@ namespace detail { template -class event_stream_node : public node_base +class event_stream_node : public node { public: using event_value_list = std::vector; explicit event_stream_node( const context& context ) - : node_base( context ) + : node( context ) {} event_value_list& get_events() diff --git a/include/ureact/observer.hpp b/include/ureact/observer.hpp index df726ad..c5b6608 100644 --- a/include/ureact/observer.hpp +++ b/include/ureact/observer.hpp @@ -12,7 +12,7 @@ #include -#include +#include #include UREACT_BEGIN_NAMESPACE diff --git a/include/ureact/signal.hpp b/include/ureact/signal.hpp index 62850b4..be796c7 100644 --- a/include/ureact/signal.hpp +++ b/include/ureact/signal.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include UREACT_BEGIN_NAMESPACE @@ -23,16 +23,16 @@ namespace detail { template -class signal_node : public node_base +class signal_node : public node { public: explicit signal_node( const context& context ) - : node_base( context ) + : node( context ) {} template signal_node( const context& context, T&& value ) - : node_base( context ) + : node( context ) , m_value( std::forward( value ) ) {} diff --git a/tests/src/detail.cpp b/tests/src/detail.cpp index cf6f9c9..6d8cc58 100644 --- a/tests/src/detail.cpp +++ b/tests/src/detail.cpp @@ -10,14 +10,14 @@ #include #include "catch2_extra.hpp" -#include "ureact/detail/node_base.hpp" +#include "ureact/detail/node.hpp" #include "ureact/detail/slot_map.hpp" // non-copyable and non-movable -static_assert( !std::is_copy_constructible_v ); -static_assert( !std::is_copy_assignable_v ); -static_assert( !std::is_move_constructible_v ); -static_assert( !std::is_move_assignable_v ); +static_assert( !std::is_copy_constructible_v ); +static_assert( !std::is_copy_assignable_v ); +static_assert( !std::is_move_constructible_v ); +static_assert( !std::is_move_assignable_v ); namespace {