[coco] Fix Read.forward.h (#1443)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 11 Sep 2018 06:24:48 +0000 (15:24 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 11 Sep 2018 06:24:48 +0000 (15:24 +0900)
This commit rewrites Read.forward.h to provides the forward declaration
of Read class; The current implementation provides the duplicated definition
of Read class.

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

index dbdb190..221f924 100644 (file)
@@ -1,53 +1,11 @@
-#ifndef __COCO_IR_READ_H__
-#define __COCO_IR_READ_H__
-
-#include "coco/IR/ReadHook.h"
-
-#include <cassert>
+#ifndef __COCO_IR_READ_FORWARD_H__
+#define __COCO_IR_READ_FORWARD_H__
 
 namespace coco
 {
 
-/**
- * @brief A Read represents an edge between a Bag and its Reader
- */
-class Read final
-{
-public:
-  Read(const PtrLink<Bag, BagInfo> *bag_link, Bag::Reader *read)
-      : _hook{bag_link, read}, _bag{nullptr}
-  {
-    // DO NOTHING
-  }
-
-public:
-  Bag *bag(void) const { return _bag; }
-
-public:
-  void bag(Bag *bag)
-  {
-    if (_bag)
-    {
-      _hook.onRelease(_bag);
-      _bag = nullptr;
-    }
-
-    assert(_bag == nullptr);
-
-    if (bag)
-    {
-      _bag = bag;
-      _hook.onTake(_bag);
-    }
-
-    assert(_bag == bag);
-  }
-
-private:
-  ReadHook _hook;
-  Bag *_bag;
-};
+class Read;
 
 } // namespace coco
 
-#endif // __COCO_IR_READ_H__
+#endif // __COCO_IR_READ_FORWARD_H__