]> AND Private Git Repository - blast.git/blobdiff - BlockImplementation.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
started to include patterns in implementation
[blast.git] / BlockImplementation.cpp
index 571b72b5328a91af9e75b10bfe83dcaff769f156..af06ef357c778739ec58a2d6f16d6b856863318d 100644 (file)
@@ -20,6 +20,30 @@ BlockImplementation::BlockImplementation(const QString& _xmlFile, const QString
   referenceMd5 = _referenceMd5;\r
 }\r
 \r
   referenceMd5 = _referenceMd5;\r
 }\r
 \r
+void BlockImplementation::assignPatterns(FunctionalBlock *_block) throw(Exception) {\r
+  \r
+  block = _block;\r
+\r
+  QFile implFile(xmlFile);\r
+\r
+  // reading in into QDomDocument\r
+  QDomDocument document("implFile");\r
+\r
+  if (!implFile.open(QIODevice::ReadOnly)) {\r
+    throw(Exception(IMPLFILE_NOACCESS));\r
+  }\r
+  if (!document.setContent(&implFile)) {\r
+    implFile.close();\r
+    throw(Exception(IMPLFILE_NOACCESS));\r
+  }\r
+  implFile.close();\r
+  QDomElement impl = document.documentElement();\r
+  QDomNodeList patternNode = impl.elementsByTagName("patterns");\r
+  if (patternNode.isEmpty()) return;\r
+  QDomElement patternElt = patternNode.at(0).toElement();\r
+  \r
+}\r
+\r
 void BlockImplementation::generateVHDL(FunctionalBlock* _block, const QString &path) throw(Exception) {\r
 \r
   block = _block;\r
 void BlockImplementation::generateVHDL(FunctionalBlock* _block, const QString &path) throw(Exception) {\r
 \r
   block = _block;\r