From 17a4e8a8daf62192b3e0d37237a91e18c4adad08 Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Thu, 1 Feb 2018 22:47:48 +0100 Subject: [PATCH] Remove the continuable-api header --- include/continuable/continuable-api.hpp | 83 ------------------- include/continuable/continuable-base.hpp | 28 ++++++- .../continuable/continuable-promise-base.hpp | 1 - include/continuable/continuable-testing.hpp | 1 - include/continuable/continuable-trait.hpp | 1 - .../continuable/continuable-transforms.hpp | 1 - include/continuable/continuable-types.hpp | 1 - include/continuable/continuable.hpp | 15 +++- include/continuable/detail/awaiting.hpp | 1 - include/continuable/detail/base.hpp | 1 - include/continuable/detail/composition.hpp | 5 +- include/continuable/detail/expected.hpp | 1 - include/continuable/detail/hints.hpp | 3 +- include/continuable/detail/testing.hpp | 1 - include/continuable/detail/traits.hpp | 1 - include/continuable/detail/transforms.hpp | 1 - include/continuable/detail/types.hpp | 4 +- include/continuable/detail/util.hpp | 1 - test/playground/CMakeLists.txt | 1 - 19 files changed, 47 insertions(+), 104 deletions(-) delete mode 100644 include/continuable/continuable-api.hpp diff --git a/include/continuable/continuable-api.hpp b/include/continuable/continuable-api.hpp deleted file mode 100644 index 48a084f..0000000 --- a/include/continuable/continuable-api.hpp +++ /dev/null @@ -1,83 +0,0 @@ - -/* - - /~` _ _ _|_. _ _ |_ | _ - \_,(_)| | | || ||_|(_||_)|(/_ - - https://github.com/Naios/continuable - v2.0.0 - - Copyright(c) 2015 - 2018 Denis Blank - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files(the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and / or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions : - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -#ifndef CONTINUABLE_DETAIL_API_HPP_INCLUDED -#define CONTINUABLE_DETAIL_API_HPP_INCLUDED - -/// Declares the continuable library namespace. -/// -/// The most important class is cti::continuable_base, that provides the -/// whole functionality for continuation chaining. -/// -/// The class cti::continuable_base is created through the -/// cti::make_continuable() function which accepts a callback taking function. -/// -/// Also there are following support functions available: -/// - cti::when_all() - connects cti::continuable_base's to an `all` connection. -/// - cti::when_any() - connects cti::continuable_base's to an `any` connection. -/// - cti::when_seq() - connects cti::continuable_base's to a sequence. -/// -namespace cti { -/// The main class of the continuable library, it provides the functionality -/// for chaining callbacks and continuations together to a unified hierarchy. -/// -/// The most important method is the cti::continuable_base::then() method, -/// which allows to attach a callback to the continuable. -/// -/// Use the continuable types defined in `continuable/continuable.hpp`, -/// in order to use this class. -/// -/// \tparam Data The internal data which is used to store the current -/// continuation and intermediate lazy connection result. -/// -/// \tparam Annotation The internal data used to store the current signature -/// hint or strategy used for combining lazy connections. -/// -/// \note Nearly all methods of the cti::continuable_base are required to be -/// called as r-value. This is required because the continuable carries -/// variables which are consumed when the object is transformed as part -/// of a method call. You may copy a continuable which underlying -/// storages are copyable to split the call hierarchy into multiple parts. -/// -/// \attention The continuable_base objects aren't intended to be stored. -/// If you want to store a continuble_base you should always -/// call the continuable_base::freeze method for disabling the -/// invocation on destruction. -/// -/// \since version 1.0.0 -template -class continuable_base; - -/// Declares the internal private namespace of the continuable library -/// which isn't intended to be used by users of the library. -namespace detail {} -} // namespace cti - -#endif // CONTINUABLE_DETAIL_API_HPP_INCLUDED diff --git a/include/continuable/continuable-base.hpp b/include/continuable/continuable-base.hpp index 164a732..d4185b9 100644 --- a/include/continuable/continuable-base.hpp +++ b/include/continuable/continuable-base.hpp @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -45,6 +44,33 @@ #include namespace cti { +/// The main class of the continuable library, it provides the functionality +/// for chaining callbacks and continuations together to a unified hierarchy. +/// +/// The most important method is the cti::continuable_base::then() method, +/// which allows to attach a callback to the continuable. +/// +/// Use the continuable types defined in `continuable/continuable.hpp`, +/// in order to use this class. +/// +/// \tparam Data The internal data which is used to store the current +/// continuation and intermediate lazy connection result. +/// +/// \tparam Annotation The internal data used to store the current signature +/// hint or strategy used for combining lazy connections. +/// +/// \note Nearly all methods of the cti::continuable_base are required to be +/// called as r-value. This is required because the continuable carries +/// variables which are consumed when the object is transformed as part +/// of a method call. You may copy a continuable which underlying +/// storages are copyable to split the call hierarchy into multiple parts. +/// +/// \attention The continuable_base objects aren't intended to be stored. +/// If you want to store a continuble_base you should always +/// call the continuable_base::freeze method for disabling the +/// invocation on destruction. +/// +/// \since version 1.0.0 template class continuable_base { diff --git a/include/continuable/continuable-promise-base.hpp b/include/continuable/continuable-promise-base.hpp index 4feabdb..a3e60d9 100644 --- a/include/continuable/continuable-promise-base.hpp +++ b/include/continuable/continuable-promise-base.hpp @@ -34,7 +34,6 @@ #include #include -#include #include #include #include diff --git a/include/continuable/continuable-testing.hpp b/include/continuable/continuable-testing.hpp index 40ad250..a269c66 100644 --- a/include/continuable/continuable-testing.hpp +++ b/include/continuable/continuable-testing.hpp @@ -31,7 +31,6 @@ #ifndef CONTINUABLE_TESTING_HPP_INCLUDED #define CONTINUABLE_TESTING_HPP_INCLUDED -#include #include #include diff --git a/include/continuable/continuable-trait.hpp b/include/continuable/continuable-trait.hpp index d5d10d8..6d68ce0 100644 --- a/include/continuable/continuable-trait.hpp +++ b/include/continuable/continuable-trait.hpp @@ -33,7 +33,6 @@ #include -#include #include #include #include diff --git a/include/continuable/continuable-transforms.hpp b/include/continuable/continuable-transforms.hpp index 1f211c2..765833f 100644 --- a/include/continuable/continuable-transforms.hpp +++ b/include/continuable/continuable-transforms.hpp @@ -31,7 +31,6 @@ #ifndef CONTINUABLE_TRANSFORMS_HPP_INCLUDED #define CONTINUABLE_TRANSFORMS_HPP_INCLUDED -#include #include namespace cti { diff --git a/include/continuable/continuable-types.hpp b/include/continuable/continuable-types.hpp index b6d818d..fcebb40 100644 --- a/include/continuable/continuable-types.hpp +++ b/include/continuable/continuable-types.hpp @@ -35,7 +35,6 @@ #include -#include #include namespace cti { diff --git a/include/continuable/continuable.hpp b/include/continuable/continuable.hpp index a74fe2c..a844fbb 100644 --- a/include/continuable/continuable.hpp +++ b/include/continuable/continuable.hpp @@ -31,7 +31,20 @@ #ifndef CONTINUABLE_HPP_INCLUDED #define CONTINUABLE_HPP_INCLUDED -#include +/// Declares the continuable library namespace. +/// +/// The most important class is cti::continuable_base, that provides the +/// whole functionality for continuation chaining. +/// +/// The class cti::continuable_base is created through the +/// cti::make_continuable() function which accepts a callback taking function. +/// +/// Also there are following support functions available: +/// - cti::when_all() - connects cti::continuable_base's to an `all` connection. +/// - cti::when_any() - connects cti::continuable_base's to an `any` connection. +/// - cti::when_seq() - connects cti::continuable_base's to a sequence. +namespace cti {} + #include #include #include diff --git a/include/continuable/detail/awaiting.hpp b/include/continuable/detail/awaiting.hpp index b61a5f7..201029d 100644 --- a/include/continuable/detail/awaiting.hpp +++ b/include/continuable/detail/awaiting.hpp @@ -37,7 +37,6 @@ #include #include -#include #include #include #include diff --git a/include/continuable/detail/base.hpp b/include/continuable/detail/base.hpp index 359c7cb..77967f6 100644 --- a/include/continuable/detail/base.hpp +++ b/include/continuable/detail/base.hpp @@ -35,7 +35,6 @@ #include #include -#include #include #include #include diff --git a/include/continuable/detail/composition.hpp b/include/continuable/detail/composition.hpp index 8d6f371..458b9ed 100644 --- a/include/continuable/detail/composition.hpp +++ b/include/continuable/detail/composition.hpp @@ -38,7 +38,6 @@ #include #include -#include #include #include #include @@ -357,8 +356,8 @@ auto finalize_composition( // std::pair, size_constant> // ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ // Continuation pos Result pos - constexpr auto const begin = std::make_pair(traits::size_constant_of<0>(), - traits::size_constant_of<0>()); + constexpr auto const begin = std::make_pair( + traits::size_constant_of<0>(), traits::size_constant_of<0>()); constexpr auto const pack = traits::identify{}; constexpr auto const end = traits::pack_size_of(pack); auto const condition = [=](auto pos) { return pos.first < end; }; diff --git a/include/continuable/detail/expected.hpp b/include/continuable/detail/expected.hpp index c3f226e..0f77b3b 100644 --- a/include/continuable/detail/expected.hpp +++ b/include/continuable/detail/expected.hpp @@ -36,7 +36,6 @@ #include #include -#include #include #include #include diff --git a/include/continuable/detail/hints.hpp b/include/continuable/detail/hints.hpp index 69197be..1e41297 100644 --- a/include/continuable/detail/hints.hpp +++ b/include/continuable/detail/hints.hpp @@ -33,9 +33,8 @@ #include -#include #include -#include +#include namespace cti { namespace detail { diff --git a/include/continuable/detail/testing.hpp b/include/continuable/detail/testing.hpp index 822e44a..1f30fe9 100644 --- a/include/continuable/detail/testing.hpp +++ b/include/continuable/detail/testing.hpp @@ -36,7 +36,6 @@ #include -#include #include #include #include diff --git a/include/continuable/detail/traits.hpp b/include/continuable/detail/traits.hpp index a0ddb3f..ef52c76 100644 --- a/include/continuable/detail/traits.hpp +++ b/include/continuable/detail/traits.hpp @@ -37,7 +37,6 @@ #include #include -#include #include namespace cti { diff --git a/include/continuable/detail/transforms.hpp b/include/continuable/detail/transforms.hpp index ec1de64..b4b6892 100644 --- a/include/continuable/detail/transforms.hpp +++ b/include/continuable/detail/transforms.hpp @@ -33,7 +33,6 @@ #include -#include #include #include #include diff --git a/include/continuable/detail/types.hpp b/include/continuable/detail/types.hpp index 92cb237..0b7204d 100644 --- a/include/continuable/detail/types.hpp +++ b/include/continuable/detail/types.hpp @@ -31,7 +31,6 @@ #ifndef CONTINUABLE_DETAIL_TYPES_HPP_INCLUDED #define CONTINUABLE_DETAIL_TYPES_HPP_INCLUDED -#include #include #ifndef CONTINUABLE_WITH_CUSTOM_ERROR_TYPE @@ -43,6 +42,9 @@ #endif // CONTINUABLE_WITH_CUSTOM_ERROR_TYPE namespace cti { +template +class continuable_base; + namespace detail { /// Contains types used globally across the library namespace types { diff --git a/include/continuable/detail/util.hpp b/include/continuable/detail/util.hpp index daca84f..452cad0 100644 --- a/include/continuable/detail/util.hpp +++ b/include/continuable/detail/util.hpp @@ -36,7 +36,6 @@ #include #include -#include #include #include diff --git a/test/playground/CMakeLists.txt b/test/playground/CMakeLists.txt index fd50079..1a9e1e6 100644 --- a/test/playground/CMakeLists.txt +++ b/test/playground/CMakeLists.txt @@ -1,5 +1,4 @@ set(LIB_SOURCES - ${CMAKE_SOURCE_DIR}/include/continuable/continuable-api.hpp ${CMAKE_SOURCE_DIR}/include/continuable/continuable.hpp ${CMAKE_SOURCE_DIR}/include/continuable/continuable-types.hpp ${CMAKE_SOURCE_DIR}/include/continuable/continuable-base.hpp