From 37a1dce0b41556bbba78f95b50b14d5ff0215650 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 14 Sep 2017 00:59:21 +0200 Subject: [PATCH] [DEV] continue removing STL --- doc/tutorial.md | 2 +- esignal/Base.cpp | 2 -- esignal/Base.hpp | 9 +++------ esignal/Connection.cpp | 2 -- esignal/Connection.hpp | 4 +--- esignal/Interface.hpp | 2 -- esignal/InterfaceData.cpp | 2 -- esignal/InterfaceData.hpp | 2 -- esignal/Signal.hpp | 23 ++++++++++------------- esignal/debug.cpp | 2 -- esignal/debug.hpp | 2 -- esignal/details/Signal.cpp | 2 -- esignal/details/Signal.hxx | 2 -- test/main.cpp | 3 +-- 14 files changed, 16 insertions(+), 43 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index bf7216e..0e4a1b3 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -13,7 +13,7 @@ Declaring a signal is really simple, just include the esignal file: You can now declare your signals. We have basicly declare some basic signal type: - void - bool - - std::string / std::u32string + - etk::String / etk::UString - int8_t / int16_t / int32_t / int64_t - uint8_t / uint16_t / uint32_t / uint64_t - float / double diff --git a/esignal/Base.cpp b/esignal/Base.cpp index 8e580c6..12aad7f 100644 --- a/esignal/Base.cpp +++ b/esignal/Base.cpp @@ -1,8 +1,6 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ diff --git a/esignal/Base.hpp b/esignal/Base.hpp index 3434037..e9dfbef 100644 --- a/esignal/Base.hpp +++ b/esignal/Base.hpp @@ -1,19 +1,16 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ #pragma once -#include +#include #include #include #include -#include -#include -#include +#include +#include #include /** diff --git a/esignal/Connection.cpp b/esignal/Connection.cpp index a45b5e0..ccdb73c 100644 --- a/esignal/Connection.cpp +++ b/esignal/Connection.cpp @@ -1,8 +1,6 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ #include diff --git a/esignal/Connection.hpp b/esignal/Connection.hpp index eaf748f..d52f2b0 100644 --- a/esignal/Connection.hpp +++ b/esignal/Connection.hpp @@ -1,13 +1,11 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ #pragma once -#include +#include #include #include #include diff --git a/esignal/Interface.hpp b/esignal/Interface.hpp index e4cb9fc..390590f 100644 --- a/esignal/Interface.hpp +++ b/esignal/Interface.hpp @@ -1,8 +1,6 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ #pragma once diff --git a/esignal/InterfaceData.cpp b/esignal/InterfaceData.cpp index 2189eff..e9e00e3 100644 --- a/esignal/InterfaceData.cpp +++ b/esignal/InterfaceData.cpp @@ -1,8 +1,6 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ diff --git a/esignal/InterfaceData.hpp b/esignal/InterfaceData.hpp index 147bef4..96a525e 100644 --- a/esignal/InterfaceData.hpp +++ b/esignal/InterfaceData.hpp @@ -1,8 +1,6 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ #pragma once diff --git a/esignal/Signal.hpp b/esignal/Signal.hpp index b1e449f..0e5b862 100644 --- a/esignal/Signal.hpp +++ b/esignal/Signal.hpp @@ -1,19 +1,16 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ #pragma once -#include -#include +#include #include +#include #include #include #include -#include #include namespace esignal { @@ -67,7 +64,7 @@ namespace esignal { virtual bool isSharedPtr(const ememory::SharedPtr& _obj); }; protected: - etk::Vector> m_executors; //!< List of all executors. + etk::Vector> m_executors; //!< List of all executors. private: /** * @brief Executor specific to the Shared_ptr caller that does not want to worry about the removing of the signal. @@ -223,7 +220,7 @@ namespace esignal { return esignal::Connection(); } ememory::SharedPtr> pointer = ememory::staticPointerCast>(m_data); - return pointer->connect(std::forward(_observer)); + return pointer->connect(etk::forward(_observer)); } /** * @brief Connect an function member on the signal. @@ -240,7 +237,7 @@ namespace esignal { return esignal::Connection(); } ememory::SharedPtr> pointer = ememory::staticPointerCast>(m_data); - return pointer->connect(_class, _func, std::forward(_args)...); + return pointer->connect(_class, _func, etk::forward(_args)...); } /** * @brief Connect an function member on the signal with the shared_ptr object. @@ -256,7 +253,7 @@ namespace esignal { return; } ememory::SharedPtr> pointer = ememory::staticPointerCast>(m_data); - return pointer->connect(_class, _func, std::forward(_args)...); + return pointer->connect(_class, _func, etk::forward(_args)...); } public: /** @@ -268,7 +265,7 @@ namespace esignal { return; } ememory::SharedPtr> pointer = ememory::staticPointerCast>(m_data); - return pointer->emit(std::forward(_args)...); + return pointer->emit(etk::forward(_args)...); } public: /** @@ -319,7 +316,7 @@ template template esignal::Connection esignal::SignalInternal::connect(OBSERVER_TYPE&& _observer ) { ESIGNAL_DEBUG("esignal: '" << getName() << "' try connect: '" << getName() << "' (observer)"); - std::unique_ptr executer(new Executor(std::forward(_observer))); + ememory::UniquePtr executer(new Executor(etk::forward(_observer))); size_t uid = executer->m_uid; m_executors.pushBack(etk::move(executer)); if (m_connectionObserver!=nullptr) { @@ -339,7 +336,7 @@ esignal::Connection esignal::SignalInternal::connect(CLASS_TYPE* _cla ESIGNAL_ERROR(" '" << getName() << "' Class pointer in nullptr"); return esignal::Connection(); } - std::unique_ptr executer(new Executor([=](const T_ARGS& ... _argBase){ + ememory::UniquePtr executer(new Executor([=](const T_ARGS& ... _argBase){ (*_class.*_func)(_argBase..., _arg... ); })); size_t uid = executer->m_uid; @@ -367,7 +364,7 @@ void esignal::SignalInternal::connect(const ememory::SharedPtr executer(new ExecutorShared(_class, [=]( const T_ARGS& ... _argBase){ + ememory::UniquePtr executer(new ExecutorShared(_class, [=]( const T_ARGS& ... _argBase){ // TODO : Check if compilator does not use the shared ptr ... (*directPointer.*_func)(_argBase..., _args... ); })); diff --git a/esignal/debug.cpp b/esignal/debug.cpp index 719bb8f..fa4a143 100644 --- a/esignal/debug.cpp +++ b/esignal/debug.cpp @@ -1,8 +1,6 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ diff --git a/esignal/debug.hpp b/esignal/debug.hpp index fed233d..00a39e5 100644 --- a/esignal/debug.hpp +++ b/esignal/debug.hpp @@ -1,8 +1,6 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ #pragma once diff --git a/esignal/details/Signal.cpp b/esignal/details/Signal.cpp index 0595366..cc976b0 100644 --- a/esignal/details/Signal.cpp +++ b/esignal/details/Signal.cpp @@ -1,8 +1,6 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ #include diff --git a/esignal/details/Signal.hxx b/esignal/details/Signal.hxx index 532a3d8..a64aeea 100644 --- a/esignal/details/Signal.hxx +++ b/esignal/details/Signal.hxx @@ -1,8 +1,6 @@ /** @file * @author Edouard DUPIN - * * @copyright 2016, Edouard DUPIN, all right reserved - * * @license MPL v2.0 (see license file) */ #pragma once diff --git a/test/main.cpp b/test/main.cpp index f89bdc5..5f6dc79 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -13,8 +13,7 @@ #include int main(int _argc, const char *_argv[]) { - ::testing::InitGoogleTest(&_argc, const_cast(_argv)); - etk::init(_argc, _argv); + etest::init(_argc, _argv); for (int32_t iii=0; iii<_argc ; ++iii) { etk::String data = _argv[iii]; if ( data == "-h"