[Release] wrt-commons_0.2.167 tizen_2.2 2.2.1_release submit/tizen_2.2/20131107.063249
authorsung-su.kim <sung-su.kim@samsung.com>
Fri, 1 Nov 2013 04:44:24 +0000 (13:44 +0900)
committersung-su.kim <sung-su.kim@samsung.com>
Fri, 1 Nov 2013 04:44:41 +0000 (13:44 +0900)
Merge branch 'master' into tizen_2.2

Change-Id: Ia37180989758abba56a28ac35046232211a99412

modules/event/include/dpl/event/inter_context_delegate.h
packaging/wrt-commons.spec

index 6fa097f..260a6a4 100644 (file)
 # include <bits/c++0x_warning.h>
 #else
 
-#include <functional>
-#include <list>
-#include <memory>
-#include <tuple>
-#include <type_traits>
-
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/arithmetic/add.hpp>
-#include <boost/preprocessor/repetition/repeat.hpp>
-
 #include <dpl/event/event_support.h>
 #include <dpl/event/thread_event_dispatcher.h>
 #include <dpl/event/main_event_dispatcher.h>
+#include <dpl/fast_delegate.h>
 #include <dpl/generic_event.h>
 #include <dpl/foreach.h>
 #include <dpl/recursive_mutex.h>
@@ -48,6 +39,9 @@
 #include <dpl/log/log.h>
 #include <dpl/assert.h>
 #include <dpl/apply.h>
+#include <tuple>
+#include <list>
+#include <memory>
 
 /*
  * - Created ICDelegate can be passed freely to other threads.
@@ -170,84 +164,15 @@ class ICDelegateSupportInterface
     template <typename ... ArgTypesList>
     friend class DPL::Event::ICDelegate;
 };
-
-
-template<size_t N>
-struct PlaceholdersBindHelper;
-
-#define DPL_PLACEHOLDERS_LIST_(z, n, t) ,BOOST_PP_CAT(std::placeholders::_,    \
-                                                      BOOST_PP_ADD(n, 1))
-#define DPL_PLACEHOLDERS_(count) BOOST_PP_REPEAT(count,                        \
-                                                 DPL_PLACEHOLDERS_LIST_,       \
-                                                 count)
-#define DPL_PLACEHOLDERS_BIND_HELPER_(count)                                   \
-template<>                                                                     \
-struct PlaceholdersBindHelper<count>                                           \
-{                                                                              \
-    template<typename Functor, typename ...Args>                               \
-    static auto bind(Functor&& f, Args&&... args)                              \
-            -> decltype(std::bind(std::forward<Functor>(f),                    \
-                        std::forward<Args>(args)...                            \
-                        DPL_PLACEHOLDERS_(count))) {                           \
-        return std::bind(std::forward<Functor>(f),                             \
-                         std::forward<Args>(args)...                           \
-                         DPL_PLACEHOLDERS_(count));                            \
-    }                                                                          \
-}
-
-DPL_PLACEHOLDERS_BIND_HELPER_(0);
-DPL_PLACEHOLDERS_BIND_HELPER_(1);
-DPL_PLACEHOLDERS_BIND_HELPER_(2);
-DPL_PLACEHOLDERS_BIND_HELPER_(3);
-DPL_PLACEHOLDERS_BIND_HELPER_(4);
-DPL_PLACEHOLDERS_BIND_HELPER_(5);
-DPL_PLACEHOLDERS_BIND_HELPER_(6);
-DPL_PLACEHOLDERS_BIND_HELPER_(7);
-DPL_PLACEHOLDERS_BIND_HELPER_(8);
-
-template<typename Functor>
-struct BindHelper;
-
-template<typename R, typename Type, typename ...Args>
-struct BindHelper<R(Type::*)(Args...)>
-{
-    typedef std::function<R(Args...)> ResultType;
-
-    template<typename Functor>
-    static ResultType bind(Functor&& f, Type* type) {
-        return PlaceholdersBindHelper<sizeof...(Args)>::
-                bind(std::forward<Functor>(f), type);
-    }
-};
-
-template<typename R, typename ...Args>
-struct BindHelper<R(Args...)>
-{
-    typedef std::function<R(Args...)> ResultType;
-
-    template<typename Functor>
-    static ResultType bind(Functor&& f) {
-        return PlaceholdersBindHelper<sizeof...(Args)>::
-                bind(std::forward<Functor>(f));
-    }
-};
-
-template<typename Functor, typename ...Args>
-typename BindHelper<typename std::decay<Functor>::type>::ResultType
-bind(Functor&& f, Args&&... args)
-{
-    return BindHelper<typename std::decay<Functor>::type>::
-            bind(std::forward<Functor>(f), std::forward<Args>(args)...);
-}
 } //ICDPrivate
 
 // Better makeDelegate then DPL::MakeDelegate
 template<typename ThisType, typename ... ArgTypesList>
-std::function<void (ArgTypesList ...)>
+FastDelegate<void (ArgTypesList ...)>
 makeDelegate(ThisType* This,
              void (ThisType::*Func)(ArgTypesList ...))
 {
-    return ICDPrivate::bind(Func, This);
+    return FastDelegate<void (ArgTypesList ...)>(This, Func);
 }
 
 // ICDelegate class represents delegate that can be called from
@@ -260,7 +185,7 @@ class ICDelegate
     ICDelegate()
     {}
     ICDelegate(ICDPrivate::ICDelegateSupportInterface* base,
-               std::function<void (ArgTypesList ...)> outerDelegate,
+               DPL::FastDelegate<void (ArgTypesList ...)> outerDelegate,
                ICD::Reuse reuse)
     {
         ICDSharedData* hlp = new ICDSharedData(base, outerDelegate, reuse);
@@ -311,7 +236,7 @@ class ICDelegate
         std::tuple<ArgTypesList ...> args;
     };
 
-    typedef std::function<void (const PrivateEvent&)>
+    typedef DPL::FastDelegate<void (const PrivateEvent&)>
     ICDSharedDataDelegateType;
     class ICDSharedData : private DPL::Event::EventSupport<PrivateEvent>,
         public std::enable_shared_from_this<ICDSharedData>,
@@ -320,7 +245,7 @@ class ICDelegate
       public:
         ICDSharedData(
             ICDPrivate::ICDelegateSupportInterface *base,
-            std::function<void (ArgTypesList ...)> outerDelegate,
+            DPL::FastDelegate<void (ArgTypesList ...)> outerDelegate,
             ICD::Reuse reuse) :
             m_base(base),
             m_outerDelegate(outerDelegate),
@@ -362,7 +287,7 @@ class ICDelegate
         friend class std::shared_ptr<ICDSharedData>;
         ICDSharedDataDelegateType m_subDelegate;
         ICDPrivate::ICDelegateSupportInterface* m_base;
-        std::function<void (ArgTypesList ...)> m_outerDelegate;
+        DPL::FastDelegate<void (ArgTypesList ...)> m_outerDelegate;
         ICD::Reuse m_reuse;
 
         void delegateForwarder(const PrivateEvent& event)
@@ -371,7 +296,7 @@ class ICDelegate
                 std::static_pointer_cast<ICDSharedDataBase>(event.helper));
             ICDPrivate::ICDSharedDataBase::ScopedLock lock(ptr);
 
-            Assert(m_outerDelegate);
+            Assert(!m_outerDelegate.empty());
             if (ptr->isDisabled()) {
                 LogPedantic("ICDSharedData has been disabled - call is ignored");
             } else {
index 5569576..7ff8b12 100644 (file)
@@ -1,7 +1,7 @@
 #git:framework/web/wrt-commons
 Name:       wrt-commons
 Summary:    Wrt common library
-Version:    0.2.166
+Version:    0.2.167
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
@@ -24,7 +24,6 @@ BuildRequires:  pkgconfig(openssl)
 BuildRequires:  pkgconfig(libiri)
 BuildRequires:  pkgconfig(libidn)
 BuildRequires:  pkgconfig(minizip)
-BuildRequires:  boost-devel
 
 %description
 Wrt common library