[coco] Introduce non-member helpers for Bag (#1440)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 11 Sep 2018 04:26:59 +0000 (13:26 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 11 Sep 2018 04:26:59 +0000 (13:26 +0900)
This commit introduces the following non-member helpers for Bag
 - dependent_objects
 - readers
 - updaters

These functions have a corresponding method in Bag, but these methods
will be deprecated.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/coco/core/include/coco/IR/Bag.h
contrib/coco/core/src/IR/Bag.cpp

index d3c81d9..bc2f0e5 100644 (file)
@@ -55,17 +55,25 @@ public:
   bool isOutput(void) const;
 
 public:
+  // WARN This method will be deprecated. Please use below "dependent_objects" instead
   // @brief Return the set of objects that depends on this bag
   ObjectSet deps(void) const;
-  // TODO Rename as readers
+  // WARN This method will be deprecated. Please below "readers" instead
   ReaderSet reads(void) const;
-  // TODO Rename as updaters
+  // WARN This method will be dpercated. Please use below "updaters" instead
   UpdaterSet updates(void) const;
 
 private:
   std::unique_ptr<BagInfo> _info;
 };
 
+// @brief Return a set of objects that depends on a given bag
+ObjectSet dependent_objects(const Bag *);
+// @brief Return a set of readers that reads a given bag
+Bag::ReaderSet readers(const Bag *);
+// @brief Return a set of updaters that updates a given bag
+Bag::UpdaterSet updaters(const Bag *);
+
 } // namespace coco
 
 #endif // __COCO_IR_BAG_H__
index 8540dc1..41311b8 100644 (file)
@@ -81,4 +81,9 @@ Bag::UpdaterSet Bag::updates(void) const
 
   return res;
 }
+
+ObjectSet dependent_objects(const Bag *b) { return b->deps(); }
+Bag::ReaderSet readers(const Bag *b) { return b->reads(); }
+Bag::UpdaterSet updaters(const Bag *b) { return b->updates(); }
+
 } // namespace coco