Add model IR visior (#173)
authorVladimir Plazun/AI Tools Lab/Engineer/삼성전자 <v.plazun@partner.samsung.com>
Thu, 24 May 2018 13:11:36 +0000 (16:11 +0300)
committerSergey Vostokov/AI Tools Lab/Staff Engineer/삼성전자 <s.vostokov@samsung.com>
Thu, 24 May 2018 13:11:36 +0000 (16:11 +0300)
Add "IR::mode::Visitor" class. Which is used as base for IR traversal

Signed-off-by: Vladimir Plazun <v.plazun@partner.samsung.com>
contrib/nnc/libs/nnc_core/include/nnc_core/IR/model/visitor.h [new file with mode: 0644]

diff --git a/contrib/nnc/libs/nnc_core/include/nnc_core/IR/model/visitor.h b/contrib/nnc/libs/nnc_core/include/nnc_core/IR/model/visitor.h
new file mode 100644 (file)
index 0000000..096478e
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _NNC_CORE_IR_MODEL_VISITOR_H_
+#define _NNC_CORE_IR_MODEL_VISITOR_H_
+
+namespace nncc {
+namespace contrib {
+namespace core {
+namespace IR {
+namespace model {
+
+class INode;
+
+class Visitor {
+ public:
+  // Operation-specific methods like:
+  // virtual void visit(INode* node, OpDescriptionSubclass& op) = 0;
+
+  virtual void visit(INode *node) = 0;
+  virtual ~Visitor() = default;
+};
+
+} // namespace model
+} // namespace IR
+} // namespace core
+} // namespace contrib
+} // namespace nncc
+
+#endif //_NNC_CORE_IR_MODEL_VISITOR_H_