Aurum: Improve performance of findElements command
[platform/core/uifw/aurum.git] / libaurum / inc / Comparer.h
index eb1f23b..66cde43 100644 (file)
@@ -82,16 +82,16 @@ public:
      *        it finds focused window then start to find object as it root.
      *        Finds all objects to the end of tree.
      *
+     * @param[in] ret vector where found objects stored
      * @param[in] device @UiDevice
      * @param[in] selector @UiSelector
      * @param[in] root @AccessibleNode root object(focused window on current state)
      * @param[in] earlyReturn find all object or not (default = false)
      *
-     * @return AccessibleNode if found, else nullptr
      *
      * @since_tizen 6.5
      */
-    static std::vector<std::shared_ptr<AccessibleNode>> findObjects(
+    static void findObjects(std::vector<std::shared_ptr<AccessibleNode>> &ret,
         const std::shared_ptr<UiDevice>& device, const std::shared_ptr<UiSelector>& selector,
         const std::shared_ptr<AccessibleNode>& root, bool earlyReturn = false);
 
@@ -101,17 +101,20 @@ private:
      *
      * @brief Starts find object from root.
      *
+     * @param[in] ret vector where found objects stored
      * @param[in] root @AccessibleNode
      *
      * @since_tizen 6.5
      */
-    std::vector<std::shared_ptr<AccessibleNode>> findObjects(const std::shared_ptr<AccessibleNode>& root);
+    void findObjects(std::vector<std::shared_ptr<AccessibleNode>> &ret,
+        const std::shared_ptr<AccessibleNode>& root);
 
     /**
      * @internal
      *
      * @brief It updates all partialMatches and traverse tree till given depth to find objects
      *
+     * @param[in] ret vector where found objects stored
      * @param[in] root @AccessibleNode
      * @param[in] index node index
      * @param[in] depth tree depth
@@ -119,7 +122,8 @@ private:
      *
      * @since_tizen 6.5
      */
-    std::vector<std::shared_ptr<AccessibleNode>> findObjects(
+    void findObjects(
+        std::vector<std::shared_ptr<AccessibleNode>> &ret,
         const std::shared_ptr<AccessibleNode>& root, const int &index, const int &depth,
         std::list<std::shared_ptr<PartialMatch>> &partialMatches);