70 ::std::fstream XMLFile;
71 ::std::string ErrorMessage;
75 XMLFile.open(ModelFileName.c_str(), ::std::fstream::in);
78 if (!XMLFile.is_open())
82 ErrorMessage =
"File \"";
83 ErrorMessage += ModelFileName;
84 ErrorMessage +=
"\" could not be opened";
92 this->CreateSyntax(XMLFile, pRootGraph);
95 catch (const ::DSM::Error::CException&)
115 ::std::string Model((::std::istreambuf_iterator<char>(ModelFileStream)), ::std::istreambuf_iterator<char>());
120 this->CreateSyntaxIterative(Model, pRootGraph);
132 bool bRootGraph(
false);
133 ::xmlpp::Node::NodeList::iterator x(0);
134 ::xmlpp::Element::AttributeList::iterator y(0);
135 ::xmlpp::Document* pXMLSchema(0);
136 ::xmlpp::Document* pXMLGOPPRRProject(0);
137 ::xmlpp::Element* pProjectNode(0);
138 ::xmlpp::SchemaValidator SchemaValidator;
139 ::xmlpp::Schema* pSchema(0);
140 ::xmlpp::Node::NodeList ProjectElements(0);
141 ::xmlpp::Element::AttributeList ProjectAttributes;
142 ::xmlpp::Element::AttributeList ProjectChildAttributes;
143 ::std::stringstream ErrorMessage;
144 ::std::string CurrentElementsName;
145 ::std::string RootGraphOID;
146 ::std::map< ::std::string, ::std::string> ProjectAttributeMap;
147 ::std::map< ::std::string, ::std::string> ProjectChildAttributeMap;
148 ::xmlpp::Element* pProjectChildXMLElement(0);
157 m_XMLParser.parse_memory(m_Schema);
160 pXMLSchema = m_XMLParser.get_document();
163 pSchema =
new xmlpp::Schema(pXMLSchema);
166 SchemaValidator.set_schema(pSchema);
169 m_XMLParser.parse_memory(Model);
172 pXMLGOPPRRProject = m_XMLParser.get_document();
175 SchemaValidator.validate(pXMLGOPPRRProject);
178 pProjectNode = pXMLGOPPRRProject->get_root_node();
181 ProjectAttributes = pProjectNode->get_attributes();
184 for (y = ProjectAttributes.begin(); y != ProjectAttributes.end(); y++)
187 ProjectAttributeMap[ (*y)->get_name() ] = (*y)->get_value();
192 pNewProject = new ::GOPPRR::CProject( ProjectAttributeMap[
"name"] );
195 ProjectElements = pProjectNode->get_children();
199 for (x = ProjectElements.begin(); x != ProjectElements.end(); x++)
202 pProjectChildXMLElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
206 if (pProjectChildXMLElement != 0)
209 CurrentElementsName = pProjectChildXMLElement->get_name();
213 if (CurrentElementsName ==
"graph")
216 ProjectChildAttributes = pProjectChildXMLElement->get_attributes();
219 for (y = ProjectChildAttributes.begin(); y != ProjectChildAttributes.end(); y++)
222 ProjectChildAttributeMap[ (*y)->get_name() ] = (*y)->get_value();
233 RootGraphOID = ProjectChildAttributeMap[
"oid"];
241 else if (CurrentElementsName ==
"object")
247 else if (CurrentElementsName ==
"property")
253 else if (CurrentElementsName ==
"port")
259 else if (CurrentElementsName ==
"role")
265 else if (CurrentElementsName ==
"relationship")
274 ErrorMessage <<
"unexpected XML element in <gopprr:project> in line ";
275 ErrorMessage << pProjectChildXMLElement->get_line();
290 pRootGraph = &pNewProject->
m_GraphSet[RootGraphOID];
295 pSyntaxTree = new ::DSM::CGOPPRRSyntaxTree(pNewProject,pRootGraph);
301 m_pTree = pSyntaxTree;
308 catch (const ::xmlpp::exception& ParserException)
319 catch (const ::std::bad_alloc& MemoryException)
330 catch (const ::DSM::Error::CException&)
351 bool bRootGraph(
false);
352 ::xmlpp::Node::NodeList::iterator x(0);
353 ::xmlpp::Element::AttributeList::iterator y(0);
354 ::xmlpp::Document* pXMLSchema(0);
355 ::xmlpp::Document* pXMLGOPPRRProject(0);
356 ::xmlpp::Element* pProjectElement(0);
357 ::xmlpp::Element* pPropertyElement(0);
358 ::xmlpp::Element* pObjectElement(0);
359 ::xmlpp::Element* pPortElement(0);
360 ::xmlpp::Element* pRoleElement(0);
361 ::xmlpp::Element* pGraphElement(0);
362 ::xmlpp::Element* pRelationshipElement(0);
363 ::xmlpp::SchemaValidator SchemaValidator;
364 ::xmlpp::Schema* pSchema(0);
365 ::xmlpp::Node::NodeList GraphElements(0);
366 ::xmlpp::Node::NodeList ObjectElements(0);
367 ::xmlpp::Node::NodeList PortElements(0);
368 ::xmlpp::Node::NodeList PropertyElements(0);
369 ::xmlpp::Node::NodeList RoleElements(0);
370 ::xmlpp::Node::NodeList RelationshipElements(0);
371 ::xmlpp::Element::AttributeList ProjectAttributes;
372 ::std::stringstream ErrorMessage;
373 ::std::string RootGraphOID;
374 ::std::string DecompositonOID;
375 ::std::map< ::std::string, ::std::string> ProjectAttributeMap;
376 ::std::map< ::std::string, ::std::string> PropertyAttributeMap;
392 m_XMLParser.parse_memory(m_Schema);
395 pXMLSchema = m_XMLParser.get_document();
398 pSchema =
new xmlpp::Schema(pXMLSchema);
401 SchemaValidator.set_schema(pSchema);
404 m_XMLParser.parse_memory(Model);
407 pXMLGOPPRRProject = m_XMLParser.get_document();
410 SchemaValidator.validate(pXMLGOPPRRProject);
413 pProjectElement = pXMLGOPPRRProject->get_root_node();
416 ProjectAttributes = pProjectElement->get_attributes();
419 for (y = ProjectAttributes.begin(); y != ProjectAttributes.end(); y++)
422 ProjectAttributeMap[ (*y)->get_name() ] = (*y)->get_value();
427 pNewProject = new ::GOPPRR::CProject( ProjectAttributeMap[
"name"] );
434 PropertyElements = pProjectElement->get_children(
"property");
437 for (x = PropertyElements.begin(); x != PropertyElements.end(); x++)
440 pPropertyElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
443 if (pPropertyElement != 0)
463 ObjectElements = pProjectElement->get_children(
"object");
466 for (x = ObjectElements.begin(); x != ObjectElements.end(); x++)
469 pObjectElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
472 if (pObjectElement != 0)
492 PortElements = pProjectElement->get_children(
"port");
495 for (x = PortElements.begin(); x != PortElements.end(); x++)
498 pPortElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
501 if (pPortElement != 0)
520 RoleElements = pProjectElement->get_children(
"role");
523 for (x = RoleElements.begin(); x != RoleElements.end(); x++)
526 pRoleElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
529 if (pRoleElement != 0)
548 RelationshipElements = pProjectElement->get_children(
"relationship");
551 for (x = RelationshipElements.begin(); x != RelationshipElements.end(); x++)
554 pRelationshipElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
557 if (pRelationshipElement != 0)
576 GraphElements = pProjectElement->get_children(
"graph");
579 for (x = GraphElements.begin(); x != GraphElements.end(); x++)
582 pGraphElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
585 if (pGraphElement != 0)
601 RootGraphOID = pGraphElement->get_attribute_value(
"oid");
623 for (ThisNonProperty = ThisProperty->second.m_NonProperties.begin(); ThisNonProperty != ThisProperty->second.m_NonProperties.end(); ThisNonProperty++)
629 ThisNonProperty->second = &(pNewProject->
m_GraphSet[ThisNonProperty->first]);
635 ThisNonProperty->second = &(pNewProject->
m_ObjectSet[ThisNonProperty->first]);
638 else if (pNewProject->
m_PortSet.find(ThisNonProperty->first) != pNewProject->
m_PortSet.end())
641 ThisNonProperty->second = &(pNewProject->
m_PortSet[ThisNonProperty->first]);
644 else if (pNewProject->
m_RoleSet.find(ThisNonProperty->first) != pNewProject->
m_RoleSet.end())
647 ThisNonProperty->second = &(pNewProject->
m_RoleSet[ThisNonProperty->first]);
653 ThisNonProperty->second = &(pNewProject->
m_RelationshipSet[ThisNonProperty->first]);
659 ErrorMessage <<
"could found corresponding non-property for OID ";
660 ErrorMessage << ThisNonProperty->first;
671 for (ThisObject = pNewProject->
m_ObjectSet.begin(); ThisObject != pNewProject->
m_ObjectSet.end(); ThisObject++)
674 if (ThisObject->second.m_pDecomposition != 0)
677 DecompositonOID = ThisObject->second.m_pDecomposition->m_OID;
680 delete ThisObject->second.m_pDecomposition;
686 ThisObject->second.m_pDecomposition = &(pNewProject->
m_GraphSet[DecompositonOID]);
692 ErrorMessage <<
"could found corresponding decomposition graph for OID ";
693 ErrorMessage << DecompositonOID;
701 for (ThisExplosion = ThisObject->second.m_Explosions.begin(); ThisExplosion != ThisObject->second.m_Explosions.end(); ThisExplosion++)
707 ThisExplosion->second = &(pNewProject->
m_GraphSet[ThisExplosion->first]);
713 ErrorMessage <<
"could found corresponding explosion graph for OID ";
714 ErrorMessage << DecompositonOID;
725 for (ThisRole = pNewProject->
m_RoleSet.begin(); ThisRole != pNewProject->
m_RoleSet.end(); ThisRole++)
728 for (ThisExplosion = ThisRole->second.m_Explosions.begin(); ThisExplosion != ThisRole->second.m_Explosions.end(); ThisExplosion++)
734 ThisExplosion->second = &(pNewProject->
m_GraphSet[ThisExplosion->first]);
740 ErrorMessage <<
"could found corresponding explosion graph for OID ";
741 ErrorMessage << DecompositonOID;
755 for (ThisExplosion = ThisRelationship->second.m_Explosions.begin(); ThisExplosion != ThisRelationship->second.m_Explosions.end(); ThisExplosion++)
761 ThisExplosion->second = &(pNewProject->
m_GraphSet[ThisExplosion->first]);
767 ErrorMessage <<
"could found corresponding explosion graph for OID ";
768 ErrorMessage << DecompositonOID;
787 pRootGraph = &pNewProject->
m_GraphSet[RootGraphOID];
792 pSyntaxTree = new ::DSM::CGOPPRRSyntaxTree(pNewProject,pRootGraph);
798 m_pTree = pSyntaxTree;
805 catch (const ::xmlpp::exception& ParserException)
816 catch (const ::std::bad_alloc& MemoryException)
827 catch (const ::DSM::Error::CException&)
845 void CGOPPRRTransformer::CreatePropertyIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
849 ::xmlpp::Node::NodeList::iterator x(0);
850 ::xmlpp::Element::AttributeList::iterator y(0);
851 ::xmlpp::Element* pPropertyXMLChildElement(0);
852 ::xmlpp::TextNode* pPropertyXMLChildTextNode(0);
853 ::xmlpp::Node::NodeList PropertyChildNodes(pXMLElement->get_children());
854 ::xmlpp::Element::AttributeList PropertyAttributes(pXMLElement->get_attributes());
855 ::xmlpp::Element::AttributeList PropertyChildAttributes;
856 ::std::map< ::std::string, ::std::string > PropertyAttributeMap;
857 ::std::map< ::std::string, ::std::string > PropertyChildAttributeMap;
858 ::std::map< ::std::string, ::GOPPRR::CNonProperty* > NonProperties;
859 ::std::string PropertyValue;
860 ::std::string CurrentPropertyChildName;
861 ::std::stringstream ErrorMessage;
866 for (y = PropertyAttributes.begin(); y != PropertyAttributes.end(); y++)
869 PropertyAttributeMap[(*y)->get_name()] = (*y)->get_value();
876 for (x = PropertyChildNodes.begin(); x != PropertyChildNodes.end(); x++)
879 pPropertyXMLChildElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
882 pPropertyXMLChildTextNode =
dynamic_cast< ::xmlpp::TextNode*
>(*x);
885 if (pPropertyXMLChildElement != 0)
888 PropertyChildAttributes = pPropertyXMLChildElement->get_attributes();
891 for (y = PropertyChildAttributes.begin(); y != PropertyChildAttributes.end(); y++)
894 PropertyChildAttributeMap[(*y)->get_name()] = (*y)->get_value();
899 CurrentPropertyChildName = pPropertyXMLChildElement->get_name();
902 if (CurrentPropertyChildName ==
"graph-reference")
905 NonProperties[ PropertyChildAttributeMap[
"oid"] ] =
nullptr;
908 else if (CurrentPropertyChildName ==
"object-reference")
911 NonProperties[ PropertyChildAttributeMap[
"oid"] ] =
nullptr;
914 else if (CurrentPropertyChildName ==
"port-reference")
917 NonProperties[ PropertyChildAttributeMap[
"oid"] ] =
nullptr;
920 else if (CurrentPropertyChildName ==
"role-reference")
923 NonProperties[ PropertyChildAttributeMap[
"oid"] ] =
nullptr;
926 else if (CurrentPropertyChildName ==
"relationship-reference")
929 NonProperties[ PropertyChildAttributeMap[
"oid"] ] =
nullptr;
935 ErrorMessage <<
"unexpected XML element in <gopprr:property> in line ";
936 ErrorMessage << pPropertyXMLChildElement->get_line();
942 else if (pPropertyXMLChildTextNode != 0)
945 PropertyValue = pPropertyXMLChildTextNode->get_content();
953 Properties[ PropertyAttributeMap[
"oid"] ] =
::GOPPRR::CProperty(PropertyAttributeMap[
"oid"],
954 PropertyAttributeMap[
"type"],
965 void CGOPPRRTransformer::CreateObjectIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
969 ::xmlpp::Element::AttributeList::iterator x(0);
970 ::xmlpp::Node::NodeList::iterator y(0);
971 ::xmlpp::Node::NodeList::iterator z(0);
972 ::xmlpp::Element::AttributeList ObjectAttributes;
973 ::xmlpp::Element::AttributeList ObjectChildAttributes;
974 ::xmlpp::Element::AttributeList DecompositonChildAttributes;
975 ::xmlpp::Node::NodeList ObjectNodes(pXMLElement->get_children());
976 ::xmlpp::Node::NodeList DecompositonNodes;
977 ::xmlpp::Element* pObjectChildXMLElement(0);
978 ::xmlpp::Element* pDecompositionChildXMLElement(0);
979 ::std::map< ::std::string, ::std::string> ObjectAttributeMap;
980 ::std::map< ::std::string, ::std::string> ObjectChildAttributeMap;
981 ::std::map< ::std::string, ::std::string> DecompositionChildAttributeMap;
982 ::std::map< ::std::string, ::GOPPRR::CProperty* > ObjectProperties;
983 ::std::string ChildElementName;
984 ::std::string DecompositionChildElementName;
985 ::std::stringstream ErrorMessage;
987 ::std::map< ::std::string, ::GOPPRR::CGraph* > Explosions;
993 ObjectAttributes = pXMLElement->get_attributes();
996 for (x = ObjectAttributes.begin(); x != ObjectAttributes.end(); x++)
999 ObjectAttributeMap[(*x)->get_name()] = (*x)->get_value();
1006 for (y = ObjectNodes.begin(); y != ObjectNodes.end(); y++)
1009 pObjectChildXMLElement =
dynamic_cast< ::xmlpp::Element*
>(*y);
1012 if (pObjectChildXMLElement != 0)
1015 ChildElementName = pObjectChildXMLElement->get_name();
1018 ObjectChildAttributes = pObjectChildXMLElement->get_attributes();
1021 for (x = ObjectChildAttributes.begin(); x != ObjectChildAttributes.end(); x++)
1024 ObjectChildAttributeMap[(*x)->get_name()] = (*x)->get_value();
1030 if (ChildElementName ==
"property-reference")
1033 ObjectProperties[ ObjectChildAttributeMap[
"oid"] ] = &(Properties[ ObjectChildAttributeMap[
"oid"] ]);
1036 else if (ChildElementName ==
"decomposition")
1039 DecompositonNodes = pObjectChildXMLElement->get_children();
1042 for (z = DecompositonNodes.begin(); z != DecompositonNodes.end(); z++)
1045 pDecompositionChildXMLElement =
dynamic_cast< ::xmlpp::Element*
>(*z);
1048 if (pDecompositionChildXMLElement != 0)
1051 DecompositonChildAttributes = pDecompositionChildXMLElement->get_attributes();
1054 for (x = DecompositonChildAttributes.begin(); x != DecompositonChildAttributes.end(); x++)
1057 DecompositionChildAttributeMap[(*x)->get_name()] = (*x)->get_value();
1062 DecompositionChildElementName = pDecompositionChildXMLElement->get_name();
1065 if (DecompositionChildElementName ==
"graph-reference")
1070 pDecomposition = new ::GOPPRR::CGraph(DecompositionChildAttributeMap[
"oid"]);
1073 catch (const ::std::bad_alloc& Exception)
1076 ErrorMessage <<
"error while allocating memory for temporarly graph object: ";
1077 ErrorMessage << Exception.what();
1086 ErrorMessage <<
"unexpected XML element in <gopprr:decomposition> in line ";
1087 ErrorMessage << pDecompositionChildXMLElement->get_line();
1097 else if (ChildElementName ==
"explosions")
1113 ErrorMessage <<
"unexpected XML element in <gopprr:object> in line ";
1114 ErrorMessage << pXMLElement->get_line();
1126 Objects[ ObjectAttributeMap[
"oid"] ] =
::GOPPRR::CObject(ObjectAttributeMap[
"oid"],
1127 ObjectAttributeMap[
"type"],
1128 ObjectAttributeMap[
"name"],
1132 Objects[ ObjectAttributeMap[
"oid"] ].m_pDecomposition = pDecomposition;
1135 Objects[ ObjectAttributeMap[
"oid"] ].m_Explosions = Explosions;
1144 void CGOPPRRTransformer::CreateExplosionIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph > & Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty > & Properties, std::map< ::std::string, ::GOPPRR::CPort > & Ports, std::map< ::std::string, ::GOPPRR::CRole > & Roles, std::map< ::std::string, ::GOPPRR::CRelationship > & Relationships, std::map< ::std::string, ::GOPPRR::CGraph* >& Explosions)
throw(
DSM::Error::CException)
1148 ::xmlpp::Element::NodeList::iterator x(0);
1149 ::xmlpp::Element::AttributeList::iterator y(0);
1150 ::xmlpp::Element::AttributeList ExplosionChildAttributes;
1151 ::xmlpp::Element::NodeList ExplosionNodes;
1152 ::xmlpp::Element* pExplosionChildXMLElement(0);
1153 ::std::string ExplosionChildElementName;
1154 ::std::stringstream ErrorMessage;
1155 ::std::map< ::std::string, std::string> ExplosionChildAttributeMap;
1160 ExplosionNodes = pXMLElement->get_children();
1163 for (x = ExplosionNodes.begin(); x != ExplosionNodes.end(); x++)
1166 pExplosionChildXMLElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
1169 if (pExplosionChildXMLElement != 0)
1172 ExplosionChildAttributes = pExplosionChildXMLElement->get_attributes();
1175 ExplosionChildElementName = pExplosionChildXMLElement->get_name();
1178 for (y = ExplosionChildAttributes.begin(); y != ExplosionChildAttributes.end(); y++)
1181 ExplosionChildAttributeMap[(*y)->get_name()] = (*y)->get_value();
1187 if (ExplosionChildElementName ==
"graph-reference")
1190 Explosions[ ExplosionChildAttributeMap[
"oid"] ]=
nullptr;
1196 ErrorMessage <<
"unexpected XML element in <gopprr:decomposition> in line ";
1197 ErrorMessage << pExplosionChildXMLElement->get_line();
1213 void CGOPPRRTransformer::CreatePortIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
1217 ::xmlpp::Node::NodeList::iterator x(0);
1218 ::xmlpp::Element::AttributeList::iterator y(0);
1219 ::xmlpp::Element* pPortXMLChildElement(0);
1220 ::xmlpp::Node::NodeList PortChildNodes(pXMLElement->get_children());
1221 ::xmlpp::Element::AttributeList PortAttributes(pXMLElement->get_attributes());
1222 ::xmlpp::Element::AttributeList PortChildAttributes;
1223 ::std::map< ::std::string, ::std::string > PortAttributeMap;
1224 ::std::map< ::std::string, ::std::string > PortChildAttributeMap;
1225 ::std::map< ::std::string, ::GOPPRR::CProperty* > PortProperties;
1226 ::std::string CurrentPropertyChildName;
1227 ::std::stringstream ErrorMessage;
1232 for (y = PortAttributes.begin(); y != PortAttributes.end(); y++)
1235 PortAttributeMap[(*y)->get_name()] = (*y)->get_value();
1242 for (x = PortChildNodes.begin(); x != PortChildNodes.end(); x++)
1245 pPortXMLChildElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
1248 if (pPortXMLChildElement != 0)
1251 PortChildAttributes = pPortXMLChildElement->get_attributes();
1254 for (y = PortChildAttributes.begin(); y != PortChildAttributes.end(); y++)
1257 PortChildAttributeMap[(*y)->get_name()] = (*y)->get_value();
1263 CurrentPropertyChildName = pPortXMLChildElement->get_name();
1266 if (CurrentPropertyChildName ==
"property-reference")
1269 PortProperties[ PortChildAttributeMap[
"oid"] ] = &(Properties[ PortChildAttributeMap[
"oid"] ]);
1275 ErrorMessage <<
"unexpected XML element in <gopprr:port> in line ";
1276 ErrorMessage << pPortXMLChildElement->get_line();
1287 Ports[ PortAttributeMap[
"oid"] ] =
::GOPPRR::CPort(PortAttributeMap[
"oid"],
1288 PortAttributeMap[
"type"],
1289 PortAttributeMap[
"name"],
1299 void CGOPPRRTransformer::CreateRoleIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
1303 ::xmlpp::Node::NodeList::iterator x(0);
1304 ::xmlpp::Element::AttributeList::iterator y(0);
1305 ::xmlpp::Node::NodeList::iterator z(0);
1306 ::xmlpp::Element* pRoleXMLChildElement(0);
1307 ::xmlpp::Node::NodeList RoleChildNodes(pXMLElement->get_children());
1308 ::xmlpp::Element::AttributeList RoleAttributes(pXMLElement->get_attributes());
1309 ::xmlpp::Element::AttributeList RoleChildAttributes;
1310 ::std::map< ::std::string, ::std::string > RoleAttributeMap;
1311 ::std::map< ::std::string, ::std::string > RoleChildAttributeMap;
1312 ::std::map< ::std::string, ::GOPPRR::CProperty* > RoleProperties;
1313 ::std::string CurrentRoleChildName;
1314 ::std::stringstream ErrorMessage;
1315 ::std::map< ::std::string, ::GOPPRR::CGraph* > Explosions;
1320 for (y = RoleAttributes.begin(); y != RoleAttributes.end(); y++)
1323 RoleAttributeMap[(*y)->get_name()] = (*y)->get_value();
1331 for (x = RoleChildNodes.begin(); x != RoleChildNodes.end(); x++)
1334 pRoleXMLChildElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
1337 if (pRoleXMLChildElement != 0)
1340 RoleChildAttributes = pRoleXMLChildElement->get_attributes();
1343 for (y = RoleChildAttributes.begin(); y != RoleChildAttributes.end(); y++)
1346 RoleChildAttributeMap[(*y)->get_name()] = (*y)->get_value();
1352 CurrentRoleChildName = pRoleXMLChildElement->get_name();
1355 if (CurrentRoleChildName ==
"property-reference")
1358 RoleProperties[ RoleChildAttributeMap[
"oid"] ] = &(Properties[ RoleChildAttributeMap[
"oid"] ]);
1361 else if (CurrentRoleChildName ==
"explosions")
1377 ErrorMessage <<
"unexpected XML element in <gopprr:port> in line ";
1378 ErrorMessage << pRoleXMLChildElement->get_line();
1389 Roles[ RoleAttributeMap[
"oid"] ] =
::GOPPRR::CRole(RoleAttributeMap[
"oid"],
1390 RoleAttributeMap[
"type"],
1391 RoleAttributeMap[
"name"],
1395 Roles[ RoleAttributeMap[
"oid"] ].m_Explosions = Explosions;
1404 void CGOPPRRTransformer::CreateRelationshipIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
1408 ::xmlpp::Node::NodeList::iterator x(0);
1409 ::xmlpp::Element::AttributeList::iterator y(0);
1410 ::xmlpp::Node::NodeList::iterator z(0);
1411 ::xmlpp::Element* pRelationshipXMLChildElement(0);
1412 ::xmlpp::Node::NodeList RelationshipChildNodes(pXMLElement->get_children());
1413 ::xmlpp::Element::AttributeList RelationshipAttributes(pXMLElement->get_attributes());
1414 ::xmlpp::Element::AttributeList RelationshipChildAttributes;
1415 ::std::map< ::std::string, ::std::string > RelationshipAttributeMap;
1416 ::std::map< ::std::string, ::std::string > RelationshipChildAttributeMap;
1417 ::std::map< ::std::string, ::GOPPRR::CProperty* > RelationshipProperties;
1418 ::std::string CurrentRelationshipChildName;
1419 ::std::stringstream ErrorMessage;
1420 ::std::map< ::std::string, ::GOPPRR::CGraph* > Explosions;
1425 for (y = RelationshipAttributes.begin(); y != RelationshipAttributes.end(); y++)
1428 RelationshipAttributeMap[(*y)->get_name()] = (*y)->get_value();
1435 for (x = RelationshipChildNodes.begin(); x != RelationshipChildNodes.end(); x++)
1438 pRelationshipXMLChildElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
1441 if (pRelationshipXMLChildElement != 0)
1444 RelationshipChildAttributes = pRelationshipXMLChildElement->get_attributes();
1447 for (y = RelationshipChildAttributes.begin(); y != RelationshipChildAttributes.end(); y++)
1450 RelationshipChildAttributeMap[(*y)->get_name()] = (*y)->get_value();
1456 CurrentRelationshipChildName = pRelationshipXMLChildElement->get_name();
1459 if (CurrentRelationshipChildName ==
"property-reference")
1462 RelationshipProperties[ RelationshipChildAttributeMap[
"oid"] ] = &(Properties[ RelationshipChildAttributeMap[
"oid"] ]);
1465 else if (CurrentRelationshipChildName ==
"explosions")
1481 ErrorMessage <<
"unexpected XML element in <gopprr:port> in line ";
1482 ErrorMessage << pRelationshipXMLChildElement->get_line();
1494 RelationshipAttributeMap[
"type"],
1495 RelationshipAttributeMap[
"name"],
1496 RelationshipProperties);
1499 Relationships[ RelationshipAttributeMap[
"oid"] ].m_Explosions = Explosions;
1508 void CGOPPRRTransformer::CreateGraphIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph > & Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort > & Ports, std::map< ::std::string, ::GOPPRR::CRole > & Roles, std::map< ::std::string, ::GOPPRR::CRelationship > & Relationships,
bool& bRoot)
throw(
DSM::Error::CException)
1512 ::xmlpp::Element::AttributeList::iterator x(0);
1513 ::xmlpp::Node::NodeList::iterator y(0);
1514 ::xmlpp::Node::NodeList::iterator z(0);
1515 ::xmlpp::Node::NodeList::iterator u(0);
1516 ::xmlpp::NodeSet::iterator v(0);
1517 ::xmlpp::Element::AttributeList CurrentAttributes(pXMLElement->get_attributes());
1518 ::xmlpp::Element::AttributeList ContentChildAttributes;
1519 ::xmlpp::Element::AttributeList BindingChildAttributes;
1520 ::xmlpp::Element::AttributeList ConnectionChildAttributes;
1521 ::xmlpp::Node::NodeList GraphNodes(pXMLElement->get_children());
1522 ::xmlpp::Node::NodeList BindingNodes;
1523 ::xmlpp::Node::NodeList ConnectionNodes;
1524 ::xmlpp::Node::NodeList ContentNodes;
1525 ::xmlpp::Element* pConnectionXMLElement(0);
1526 ::xmlpp::Element* pConnectionXMLChildElement(0);
1527 ::xmlpp::Element* pGraphChildXMLElement(0);
1528 ::xmlpp::Element* pContentXMLChildNode(0);
1529 ::xmlpp::Element* pBindingXMLChildNode(0);
1530 ::std::vector< ::GOPPRR::CConnection::CCall > CurrentCalls;
1531 ::std::stringstream ErrorMessage;
1532 ::std::string CurrentElement;
1533 ::std::string CurrentBindingElement;
1534 ::std::string CurrentConnectionElement;
1535 ::std::string CurrentContentElement;
1536 ::std::map< ::std::string, std::string > GraphAttributeMap;
1537 ::std::map< ::std::string, std::string > CurrentElementAttributeMap;
1538 ::std::map< ::std::string, std::string > XPathElementAttributeMap;
1539 ::std::map< ::std::string, std::string > BindingChildAttributeMap;
1540 ::std::map< ::std::string, std::string > ContentChildAttributeMap;
1541 ::std::map< ::std::string, std::string > ConnectionChildAttributeMap;
1542 ::std::map< ::std::string, ::GOPPRR::CObject* > GraphObjects;
1543 ::std::map< ::std::string, ::GOPPRR::CPort* > GraphPorts;
1544 ::std::map< ::std::string, ::GOPPRR::CProperty* > GraphProperties;
1545 ::std::map< ::std::string, ::GOPPRR::CRole* > GraphRoles;
1546 ::std::map< ::std::string, ::GOPPRR::CRelationship* > GraphRelationships;
1547 ::std::vector< ::GOPPRR::CBinding > GraphBindings;
1548 ::std::vector< ::GOPPRR::CGraphicalContainer > Containers;
1551 ::std::map< ::std::string, ::GOPPRR::CObject* > CurrentContainedObjects;
1552 ::std::map< ::std::string, ::GOPPRR::CRelationship* > CurrentContainedRelationships;
1558 for (x = CurrentAttributes.begin(); x != CurrentAttributes.end(); x++)
1561 GraphAttributeMap[(*x)->get_name()] = (*x)->get_value();
1568 bRoot = (GraphAttributeMap[
"root"] ==
"true");
1571 for (y = GraphNodes.begin(); y != GraphNodes.end(); y++)
1574 pGraphChildXMLElement =
dynamic_cast< ::xmlpp::Element*
>(*y);
1577 if (pGraphChildXMLElement != 0)
1580 CurrentElement = (*y)->get_name();
1583 CurrentAttributes = pGraphChildXMLElement->get_attributes();
1586 for (x = CurrentAttributes.begin(); x != CurrentAttributes.end(); x++)
1589 CurrentElementAttributeMap[(*x)->get_name()] = (*x)->get_value();
1594 if (CurrentElement ==
"object-reference")
1597 GraphObjects[ CurrentElementAttributeMap[
"oid"] ] = &(Objects[ CurrentElementAttributeMap[
"oid"] ]);
1600 else if (CurrentElement ==
"port-reference")
1603 GraphPorts[ CurrentElementAttributeMap[
"oid"] ] = &(Ports[ CurrentElementAttributeMap[
"oid"] ]);
1606 else if (CurrentElement ==
"property-reference")
1609 GraphProperties[ CurrentElementAttributeMap[
"oid"] ] = &(Properties[ CurrentElementAttributeMap[
"oid"] ]);
1612 else if (CurrentElement ==
"role-reference")
1615 GraphRoles[ CurrentElementAttributeMap[
"oid"] ] = &(Roles[CurrentElementAttributeMap[
"oid"] ]);
1618 else if (CurrentElement ==
"relationship-reference")
1621 GraphRelationships[ CurrentElementAttributeMap[
"oid"] ] = &(Relationships[ CurrentElementAttributeMap[
"oid"] ]);
1624 else if (CurrentElement ==
"graphical-content")
1627 pCurrentContainer = 0;
1628 CurrentContainedObjects.clear();
1629 CurrentContainedRelationships.clear();
1632 ContentNodes = pGraphChildXMLElement->get_children();
1635 if (ContentNodes.size() < 2)
1638 ErrorMessage <<
"not enough child XML elements for <gopprr:relationship-reference> in line ";
1639 ErrorMessage << pGraphChildXMLElement->get_line();
1645 for (z = ContentNodes.begin(); z != ContentNodes.end(); z++)
1648 pContentXMLChildNode =
dynamic_cast< ::xmlpp::Element*
>(*z);
1651 if (pContentXMLChildNode != 0)
1654 ContentChildAttributes = pContentXMLChildNode->get_attributes();
1657 for (x = ContentChildAttributes.begin(); x != ContentChildAttributes.end(); x++)
1660 ContentChildAttributeMap[(*x)->get_name()] = (*x)->get_value();
1665 CurrentContentElement = pContentXMLChildNode->get_name();
1668 if (CurrentContentElement ==
"object-reference")
1671 if (pCurrentContainer == 0)
1674 pCurrentContainer = &(Objects[ ContentChildAttributeMap[
"oid"] ]);
1680 CurrentContainedObjects[ ContentChildAttributeMap[
"oid"] ] = &(Objects[ ContentChildAttributeMap[
"oid"] ]);
1685 else if (CurrentContentElement ==
"relationship-reference")
1688 CurrentContainedRelationships[ ContentChildAttributeMap[
"oid"] ] = &(Relationships[ ContentChildAttributeMap[
"oid"] ]);
1694 ErrorMessage <<
"unexpected XML element in <gopprr:graphical-content> in line ";
1695 ErrorMessage << pContentXMLChildNode->get_line();
1708 else if (CurrentElement ==
"binding")
1711 BindingNodes = pGraphChildXMLElement->get_children();
1714 for (z = BindingNodes.begin(); z != BindingNodes.end(); z++)
1717 pBindingXMLChildNode =
dynamic_cast< ::xmlpp::Element*
>(*z);
1720 if (pBindingXMLChildNode != 0)
1723 CurrentBindingElement = pBindingXMLChildNode->get_name();
1726 BindingChildAttributes =pBindingXMLChildNode->get_attributes();
1729 for (x = BindingChildAttributes.begin(); x != BindingChildAttributes.end(); x++)
1732 BindingChildAttributeMap[ (*x)->get_name() ] = (*x)->get_value();
1737 if (CurrentBindingElement ==
"connection")
1740 CurrentCalls.clear();
1743 ConnectionNodes = pBindingXMLChildNode->get_children();
1746 if (ConnectionNodes.size() < 4)
1749 ErrorMessage <<
"not enough child XML elements for <gopprr:connection> in line ";
1750 ErrorMessage << pBindingXMLChildNode->get_line();
1756 for (u = ConnectionNodes.begin(); u != ConnectionNodes.end(); u ++)
1759 pConnectionXMLChildElement =
dynamic_cast< ::xmlpp::Element*
>(*u);
1762 if (pConnectionXMLChildElement != 0)
1765 CurrentConnectionElement = (*u)->get_name();
1768 ConnectionChildAttributes = pConnectionXMLChildElement->get_attributes();
1771 for (x = ConnectionChildAttributes.begin(); x != ConnectionChildAttributes.end(); x++)
1774 ConnectionChildAttributeMap[ (*x)->get_name() ] = (*x)->get_value();
1780 if (CurrentConnectionElement ==
"object-reference")
1786 else if (CurrentConnectionElement ==
"port-reference")
1789 CurrentCalls[ CurrentCalls.size()-1 ].m_pPort = &(Ports[ ConnectionChildAttributeMap[
"oid"] ]);
1792 else if (CurrentConnectionElement ==
"role-reference")
1795 CurrentCalls[ CurrentCalls.size()-1 ].m_pRole = &(Roles[ ConnectionChildAttributeMap[
"oid"] ]);
1801 ErrorMessage <<
"unexpected XML element in <gopprr:connection> in line ";
1802 ErrorMessage << pConnectionXMLElement->get_line();
1812 else if (CurrentBindingElement ==
"relationship-reference")
1815 pCurrentRelationship = &(Relationships[ BindingChildAttributeMap[
"oid"] ]);
1821 ErrorMessage <<
"unexpected XML element in <gopprr:binding> in line ";
1822 ErrorMessage << pBindingXMLChildNode->get_line();
1838 ErrorMessage <<
"unexpected XML element in <gopprr:project> in line ";
1839 ErrorMessage << pXMLElement->get_line();
1850 Graphs[ GraphAttributeMap[
"oid"] ] =
::GOPPRR::CGraph(GraphAttributeMap[
"oid"],
1851 GraphAttributeMap[
"type"],
1852 GraphAttributeMap[
"name"],
1868 void CGOPPRRTransformer::CreateGraph(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph > & Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort > & Ports, std::map< ::std::string, ::GOPPRR::CRole > & Roles, std::map< ::std::string, ::GOPPRR::CRelationship > & Relationships,
bool& bRoot)
throw(
DSM::Error::CException)
1872 ::xmlpp::Element::AttributeList::iterator x(0);
1873 ::xmlpp::Node::NodeList::iterator y(0);
1874 ::xmlpp::Node::NodeList::iterator z(0);
1875 ::xmlpp::Node::NodeList::iterator u(0);
1876 ::xmlpp::NodeSet::iterator v(0);
1877 ::xmlpp::Element::AttributeList CurrentAttributes(pXMLElement->get_attributes());
1878 ::xmlpp::Element::AttributeList ContentChildAttributes;
1879 ::xmlpp::Element::AttributeList BindingChildAttributes;
1880 ::xmlpp::Element::AttributeList ConnectionChildAttributes;
1881 ::xmlpp::Node::NodeList GraphNodes(pXMLElement->get_children());
1882 ::xmlpp::Node::NodeList BindingNodes;
1883 ::xmlpp::Node::NodeList ConnectionNodes;
1884 ::xmlpp::Node::NodeList ContentNodes;
1885 ::xmlpp::Element* pConnectionXMLElement(0);
1886 ::xmlpp::Element* pConnectionXMLChildElement(0);
1887 ::xmlpp::Element* pGraphChildXMLElement(0);
1888 ::xmlpp::Element* pContentXMLChildNode(0);
1889 ::xmlpp::Element* pBindingXMLChildNode(0);
1890 ::std::vector< ::GOPPRR::CConnection::CCall > CurrentCalls;
1891 ::std::stringstream ErrorMessage;
1892 ::std::string CurrentElement;
1893 ::std::string CurrentBindingElement;
1894 ::std::string CurrentConnectionElement;
1895 ::std::string CurrentContentElement;
1896 ::std::map< ::std::string, std::string > GraphAttributeMap;
1897 ::std::map< ::std::string, std::string > CurrentElementAttributeMap;
1898 ::std::map< ::std::string, std::string > XPathElementAttributeMap;
1899 ::std::map< ::std::string, std::string > BindingChildAttributeMap;
1900 ::std::map< ::std::string, std::string > ContentChildAttributeMap;
1901 ::std::map< ::std::string, std::string > ConnectionChildAttributeMap;
1902 ::std::map< ::std::string, ::GOPPRR::CObject* > GraphObjects;
1903 ::std::map< ::std::string, ::GOPPRR::CPort* > GraphPorts;
1904 ::std::map< ::std::string, ::GOPPRR::CProperty* > GraphProperties;
1905 ::std::map< ::std::string, ::GOPPRR::CRole* > GraphRoles;
1906 ::std::map< ::std::string, ::GOPPRR::CRelationship* > GraphRelationships;
1907 ::std::vector< ::GOPPRR::CBinding > GraphBindings;
1908 ::std::vector< ::GOPPRR::CGraphicalContainer > Containers;
1911 ::std::map< ::std::string, ::GOPPRR::CObject* > CurrentContainedObjects;
1912 ::std::map< ::std::string, ::GOPPRR::CRelationship* > CurrentContainedRelationships;
1918 for (x = CurrentAttributes.begin(); x != CurrentAttributes.end(); x++)
1921 GraphAttributeMap[(*x)->get_name()] = (*x)->get_value();
1926 if (Graphs.find( GraphAttributeMap[
"oid"] ) == Graphs.end())
1929 Graphs[ GraphAttributeMap[
"oid"] ] =
::GOPPRR::CGraph( GraphAttributeMap[
"oid"] );
1932 bRoot = (GraphAttributeMap[
"root"] ==
"true");
1935 for (y = GraphNodes.begin(); y != GraphNodes.end(); y++)
1938 pGraphChildXMLElement =
dynamic_cast< ::xmlpp::Element*
>(*y);
1941 if (pGraphChildXMLElement != 0)
1944 CurrentElement = (*y)->get_name();
1947 CurrentAttributes = pGraphChildXMLElement->get_attributes();
1950 for (x = CurrentAttributes.begin(); x != CurrentAttributes.end(); x++)
1953 CurrentElementAttributeMap[(*x)->get_name()] = (*x)->get_value();
1958 if (CurrentElement ==
"object-reference")
1964 GraphObjects[CurrentElementAttributeMap[
"oid"]] = &(Objects[CurrentElementAttributeMap[
"oid"]]);
1967 else if (CurrentElement ==
"port-reference")
1973 GraphPorts[CurrentElementAttributeMap[
"oid"]] = &(Ports[CurrentElementAttributeMap[
"oid"]]);
1976 else if (CurrentElement ==
"property-reference")
1982 GraphProperties[CurrentElementAttributeMap[
"oid"]] = &(Properties[CurrentElementAttributeMap[
"oid"]]);
1985 else if (CurrentElement ==
"role-reference")
1991 GraphRoles[CurrentElementAttributeMap[
"oid"]] = &(Roles[CurrentElementAttributeMap[
"oid"]]);
1994 else if (CurrentElement ==
"relationship-reference")
2000 GraphRelationships[CurrentElementAttributeMap[
"oid"]] = &(Relationships[CurrentElementAttributeMap[
"oid"]]);
2003 else if (CurrentElement ==
"graphical-content")
2006 pCurrentContainer = 0;
2007 CurrentContainedObjects.clear();
2008 CurrentContainedRelationships.clear();
2011 ContentNodes = pGraphChildXMLElement->get_children();
2014 if (ContentNodes.size() < 2)
2017 ErrorMessage <<
"not enough child XML elements for <gopprr:relationship-reference> in line ";
2018 ErrorMessage << pGraphChildXMLElement->get_line();
2024 for (z = ContentNodes.begin(); z != ContentNodes.end(); z++)
2027 pContentXMLChildNode =
dynamic_cast< ::xmlpp::Element*
>(*z);
2030 if (pContentXMLChildNode != 0)
2033 ContentChildAttributes = pContentXMLChildNode->get_attributes();
2036 for (x = ContentChildAttributes.begin(); x != ContentChildAttributes.end(); x++)
2039 ContentChildAttributeMap[(*x)->get_name()] = (*x)->get_value();
2044 CurrentContentElement = pContentXMLChildNode->get_name();
2047 if (CurrentContentElement ==
"object-reference")
2053 if (pCurrentContainer == 0)
2056 pCurrentContainer = &(Objects[ ContentChildAttributeMap[
"oid"] ]);
2062 CurrentContainedObjects[ ContentChildAttributeMap[
"oid"] ] = &(Objects[ ContentChildAttributeMap[
"oid"] ]);
2067 else if (CurrentContentElement ==
"relationship-reference")
2073 CurrentContainedRelationships[ ContentChildAttributeMap[
"oid"] ] = &(Relationships[ ContentChildAttributeMap[
"oid"] ]);
2079 ErrorMessage <<
"unexpected XML element in <gopprr:graphical-content> in line ";
2080 ErrorMessage << pContentXMLChildNode->get_line();
2093 else if (CurrentElement ==
"binding")
2096 BindingNodes = pGraphChildXMLElement->get_children();
2099 for (z = BindingNodes.begin(); z != BindingNodes.end(); z++)
2102 pBindingXMLChildNode =
dynamic_cast< ::xmlpp::Element*
>(*z);
2105 if (pBindingXMLChildNode != 0)
2108 CurrentBindingElement = pBindingXMLChildNode->get_name();
2111 BindingChildAttributes =pBindingXMLChildNode->get_attributes();
2114 for (x = BindingChildAttributes.begin(); x != BindingChildAttributes.end(); x++)
2117 BindingChildAttributeMap[ (*x)->get_name() ] = (*x)->get_value();
2122 if (CurrentBindingElement ==
"connection")
2125 CurrentCalls.clear();
2128 ConnectionNodes = pBindingXMLChildNode->get_children();
2131 if (ConnectionNodes.size() < 4)
2134 ErrorMessage <<
"not enough child XML elements for <gopprr:connection> in line ";
2135 ErrorMessage << pBindingXMLChildNode->get_line();
2141 for (u = ConnectionNodes.begin(); u != ConnectionNodes.end(); u ++)
2144 pConnectionXMLChildElement =
dynamic_cast< ::xmlpp::Element*
>(*u);
2147 if (pConnectionXMLChildElement != 0)
2150 CurrentConnectionElement = (*u)->get_name();
2153 ConnectionChildAttributes = pConnectionXMLChildElement->get_attributes();
2156 for (x = ConnectionChildAttributes.begin(); x != ConnectionChildAttributes.end(); x++)
2159 ConnectionChildAttributeMap[ (*x)->get_name() ] = (*x)->get_value();
2165 if (CurrentConnectionElement ==
"object-reference")
2174 else if (CurrentConnectionElement ==
"port-reference")
2180 CurrentCalls[ CurrentCalls.size()-1 ].m_pPort = &(Ports[ ConnectionChildAttributeMap[
"oid"] ]);
2183 else if (CurrentConnectionElement ==
"role-reference")
2189 CurrentCalls[ CurrentCalls.size()-1 ].m_pRole = &(Roles[ ConnectionChildAttributeMap[
"oid"] ]);
2195 ErrorMessage <<
"unexpected XML element in <gopprr:connection> in line ";
2196 ErrorMessage << pConnectionXMLElement->get_line();
2206 else if (CurrentBindingElement ==
"relationship-reference")
2212 pCurrentRelationship = &(Relationships[ BindingChildAttributeMap[
"oid"] ]);
2218 ErrorMessage <<
"unexpected XML element in <gopprr:binding> in line ";
2219 ErrorMessage << pBindingXMLChildNode->get_line();
2235 ErrorMessage <<
"unexpected XML element in <gopprr:project> in line ";
2236 ErrorMessage << pXMLElement->get_line();
2247 Graphs[ GraphAttributeMap[
"oid"] ] =
::GOPPRR::CGraph(GraphAttributeMap[
"oid"], GraphAttributeMap[
"type"], GraphAttributeMap[
"name"], GraphProperties, GraphBindings, Containers, GraphObjects, GraphPorts, GraphRelationships, GraphRoles);
2258 void CGOPPRRTransformer::CreateGraph(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships,
bool& bRoot)
throw(
DSM::Error::CException)
2262 ::xmlpp::Element* pXPathXMLElement(0);
2263 ::std::stringstream ErrorMessage;
2267 if (Graphs.find(OID) == Graphs.end())
2273 if (pXPathXMLElement != 0)
2282 ErrorMessage <<
"no <gopprr:graph> element found for <gopprr::graph-reference> in XML line ";
2283 ErrorMessage << pXMLElement->get_line();
2297 void CGOPPRRTransformer::CreateObject(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
2301 bool bRootGraph(
false);
2302 ::xmlpp::Element::AttributeList::iterator x(0);
2303 ::xmlpp::Node::NodeList::iterator y(0);
2304 ::xmlpp::Node::NodeList::iterator z(0);
2305 ::xmlpp::Element::AttributeList ObjectAttributes;
2306 ::xmlpp::Element::AttributeList ObjectChildAttributes;
2307 ::xmlpp::Element::AttributeList DecompositonChildAttributes;
2308 ::xmlpp::Node::NodeList ObjectNodes(pXMLElement->get_children());
2309 ::xmlpp::Node::NodeList DecompositonNodes;
2310 ::xmlpp::Element* pObjectChildXMLElement(0);
2311 ::xmlpp::Element* pDecompositionChildXMLElement(0);
2312 ::std::map< ::std::string, ::std::string> ObjectAttributeMap;
2313 ::std::map< ::std::string, ::std::string> ObjectChildAttributeMap;
2314 ::std::map< ::std::string, ::std::string> DecompositionChildAttributeMap;
2315 ::std::map< ::std::string, ::GOPPRR::CProperty* > ObjectProperties;
2316 ::std::string ChildElementName;
2317 ::std::string DecompositionChildElementName;
2318 ::std::stringstream ErrorMessage;
2320 ::std::map< ::std::string, ::GOPPRR::CGraph* > Explosions;
2326 ObjectAttributes = pXMLElement->get_attributes();
2329 for (x = ObjectAttributes.begin(); x != ObjectAttributes.end(); x++)
2332 ObjectAttributeMap[(*x)->get_name()] = (*x)->get_value();
2337 if (Objects.find( ObjectAttributeMap[
"oid"] ) == Objects.end())
2340 Objects[ ObjectAttributeMap[
"oid"] ] =
::GOPPRR::CObject( ObjectAttributeMap[
"oid"] );
2343 for (y = ObjectNodes.begin(); y != ObjectNodes.end(); y++)
2346 pObjectChildXMLElement =
dynamic_cast< ::xmlpp::Element*
>(*y);
2349 if (pObjectChildXMLElement != 0)
2352 ChildElementName = pObjectChildXMLElement->get_name();
2355 ObjectChildAttributes = pObjectChildXMLElement->get_attributes();
2358 for (x = ObjectChildAttributes.begin(); x != ObjectChildAttributes.end(); x++)
2361 ObjectChildAttributeMap[(*x)->get_name()] = (*x)->get_value();
2367 if (ChildElementName ==
"property-reference")
2373 ObjectProperties[ObjectChildAttributeMap[
"oid"]] = &(Properties[ObjectChildAttributeMap[
"oid"]]);
2376 else if (ChildElementName ==
"decomposition")
2379 DecompositonNodes = pObjectChildXMLElement->get_children();
2382 for (z = DecompositonNodes.begin(); z != DecompositonNodes.end(); z++)
2385 pDecompositionChildXMLElement =
dynamic_cast< ::xmlpp::Element*
>(*z);
2388 if (pDecompositionChildXMLElement != 0)
2391 DecompositonChildAttributes = pDecompositionChildXMLElement->get_attributes();
2394 for (x = DecompositonChildAttributes.begin(); x != DecompositonChildAttributes.end(); x++)
2397 DecompositionChildAttributeMap[(*x)->get_name()] = (*x)->get_value();
2402 DecompositionChildElementName = pDecompositionChildXMLElement->get_name();
2405 if (DecompositionChildElementName ==
"graph-reference")
2411 pDecomposition = &(Graphs[DecompositionChildAttributeMap[
"oid"]]);
2417 ErrorMessage <<
"unexpected XML element in <gopprr:decomposition> in line ";
2418 ErrorMessage << pDecompositionChildXMLElement->get_line();
2428 else if (ChildElementName ==
"explosions")
2437 ErrorMessage <<
"unexpected XML element in <gopprr:object> in line ";
2438 ErrorMessage << pXMLElement->get_line();
2450 Objects[ObjectAttributeMap[
"oid"]] =
::GOPPRR::CObject(ObjectAttributeMap[
"oid"], ObjectAttributeMap[
"type"], ObjectAttributeMap[
"name"], ObjectProperties);
2453 Objects[ObjectAttributeMap[
"oid"]].m_pDecomposition = pDecomposition;
2456 Objects[ObjectAttributeMap[
"oid"]].m_Explosions = Explosions;
2467 void CGOPPRRTransformer::CreateObject(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
2471 ::xmlpp::Element* pXPathXMLElement(0);
2472 ::std::stringstream ErrorMessage;
2476 if (Objects.find(OID) == Objects.end())
2483 if (pXPathXMLElement != 0)
2492 ErrorMessage <<
"no <gopprr:object> element found for <gopprr:object-reference> in XML line ";
2493 ErrorMessage << pXMLElement->get_line();
2507 void CGOPPRRTransformer::CreatePort(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
2511 ::xmlpp::Node::NodeList::iterator x(0);
2512 ::xmlpp::Element::AttributeList::iterator y(0);
2513 ::xmlpp::Element* pPortXMLChildElement(0);
2514 ::xmlpp::Node::NodeList PortChildNodes(pXMLElement->get_children());
2515 ::xmlpp::Element::AttributeList PortAttributes(pXMLElement->get_attributes());
2516 ::xmlpp::Element::AttributeList PortChildAttributes;
2517 ::std::map< ::std::string, ::std::string > PortAttributeMap;
2518 ::std::map< ::std::string, ::std::string > PortChildAttributeMap;
2519 ::std::map< ::std::string, ::GOPPRR::CProperty* > PortProperties;
2520 ::std::string CurrentPropertyChildName;
2521 ::std::stringstream ErrorMessage;
2526 for (y = PortAttributes.begin(); y != PortAttributes.end(); y++)
2529 PortAttributeMap[(*y)->get_name()] = (*y)->get_value();
2534 if (Ports.find( PortAttributeMap[
"oid"] ) == Ports.end())
2537 Ports[ PortAttributeMap[
"oid"] ] =
::GOPPRR::CPort( PortAttributeMap[
"oid"] );
2540 for (x = PortChildNodes.begin(); x != PortChildNodes.end(); x++)
2543 pPortXMLChildElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
2546 if (pPortXMLChildElement != 0)
2549 PortChildAttributes = pPortXMLChildElement->get_attributes();
2552 for (y = PortChildAttributes.begin(); y != PortChildAttributes.end(); y++)
2555 PortChildAttributeMap[(*y)->get_name()] = (*y)->get_value();
2561 CurrentPropertyChildName = pPortXMLChildElement->get_name();
2564 if (CurrentPropertyChildName ==
"property-reference")
2570 PortProperties[PortChildAttributeMap[
"oid"]] = &(Properties[PortChildAttributeMap[
"oid"]]);
2576 ErrorMessage <<
"unexpected XML element in <gopprr:port> in line ";
2577 ErrorMessage << pPortXMLChildElement->get_line();
2588 Ports[ PortAttributeMap[
"oid"] ] =
::GOPPRR::CPort(PortAttributeMap[
"oid"], PortAttributeMap[
"type"], PortAttributeMap[
"name"], PortProperties);
2599 void CGOPPRRTransformer::CreatePort(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
2603 ::xmlpp::Element* pXPathXMLElement(0);
2604 ::std::stringstream ErrorMessage;
2608 if (Ports.find(OID) == Ports.end())
2614 if (pXPathXMLElement != 0)
2623 ErrorMessage <<
"no <gopprr:port> element found for <gopprr::port-reference> in XML line ";
2624 ErrorMessage << pXMLElement->get_line();
2638 void CGOPPRRTransformer::CreateProperty(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
2642 bool bRootGraph(
false);
2643 ::xmlpp::Node::NodeList::iterator x(0);
2644 ::xmlpp::Element::AttributeList::iterator y(0);
2645 ::xmlpp::Element* pPropertyXMLChildElement(0);
2646 ::xmlpp::TextNode* pPropertyXMLChildTextNode(0);
2647 ::xmlpp::Node::NodeList PropertyChildNodes(pXMLElement->get_children());
2648 ::xmlpp::Element::AttributeList PropertyAttributes(pXMLElement->get_attributes());
2649 ::xmlpp::Element::AttributeList PropertyChildAttributes;
2650 ::std::map< ::std::string, ::std::string > PropertyAttributeMap;
2651 ::std::map< ::std::string, ::std::string > PropertyChildAttributeMap;
2652 ::std::map< ::std::string, ::GOPPRR::CNonProperty* > NonProperties;
2653 ::std::string PropertyValue;
2654 ::std::string CurrentPropertyChildName;
2655 ::std::stringstream ErrorMessage;
2660 for (y = PropertyAttributes.begin(); y != PropertyAttributes.end(); y++)
2663 PropertyAttributeMap[(*y)->get_name()] = (*y)->get_value();
2668 if (Properties.find( PropertyAttributeMap[
"oid"] ) == Properties.end())
2671 Properties[ PropertyAttributeMap[
"oid"] ] =
::GOPPRR::CProperty( PropertyAttributeMap[
"oid"] );
2674 for (x = PropertyChildNodes.begin(); x != PropertyChildNodes.end(); x++)
2677 pPropertyXMLChildElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
2680 pPropertyXMLChildTextNode =
dynamic_cast< ::xmlpp::TextNode*
>(*x);
2683 if (pPropertyXMLChildElement != 0)
2686 PropertyChildAttributes = pPropertyXMLChildElement->get_attributes();
2689 for (y = PropertyChildAttributes.begin(); y != PropertyChildAttributes.end(); y++)
2692 PropertyChildAttributeMap[(*y)->get_name()] = (*y)->get_value();
2697 CurrentPropertyChildName = pPropertyXMLChildElement->get_name();
2700 if (CurrentPropertyChildName ==
"graph-reference")
2706 NonProperties[PropertyChildAttributeMap[
"oid"]] = &(Graphs[PropertyChildAttributeMap[
"oid"]]);
2709 else if (CurrentPropertyChildName ==
"object-reference")
2715 NonProperties[PropertyChildAttributeMap[
"oid"]] = &(Objects[PropertyChildAttributeMap[
"oid"]]);
2718 else if (CurrentPropertyChildName ==
"port-reference")
2724 NonProperties[PropertyChildAttributeMap[
"oid"]] = &(Ports[PropertyChildAttributeMap[
"oid"]]);
2727 else if (CurrentPropertyChildName ==
"role-reference")
2733 NonProperties[PropertyChildAttributeMap[
"oid"]] = &(Roles[PropertyChildAttributeMap[
"oid"]]);;
2736 else if (CurrentPropertyChildName ==
"relationship-reference")
2742 NonProperties[PropertyChildAttributeMap[
"oid"]] = &(Relationships[PropertyChildAttributeMap[
"oid"]]);;
2748 ErrorMessage <<
"unexpected XML element in <gopprr:property> in line ";
2749 ErrorMessage << pPropertyXMLChildElement->get_line();
2755 else if (pPropertyXMLChildTextNode != 0)
2758 PropertyValue = pPropertyXMLChildTextNode->get_content();
2766 Properties[ PropertyAttributeMap[
"oid"] ] =
::GOPPRR::CProperty(PropertyAttributeMap[
"oid"], PropertyAttributeMap[
"type"], PropertyValue, NonProperties);
2777 void CGOPPRRTransformer::CreateProperty(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
2781 ::xmlpp::Element* pXPathXMLElement(0);
2782 ::std::stringstream ErrorMessage;
2786 if (Properties.find(OID) == Properties.end())
2792 if (pXPathXMLElement != 0)
2801 ErrorMessage <<
"no <gopprr:property> element found for <gopprr::property-reference> in XML line ";
2802 ErrorMessage << pXMLElement->get_line();
2816 void CGOPPRRTransformer::CreateRole(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
2820 ::xmlpp::Node::NodeList::iterator x(0);
2821 ::xmlpp::Element::AttributeList::iterator y(0);
2822 ::xmlpp::Node::NodeList::iterator z(0);
2823 ::xmlpp::Element* pRoleXMLChildElement(0);
2824 ::xmlpp::Node::NodeList RoleChildNodes(pXMLElement->get_children());
2825 ::xmlpp::Element::AttributeList RoleAttributes(pXMLElement->get_attributes());
2826 ::xmlpp::Element::AttributeList RoleChildAttributes;
2827 ::std::map< ::std::string, ::std::string > RoleAttributeMap;
2828 ::std::map< ::std::string, ::std::string > RoleChildAttributeMap;
2829 ::std::map< ::std::string, ::GOPPRR::CProperty* > RoleProperties;
2830 ::std::string CurrentRoleChildName;
2831 ::std::stringstream ErrorMessage;
2832 ::std::map< ::std::string, ::GOPPRR::CGraph* > Explosions;
2837 for (y = RoleAttributes.begin(); y != RoleAttributes.end(); y++)
2840 RoleAttributeMap[(*y)->get_name()] = (*y)->get_value();
2845 if (Roles.find( RoleAttributeMap[
"oid"]) == Roles.end())
2848 Roles[ RoleAttributeMap[
"oid"] ] =
::GOPPRR::CRole( RoleAttributeMap[
"oid"] );
2851 for (x = RoleChildNodes.begin(); x != RoleChildNodes.end(); x++)
2854 pRoleXMLChildElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
2857 if (pRoleXMLChildElement != 0)
2860 RoleChildAttributes = pRoleXMLChildElement->get_attributes();
2863 for (y = RoleChildAttributes.begin(); y != RoleChildAttributes.end(); y++)
2866 RoleChildAttributeMap[(*y)->get_name()] = (*y)->get_value();
2872 CurrentRoleChildName = pRoleXMLChildElement->get_name();
2875 if (CurrentRoleChildName ==
"property-reference")
2881 RoleProperties[RoleChildAttributeMap[
"oid"]] = &(Properties[RoleChildAttributeMap[
"oid"]]);
2884 else if (CurrentRoleChildName ==
"explosions")
2894 ErrorMessage <<
"unexpected XML element in <gopprr:port> in line ";
2895 ErrorMessage << pRoleXMLChildElement->get_line();
2906 Roles[ RoleAttributeMap[
"oid"] ] =
::GOPPRR::CRole(RoleAttributeMap[
"oid"], RoleAttributeMap[
"type"], RoleAttributeMap[
"name"], RoleProperties);
2909 Roles[ RoleAttributeMap[
"oid"] ].m_Explosions = Explosions;
2920 void CGOPPRRTransformer::CreateRole(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
2924 ::xmlpp::Element* pXPathXMLElement(0);
2925 ::std::stringstream ErrorMessage;
2929 if (Roles.find(OID) == Roles.end())
2935 if (pXPathXMLElement != 0)
2944 ErrorMessage <<
"no <gopprr:role> element found for <gopprr::role-reference> in XML line ";
2945 ErrorMessage << pXMLElement->get_line();
2959 void CGOPPRRTransformer::CreateRelationship(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
2963 ::xmlpp::Node::NodeList::iterator x(0);
2964 ::xmlpp::Element::AttributeList::iterator y(0);
2965 ::xmlpp::Node::NodeList::iterator z(0);
2966 ::xmlpp::Element* pRelationshipXMLChildElement(0);
2967 ::xmlpp::Node::NodeList RelationshipChildNodes(pXMLElement->get_children());
2968 ::xmlpp::Element::AttributeList RelationshipAttributes(pXMLElement->get_attributes());
2969 ::xmlpp::Element::AttributeList RelationshipChildAttributes;
2970 ::std::map< ::std::string, ::std::string > RelationshipAttributeMap;
2971 ::std::map< ::std::string, ::std::string > RelationshipChildAttributeMap;
2972 ::std::map< ::std::string, ::GOPPRR::CProperty* > RelationshipProperties;
2973 ::std::string CurrentRelationshipChildName;
2974 ::std::stringstream ErrorMessage;
2975 ::std::map< ::std::string, ::GOPPRR::CGraph* > Explosions;
2980 for (y = RelationshipAttributes.begin(); y != RelationshipAttributes.end(); y++)
2983 RelationshipAttributeMap[(*y)->get_name()] = (*y)->get_value();
2988 if (Relationships.find( RelationshipAttributeMap[
"oid"] ) == Relationships.end())
2991 Relationships[ RelationshipAttributeMap[
"oid"] ] =
::GOPPRR::CRelationship( RelationshipAttributeMap[
"oid"] );
2994 for (x = RelationshipChildNodes.begin(); x != RelationshipChildNodes.end(); x++)
2997 pRelationshipXMLChildElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
3000 if (pRelationshipXMLChildElement != 0)
3003 RelationshipChildAttributes = pRelationshipXMLChildElement->get_attributes();
3006 for (y = RelationshipChildAttributes.begin(); y != RelationshipChildAttributes.end(); y++)
3009 RelationshipChildAttributeMap[(*y)->get_name()] = (*y)->get_value();
3015 CurrentRelationshipChildName = pRelationshipXMLChildElement->get_name();
3018 if (CurrentRelationshipChildName ==
"property-reference")
3024 RelationshipProperties[RelationshipChildAttributeMap[
"oid"]] = &(Properties[RelationshipChildAttributeMap[
"oid"]]);
3027 else if (CurrentRelationshipChildName ==
"explosions")
3036 ErrorMessage <<
"unexpected XML element in <gopprr:port> in line ";
3037 ErrorMessage << pRelationshipXMLChildElement->get_line();
3048 Relationships[ RelationshipAttributeMap[
"oid"] ] =
::GOPPRR::CRelationship(RelationshipAttributeMap[
"oid"], RelationshipAttributeMap[
"type"], RelationshipAttributeMap[
"name"], RelationshipProperties);
3051 Relationships[ RelationshipAttributeMap[
"oid"] ].m_Explosions = Explosions;
3062 void CGOPPRRTransformer::CreateRelationship(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships)
throw(
DSM::Error::CException)
3066 ::xmlpp::Element* pXPathXMLElement(0);
3067 ::std::stringstream ErrorMessage;
3071 if (Relationships.find(OID) == Relationships.end())
3077 if (pXPathXMLElement != 0)
3086 ErrorMessage <<
"no <gopprr:relationship> element found for <gopprr::relationship-refrenece> in XML line ";
3087 ErrorMessage << pXMLElement->get_line();
3101 void CGOPPRRTransformer::CreateExplosion(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph > & Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty > & Properties, std::map< ::std::string, ::GOPPRR::CPort > & Ports, std::map< ::std::string, ::GOPPRR::CRole > & Roles, std::map< ::std::string, ::GOPPRR::CRelationship > & Relationships, std::map< ::std::string, ::GOPPRR::CGraph* >& Explosions)
throw(
DSM::Error::CException)
3105 bool bRootGraph(
false);
3106 ::xmlpp::Element::NodeList::iterator x(0);
3107 ::xmlpp::Element::AttributeList::iterator y(0);
3108 ::xmlpp::Element::AttributeList ExplosionChildAttributes;
3109 ::xmlpp::Element::NodeList ExplosionNodes;
3110 ::xmlpp::Element* pExplosionChildXMLElement(0);
3111 ::std::string ExplosionChildElementName;
3112 ::std::stringstream ErrorMessage;
3113 ::std::map< ::std::string, std::string> ExplosionChildAttributeMap;
3118 ExplosionNodes = pXMLElement->get_children();
3121 for (x = ExplosionNodes.begin(); x != ExplosionNodes.end(); x++)
3124 pExplosionChildXMLElement =
dynamic_cast< ::xmlpp::Element*
>(*x);
3127 if (pExplosionChildXMLElement != 0)
3130 ExplosionChildAttributes = pExplosionChildXMLElement->get_attributes();
3133 ExplosionChildElementName = pExplosionChildXMLElement->get_name();
3136 for (y = ExplosionChildAttributes.begin(); y != ExplosionChildAttributes.end(); y++)
3139 ExplosionChildAttributeMap[(*y)->get_name()] = (*y)->get_value();
3145 if (ExplosionChildElementName ==
"graph-reference")
3151 Explosions[ExplosionChildAttributeMap[
"oid"]]= &(Graphs[ExplosionChildAttributeMap[
"oid"]]);
3157 ErrorMessage <<
"unexpected XML element in <gopprr:decomposition> in line ";
3158 ErrorMessage << pExplosionChildXMLElement->get_line();
3179 bool bNodeFound(
false);
3180 ::xmlpp::Element::AttributeList::iterator x(0);
3181 ::xmlpp::NodeSet::iterator v(0);
3182 ::xmlpp::NodeSet NodesFromXPath;
3183 ::xmlpp::Element* pCurrentXPathXMLElement(0);
3184 ::xmlpp::Element* pXPathXMLElement(0);
3185 ::xmlpp::Element::AttributeList CurrentAttributes;
3186 ::xmlpp::Node::PrefixNsMap PrefixMap;
3187 ::std::map< ::std::string, ::std::string > XPathElementAttributeMap;
3191 PrefixMap[
"gopprr"] =
"http://www.GOPPRR.org";
3194 NodesFromXPath = pXMLElement->find(XPath, PrefixMap);
3197 for (v = NodesFromXPath.begin(); v != NodesFromXPath.end() && !bNodeFound; v++)
3200 pCurrentXPathXMLElement =
dynamic_cast< ::xmlpp::Element*
>(*v);
3203 if (pCurrentXPathXMLElement != 0)
3206 CurrentAttributes = pCurrentXPathXMLElement->get_attributes();
3209 for (x = CurrentAttributes.begin(); x != CurrentAttributes.end(); x++)
3212 XPathElementAttributeMap[(*x)->get_name()] = (*x)->get_value();
3217 if (XPathElementAttributeMap[
"oid"] == OID)
3223 pXPathXMLElement = pCurrentXPathXMLElement;
3233 return pXPathXMLElement;
3244 #ifndef __XML_GOPPRR_SCHEMA__
3245 #define __XML_GOPPRR_SCHEMA__
3246 #include "../GOPPRR/XML/GOPPRR_Schema.inl"