]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/UnionType.cpp
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / DataBoard / UnionType.cpp
index f7f9bcd87b3c612db407dd8926c741c3dcc3ecb1..e14afdb54335c87943fdaec89b07481448118224 100644 (file)
@@ -1,89 +1,89 @@
-#include "UnionType.h"\r
-\r
-#include "Component.h"\r
-\r
-namespace Databoard {\r
-       namespace Type {\r
-\r
-               UnionType::UnionType()\r
-               {\r
-               }\r
-\r
-               //UnionType::UnionType(std::vector<Component*> components)\r
-               //{\r
-               //      for(int i = 0; i < (int)components.size(); ++i)\r
-               //      {\r
-               //              this->components.push_back(components.at(i));\r
-               //      }\r
-               //}\r
-\r
-               UnionType::~UnionType()\r
-               {\r
-                       for(int i = 0; i < (int)components.size(); ++i)\r
-                       {\r
-                               delete components.at(i);\r
-                               components.at(i) = NULL;\r
-                       }\r
-\r
-                       components.clear();\r
-               }\r
-\r
-               void UnionType::addComponent(std::string name, DataType* type)\r
-               {\r
-                       Component* component = new Component(name, type);\r
-\r
-                       components.push_back(component);\r
-               }\r
-\r
-               int UnionType::count()\r
-               {\r
-                       return (int)components.size();\r
-               }\r
-\r
-               int UnionType::getComponentIndex(std::string tagName)\r
-               {\r
-                       for(int i = 0;i < (int)components.size(); ++i)\r
-                       {\r
-                               if(components.at(i)->getName() == tagName)\r
-                               {\r
-                                       return i;\r
-                               }\r
-                       }\r
-\r
-                       return -1;\r
-               }\r
-\r
-               Component* UnionType::getComponent(int i)\r
-               {\r
-                       if(i >= 0 && i < (int)components.size())\r
-                       {\r
-                               return components.at(i);\r
-                       }\r
-\r
-                       return NULL;\r
-               }\r
-\r
-               //std::vector<Component*> UnionType::getComponents()\r
-               //{\r
-               //}\r
-\r
-               std::string UnionType::writeOut(int /*indent*/)\r
-               {\r
-                       std::string s;\r
-\r
-                       for(int i = 0; i < (int)components.size(); ++i)\r
-                       {\r
-                               s += "| ";\r
-\r
-                               s += components.at(i)->getName();\r
-\r
-                               if(i != ((int)components.size()-1))\r
-                               {\r
-                                       s += " ";\r
-                               }\r
-                       }\r
-\r
-                       return s;\r
-               }\r
-       }\r
-}\r
+#include "UnionType.h"
+
+#include "Component.h"
+
+namespace Databoard {
+       namespace Type {
+
+               UnionType::UnionType()
+               {
+               }
+
+               //UnionType::UnionType(std::vector<Component*> components)
+               //{
+               //      for(int i = 0; i < (int)components.size(); ++i)
+               //      {
+               //              this->components.push_back(components.at(i));
+               //      }
+               //}
+
+               UnionType::~UnionType()
+               {
+                       for(int i = 0; i < (int)components.size(); ++i)
+                       {
+                               delete components.at(i);
+                               components.at(i) = NULL;
+                       }
+
+                       components.clear();
+               }
+
+               void UnionType::addComponent(std::string name, DataType* type)
+               {
+                       Component* component = new Component(name, type);
+
+                       components.push_back(component);
+               }
+
+               int UnionType::count()
+               {
+                       return (int)components.size();
+               }
+
+               int UnionType::getComponentIndex(std::string tagName)
+               {
+                       for(int i = 0;i < (int)components.size(); ++i)
+                       {
+                               if(components.at(i)->getName() == tagName)
+                               {
+                                       return i;
+                               }
+                       }
+
+                       return -1;
+               }
+
+               Component* UnionType::getComponent(int i)
+               {
+                       if(i >= 0 && i < (int)components.size())
+                       {
+                               return components.at(i);
+                       }
+
+                       return NULL;
+               }
+
+               //std::vector<Component*> UnionType::getComponents()
+               //{
+               //}
+
+               std::string UnionType::writeOut(int /*indent*/)
+               {
+                       std::string s;
+
+                       for(int i = 0; i < (int)components.size(); ++i)
+                       {
+                               s += "| ";
+
+                               s += components.at(i)->getName();
+
+                               if(i != ((int)components.size()-1))
+                               {
+                                       s += " ";
+                               }
+                       }
+
+                       return s;
+               }
+       }
+}