From 9be46c34795bbea87f0978ee6ec45ada48699beb Mon Sep 17 00:00:00 2001 From: Krylov Yaroslav Date: Tue, 5 Sep 2023 00:08:14 +0400 Subject: [PATCH] #125 Move node_id_vector from graph_interface.hpp to a separate header It allow to leave it in detail namespace while all other graph_interface.hpp content will be moved into core namespace --- include/ureact/detail/graph_impl.inl | 1 + include/ureact/detail/graph_interface.hpp | 24 --------- include/ureact/detail/node_base.hpp | 1 + include/ureact/detail/node_id_vector.hpp | 50 +++++++++++++++++++ ...graph_interface.inl => node_id_vector.inl} | 8 +-- 5 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 include/ureact/detail/node_id_vector.hpp rename include/ureact/detail/{graph_interface.inl => node_id_vector.inl} (88%) diff --git a/include/ureact/detail/graph_impl.inl b/include/ureact/detail/graph_impl.inl index 2a64906..99721d2 100644 --- a/include/ureact/detail/graph_impl.inl +++ b/include/ureact/detail/graph_impl.inl @@ -19,6 +19,7 @@ #include #include #include +#include #include UREACT_BEGIN_NAMESPACE diff --git a/include/ureact/detail/graph_interface.hpp b/include/ureact/detail/graph_interface.hpp index 7e7dd85..bcee828 100644 --- a/include/ureact/detail/graph_interface.hpp +++ b/include/ureact/detail/graph_interface.hpp @@ -11,7 +11,6 @@ #define UREACT_DETAIL_GRAPH_INTERFACE_HPP #include -#include #include @@ -58,25 +57,6 @@ class node_id value_type m_id = -1; }; -class node_id_vector -{ -public: - using value_type = node_id; - using container_type = std::vector; - using iterator = container_type::iterator; - - void add( node_id id ); - void remove( node_id id ); - void clear(); - UREACT_WARN_UNUSED_RESULT bool empty() const; - - UREACT_WARN_UNUSED_RESULT iterator begin(); - UREACT_WARN_UNUSED_RESULT iterator end(); - -private: - container_type m_data; -}; - enum class update_result { unchanged, @@ -106,8 +86,4 @@ struct observer_interface UREACT_END_NAMESPACE -#if UREACT_HEADER_ONLY -# include -#endif - #endif //UREACT_DETAIL_GRAPH_INTERFACE_HPP diff --git a/include/ureact/detail/node_base.hpp b/include/ureact/detail/node_base.hpp index 394bf34..f83766c 100644 --- a/include/ureact/detail/node_base.hpp +++ b/include/ureact/detail/node_base.hpp @@ -17,6 +17,7 @@ #include #include #include +#include UREACT_BEGIN_NAMESPACE diff --git a/include/ureact/detail/node_id_vector.hpp b/include/ureact/detail/node_id_vector.hpp new file mode 100644 index 0000000..c3c9079 --- /dev/null +++ b/include/ureact/detail/node_id_vector.hpp @@ -0,0 +1,50 @@ +// +// Copyright (C) 2014-2017 Sebastian Jeckel. +// Copyright (C) 2020-2023 Krylov Yaroslav. +// +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef UREACT_DETAIL_NODE_ID_VECTOR_HPP +#define UREACT_DETAIL_NODE_ID_VECTOR_HPP + +#include + +#include +#include + +UREACT_BEGIN_NAMESPACE + +namespace detail +{ + +class node_id_vector +{ +public: + using value_type = node_id; + using container_type = std::vector; + using iterator = container_type::iterator; + + void add( node_id id ); + void remove( node_id id ); + void clear(); + UREACT_WARN_UNUSED_RESULT bool empty() const; + + UREACT_WARN_UNUSED_RESULT iterator begin(); + UREACT_WARN_UNUSED_RESULT iterator end(); + +private: + container_type m_data; +}; + +} // namespace detail + +UREACT_END_NAMESPACE + +#if UREACT_HEADER_ONLY +# include +#endif + +#endif //UREACT_DETAIL_NODE_ID_VECTOR_HPP diff --git a/include/ureact/detail/graph_interface.inl b/include/ureact/detail/node_id_vector.inl similarity index 88% rename from include/ureact/detail/graph_interface.inl rename to include/ureact/detail/node_id_vector.inl index a354ac3..e92d5e3 100644 --- a/include/ureact/detail/graph_interface.inl +++ b/include/ureact/detail/node_id_vector.inl @@ -7,14 +7,14 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#ifndef UREACT_DETAIL_GRAPH_INTERFACE_INL -#define UREACT_DETAIL_GRAPH_INTERFACE_INL +#ifndef UREACT_DETAIL_NODE_ID_VECTOR_INL +#define UREACT_DETAIL_NODE_ID_VECTOR_INL #include #include #include -#include +#include UREACT_BEGIN_NAMESPACE @@ -66,4 +66,4 @@ UREACT_FUNC node_id_vector::iterator node_id_vector::end() UREACT_END_NAMESPACE -#endif //UREACT_DETAIL_GRAPH_INTERFACE_INL +#endif //UREACT_DETAIL_NODE_ID_VECTOR_INL