[opengtl-commits] [736] implement a node for @out and @in

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 736
Author:   cyrille
Date:     2009-05-26 10:12:31 +0200 (Tue, 26 May 2009)

Log Message:
-----------
implement a node for @out and @in

Modified Paths:
--------------
    trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST.cpp
    trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST_p.h


Modified: trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST.cpp	2009-05-26 08:09:00 UTC (rev 735)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST.cpp	2009-05-26 08:12:31 UTC (rev 736)
@@ -134,3 +134,18 @@
   }
 }
 
+InOutNode::InOutNode(Which _which) {
+  switch(_which)
+  {
+    case In:
+      m_string = "in";
+      break;
+    case Out:
+      m_string = "out";
+      break;
+  }
+}
+
+void InOutNode::generate(TemplateGenerationContext* _context) {
+  _context->append(m_string + _context->suffix());
+}

Modified: trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST_p.h
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST_p.h	2009-05-26 08:09:00 UTC (rev 735)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST_p.h	2009-05-26 08:12:31 UTC (rev 736)
@@ -81,13 +81,18 @@
         NodesList* m_nodesList;
         WhichChannel m_whichChannel;
     };
-    class OutNode : public Node {
+    class InOutNode : public Node {
       public:
-        virtual void generate(TemplateGenerationContext* _context);
-    };
-    class InNode : public Node {
+        enum Which {
+          In,
+          Out
+        };
       public:
+        InOutNode(Which _which);
+      public:
         virtual void generate(TemplateGenerationContext* _context);
+      private:
+        GTLCore::String m_string;
     };
     class MaxNode : public Node {
       public:


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/