[DEV] remove STL

This commit is contained in:
Edouard DUPIN 2017-09-07 23:38:26 +02:00
parent d6cc27ac31
commit ab070be3f8
10 changed files with 18 additions and 18 deletions

View File

@ -14,7 +14,7 @@
#include <functional> #include <functional>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
#include <mutex> #include <ethread/Mutex.hpp>
/** /**
* @brief esignal global interface for all signal implementation * @brief esignal global interface for all signal implementation
@ -22,7 +22,7 @@
namespace esignal { namespace esignal {
class BaseInternal : public ememory::EnableSharedFromThis<esignal::BaseInternal> { class BaseInternal : public ememory::EnableSharedFromThis<esignal::BaseInternal> {
public: public:
using ObserverConnection = std::function<void(size_t)>; //!< Define an Observer of the number of observer using ObserverConnection = etk::Function<void(size_t)>; //!< Define an Observer of the number of observer
protected: protected:
bool m_periodic; //!< The signal is periodic ==> no log with this signal ... (no really needed) bool m_periodic; //!< The signal is periodic ==> no log with this signal ... (no really needed)
static size_t s_uid; //!< global id of the signal (STATIC) static size_t s_uid; //!< global id of the signal (STATIC)

View File

@ -21,7 +21,7 @@ namespace esignal {
template<class... T_ARGS> template<class... T_ARGS>
class SignalInternal : public esignal::BaseInternal { class SignalInternal : public esignal::BaseInternal {
public: public:
using Observer = std::function<void(const T_ARGS&...)>; //!< Define an Observer: function pointer using Observer = etk::Function<void(const T_ARGS&...)>; //!< Define an Observer: function pointer
protected: protected:
int32_t m_callInProgress; //!< know if we are in a recursive loop int32_t m_callInProgress; //!< know if we are in a recursive loop
public: public:
@ -174,7 +174,7 @@ namespace esignal {
*/ */
template<class CLASS_TYPE, template<class CLASS_TYPE,
class FUNC_TYPE, class FUNC_TYPE,
typename std::enable_if<std::is_base_of<esignal::Interface, CLASS_TYPE>::value typename etk::EnableIf<etk::IsBaseOf<esignal::Interface, CLASS_TYPE>::value
, int>::type = 0> , int>::type = 0>
Signal(CLASS_TYPE* _class, Signal(CLASS_TYPE* _class,
FUNC_TYPE _func, FUNC_TYPE _func,
@ -182,7 +182,7 @@ namespace esignal {
const etk::String& _description); const etk::String& _description);
template<class CLASS_TYPE, template<class CLASS_TYPE,
class FUNC_TYPE, class FUNC_TYPE,
typename std::enable_if<!std::is_base_of<esignal::Interface, CLASS_TYPE>::value typename etk::EnableIf<!etk::IsBaseOf<esignal::Interface, CLASS_TYPE>::value
, int>::type = 0> , int>::type = 0>
Signal(CLASS_TYPE* _class, Signal(CLASS_TYPE* _class,
FUNC_TYPE _func, FUNC_TYPE _func,
@ -381,7 +381,7 @@ void esignal::SignalInternal<T_ARGS...>::connect(const ememory::SharedPtr<PARENT
template<class... T_ARGS> template<class... T_ARGS>
template<class CLASS_TYPE, template<class CLASS_TYPE,
class FUNC_TYPE, class FUNC_TYPE,
typename std::enable_if<std::is_base_of<esignal::Interface, CLASS_TYPE>::value typename etk::EnableIf<etk::IsBaseOf<esignal::Interface, CLASS_TYPE>::value
, int>::type> , int>::type>
esignal::Signal<T_ARGS...>::Signal(CLASS_TYPE* _class, esignal::Signal<T_ARGS...>::Signal(CLASS_TYPE* _class,
FUNC_TYPE _func, FUNC_TYPE _func,
@ -407,7 +407,7 @@ esignal::Signal<T_ARGS...>::Signal(CLASS_TYPE* _class,
template<class... T_ARGS> template<class... T_ARGS>
template<class CLASS_TYPE, template<class CLASS_TYPE,
class FUNC_TYPE, class FUNC_TYPE,
typename std::enable_if<!std::is_base_of<esignal::Interface, CLASS_TYPE>::value typename etk::EnableIf<!etk::IsBaseOf<esignal::Interface, CLASS_TYPE>::value
, int>::type> , int>::type>
esignal::Signal<T_ARGS...>::Signal(CLASS_TYPE* _class, esignal::Signal<T_ARGS...>::Signal(CLASS_TYPE* _class,
FUNC_TYPE _func, FUNC_TYPE _func,

View File

@ -37,7 +37,7 @@ def configure(target, my_module):
]) ])
my_module.add_depend([ my_module.add_depend([
'esignal', 'esignal',
'gtest', 'etest',
'test-debug' 'test-debug'
]) ])
return True return True

View File

@ -10,7 +10,7 @@
#include <etk/types.hpp> #include <etk/types.hpp>
#include <etk/etk.hpp> #include <etk/etk.hpp>
#include <test-debug/debug.hpp> #include <test-debug/debug.hpp>
#include <gtest/gtest.h> #include <etest/etest.hpp>
int main(int _argc, const char *_argv[]) { int main(int _argc, const char *_argv[]) {
::testing::InitGoogleTest(&_argc, const_cast<char **>(_argv)); ::testing::InitGoogleTest(&_argc, const_cast<char **>(_argv));

View File

@ -7,7 +7,7 @@
*/ */
#define NAME "SingleArg" #define NAME "SingleArg"
#include <gtest/gtest.h> #include <etest/etest.hpp>
#include <esignal/Signal.hpp> #include <esignal/Signal.hpp>
#include <esignal/Interface.hpp> #include <esignal/Interface.hpp>
#include <ememory/memory.hpp> #include <ememory/memory.hpp>

View File

@ -7,7 +7,7 @@
*/ */
#define NAME "SingleArg" #define NAME "SingleArg"
#include <gtest/gtest.h> #include <etest/etest.hpp>
#include <esignal/Signal.hpp> #include <esignal/Signal.hpp>
#include <esignal/Interface.hpp> #include <esignal/Interface.hpp>
#include <ememory/memory.hpp> #include <ememory/memory.hpp>
@ -24,7 +24,7 @@ class testCallback {
m_int32 = 0; m_int32 = 0;
m_string = ""; m_string = "";
} }
using stupidFunctor = std::function<void()>; using stupidFunctor = etk::Function<void()>;
stupidFunctor m_emptyFunctor; stupidFunctor m_emptyFunctor;

View File

@ -7,7 +7,7 @@
*/ */
#define NAME "SingleArg" #define NAME "SingleArg"
#include <gtest/gtest.h> #include <etest/etest.hpp>
#include <esignal/Signal.hpp> #include <esignal/Signal.hpp>
#include <esignal/Interface.hpp> #include <esignal/Interface.hpp>
#include <ememory/memory.hpp> #include <ememory/memory.hpp>

View File

@ -7,7 +7,7 @@
*/ */
#define NAME "SingleArg" #define NAME "SingleArg"
#include <gtest/gtest.h> #include <etest/etest.hpp>
#include <esignal/Signal.hpp> #include <esignal/Signal.hpp>
#include <esignal/Interface.hpp> #include <esignal/Interface.hpp>
#include <ememory/memory.hpp> #include <ememory/memory.hpp>

View File

@ -7,7 +7,7 @@
*/ */
#define NAME "SingleArg" #define NAME "SingleArg"
#include <gtest/gtest.h> #include <etest/etest.hpp>
#include <esignal/Signal.hpp> #include <esignal/Signal.hpp>
#include <esignal/Interface.hpp> #include <esignal/Interface.hpp>
#include <ememory/memory.hpp> #include <ememory/memory.hpp>
@ -27,7 +27,7 @@ class testCallbackShared : public ememory::EnableSharedFromThis<testCallbackShar
virtual ~testCallbackShared() { virtual ~testCallbackShared() {
} }
//using stupidFunctor = std::function<void()>; //using stupidFunctor = etk::Function<void()>;
using stupidFunctor = void(); using stupidFunctor = void();

View File

@ -7,7 +7,7 @@
*/ */
#define NAME "SingleArg" #define NAME "SingleArg"
#include <gtest/gtest.h> #include <etest/etest.hpp>
#include <esignal/Signal.hpp> #include <esignal/Signal.hpp>
#include <esignal/Interface.hpp> #include <esignal/Interface.hpp>
#include <ememory/memory.hpp> #include <ememory/memory.hpp>
@ -193,7 +193,7 @@ TEST(test_signal_static_func, localFunctionMixedIntString) {
#else #else
/* /*
template<class Func, class... ARGS_BASE, class... ARGS_CURR> template<class Func, class... ARGS_BASE, class... ARGS_CURR>
std::function<void(const ARGS_BASE&...)> complete_args(Func _f, ARGS_BASE... _arg) { etk::Function<void(const ARGS_BASE&...)> complete_args(Func _f, ARGS_BASE... _arg) {
return [=](const ARGS_BASE&..., ARGS_CURR...){ return [=](const ARGS_BASE&..., ARGS_CURR...){
return _f( cargs..., _arg... ); return _f( cargs..., _arg... );
}; };