Changes for std::vector removal from api 60/40160/3
authorLee Morgan <Lee.morgan@partner.samsung.com>
Fri, 29 May 2015 13:51:23 +0000 (14:51 +0100)
committerLee Morgan <Lee.morgan@partner.samsung.com>
Fri, 29 May 2015 16:09:21 +0000 (17:09 +0100)
Change-Id: I7e5cfca4f7c5dd413c353cbe81f36bdf7f18b9ad

automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
dali-toolkit/internal/builder/builder-signals.cpp
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.h
dali-toolkit/public-api/controls/control-impl.cpp

index 23b0a94..310a19f 100644 (file)
@@ -199,17 +199,17 @@ int UtcDaliControlImplDisableGestureDetector(void)
     TapGestureDetector tap = dummyImpl.GetTapGestureDetector();
     LongPressGestureDetector longPress = dummyImpl.GetLongPressGestureDetector();
 
-    DALI_TEST_EQUALS( pinch.GetAttachedActors().empty(), false, TEST_LOCATION );
-    DALI_TEST_EQUALS( pan.GetAttachedActors().empty(), false, TEST_LOCATION );
-    DALI_TEST_EQUALS( tap.GetAttachedActors().empty(), false, TEST_LOCATION );
-    DALI_TEST_EQUALS( longPress.GetAttachedActors().empty(), false, TEST_LOCATION );
+    DALI_TEST_EQUALS( 0 == pinch.GetAttachedActorCount(), false, TEST_LOCATION );
+    DALI_TEST_EQUALS( 0 == pan.GetAttachedActorCount(), false, TEST_LOCATION );
+    DALI_TEST_EQUALS( 0 == tap.GetAttachedActorCount(), false, TEST_LOCATION );
+    DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), false, TEST_LOCATION );
 
     dummyImpl.DisableGestureDetection( Gesture::Type(Gesture::Pinch | Gesture::Pan | Gesture::Tap | Gesture::LongPress) );
 
-    DALI_TEST_EQUALS( pinch.GetAttachedActors().empty(), true, TEST_LOCATION );
-    DALI_TEST_EQUALS( pan.GetAttachedActors().empty(), true, TEST_LOCATION );
-    DALI_TEST_EQUALS( tap.GetAttachedActors().empty(), true, TEST_LOCATION );
-    DALI_TEST_EQUALS( longPress.GetAttachedActors().empty(), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( 0 == pinch.GetAttachedActorCount(), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( 0 == pan.GetAttachedActorCount(), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( 0 == tap.GetAttachedActorCount(), true, TEST_LOCATION );
+    DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), true, TEST_LOCATION );
   }
   END_TEST;
 }
@@ -921,7 +921,7 @@ int UtcDaliControlImplOnAccessibilityActivatedP(void)
   BaseHandle handle = type.CreateInstance();
   DALI_TEST_CHECK( handle );
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
   DALI_TEST_EQUALS( false, handle.DoAction("control-activated", attributes), TEST_LOCATION );
 
   END_TEST;
index 804deb3..32c43d4 100644 (file)
@@ -54,7 +54,7 @@ struct ChildActorAction
   std::string actorName;
   std::string actionName;
   std::string childName;
-  PropertyValueContainer parameters;
+  Property::Map parameters;
 
   void operator()(void)
   {
@@ -115,7 +115,7 @@ struct GenericAction
 {
   std::string actorName;
   std::string actionName;
-  PropertyValueContainer parameters;
+  Property::Map parameters;
 
   void operator()(void)
   {
@@ -376,25 +376,17 @@ Property::Value GetPropertyValue(const TreeNode &child)
  * Gets Parmeter list from child
  * params is be cleared before insertion
  */
-void GetParameters(const TreeNode& child, PropertyValueContainer& params)
+void GetParameters(const TreeNode& child, Property::Map& params)
 {
   if( OptionalChild c = IsChild(child, "parameters") )
   {
     const TreeNode& node = *c;
 
-    if(0 == node.Size())
-    {
-      GetPropertyValue(node);
-    }
-    else
-    {
-      params.clear();
-      params.reserve(node.Size());
+    params.Clear();
 
-      for(TreeNode::ConstIterator iter(node.CBegin()); iter != node.CEnd(); ++iter)
-      {
-        params.push_back( GetPropertyValue( (*iter).second ) );
-      }
+    for(TreeNode::ConstIterator iter(node.CBegin()); iter != node.CEnd(); ++iter)
+    {
+      params[ (*iter).first ] = GetPropertyValue( (*iter).second );
     }
   }
 }
index 1c31fe5..c0d52ca 100644 (file)
@@ -905,7 +905,7 @@ Actor& Button::GetDisabledBackgroundImage()
   return mDisabledBackgroundContent;
 }
 
-bool Button::DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes )
+  bool Button::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
 {
   bool ret = false;
 
@@ -924,7 +924,7 @@ bool Button::DoAction( BaseObject* object, const std::string& actionName, const
   return ret;
 }
 
-void Button::DoClickAction( const PropertyValueContainer& attributes )
+  void Button::DoClickAction( const Property::Map& attributes )
 {
   // Prevents the button signals from doing a recursive loop by sending an action
   // and re-emitting the signals.
@@ -1210,7 +1210,7 @@ void Button::OnInitialize()
 void Button::OnActivated()
 {
   // When the button is activated, it performs the click action
-  PropertyValueContainer attributes;
+  Property::Map attributes;
   DoClickAction( attributes );
 }
 
index 5197aca..02b1360 100644 (file)
@@ -260,7 +260,7 @@ public:
    * @param[in] attributes The attributes with which to perfrom this action.
    * @return true if action has been accepted by this control
    */
-  static bool DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes );
+  static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes );
 
 protected:
 
@@ -280,7 +280,7 @@ private:
    * Perform the click action to click the button.
    * @param[in] attributes The attributes to perfrom this action.
    */
-  void DoClickAction( const PropertyValueContainer& attributes );
+  void DoClickAction( const Property::Map& attributes );
 
   /**
    * This method is called after the button initialization.
index eb7c14b..f72e8b5 100644 (file)
@@ -67,7 +67,7 @@ BaseHandle Create()
  * @return true if action has been accepted by this control
  */
 const char* ACTION_CONTROL_ACTIVATED = "control-activated";
-static bool DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes )
+  static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
 {
   bool ret = false;