[coco] Externally Configurable GenericFeatureLayout (#1578)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 19 Sep 2018 10:34:27 +0000 (19:34 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 19 Sep 2018 10:34:27 +0000 (19:34 +0900)
This commit allows users to replace the layout in FeatureObject with
their own (externally allocated) GenericFeatureLayout.

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

index a60dd9d..5506e9b 100644 (file)
@@ -40,6 +40,10 @@ public:
   void reorder(const nncc::core::ADT::feature::Layout &l);
   template <typename LayoutImpl> void reorder(void) { reorder(LayoutImpl{}); }
 
+public:
+  const GenericFeatureLayout *layout(void) const { return _layout.get(); }
+  void layout(std::unique_ptr<GenericFeatureLayout> &&l) { _layout = std::move(l); }
+
 private:
   std::unique_ptr<FeatureObjectInfo> _info;
   std::unique_ptr<GenericFeatureLayout> _layout;