[Mobies-commit] [commit] r3805 - GReAT/trunk/Tools/MetaGME2UMX
ksmyth at redhat1.isis.vanderbilt.edu
ksmyth at redhat1.isis.vanderbilt.edu
Thu Jul 28 14:19:18 CDT 2011
Author: ksmyth
Date: Thu Jul 28 14:19:18 2011
New Revision: 3805
Log:
Fix refport generation
Modified:
GReAT/trunk/Tools/MetaGME2UMX/MetaGME2UML_2.cpp
Modified: GReAT/trunk/Tools/MetaGME2UMX/MetaGME2UML_2.cpp
==============================================================================
--- GReAT/trunk/Tools/MetaGME2UMX/MetaGME2UML_2.cpp Thu Jul 28 14:18:53 2011 (r3804)
+++ GReAT/trunk/Tools/MetaGME2UMX/MetaGME2UML_2.cpp Thu Jul 28 14:19:18 2011 (r3805)
@@ -27,9 +27,12 @@
#include <cctype> // for isspace()
#include <iterator>
+#include "UdmUtil.h"
using namespace std;
+std::string ExName(const Udm::Object& o) { return UdmUtil::ExtractName(o); }
+
bool AskUserForConstraint(long);
void MetaGME2UML::Phase5_CreateConnections()
@@ -1197,7 +1200,9 @@
};
std::set<MetaGME::BaseFCO> GetContainersAndTheirSubtypes(const MetaGME::BaseFCO& fco) {
- std::set<MetaGME::Containment> containments = GetAllConnections(fco, std::mem_fun_ref(&MetaGME::BaseFCO::dstContainment));
+ std::set<std::set<MetaGME::Containment>> superContainments;
+ trans(GetSelfAndSupertypes(fco), superContainments, GetAllConnectionsFunctor(std::mem_fun_ref(&MetaGME::BaseFCO::dstContainment)));
+ std::set<MetaGME::Containment> containments = flatten_set(superContainments);
std::set<MetaGME::BaseModel> containers;
trans(containments, containers, std::mem_fun_ref(&MetaGME::Containment::dstContainment_end));
std::set<std::set<MetaGME::BaseFCO> > containers_and_supertypes;
@@ -1225,8 +1230,18 @@
{
std::set<MetaGME::BaseFCO> subtypes;
std::set<MetaGME::BaseFCO> subtypes_ = GetSelfAndSubtypes(connend);
+ std::set<std::set<MetaGME::BaseFCO>> subtypesSupers_;
+ trans(subtypes_, subtypesSupers_, GetSelfAndSupertypes);
+ std::set<MetaGME::BaseFCO> subtypesSupers = flatten_set(subtypesSupers_);
+ std::copy(subtypesSupers.begin(), subtypesSupers.end(), set_inserter(subtypes_));
// connections cannot be ports
std::remove_copy_if(subtypes_.begin(), subtypes_.end(), set_inserter(subtypes), IsDerivedFrom(MetaGME::Connection::meta));
+#ifdef _DEBUG
+ std::vector<std::string> subtypes_str;
+ std::transform(subtypes.begin(), subtypes.end(), std::back_inserter(subtypes_str), std::ptr_fun(ExName));
+ std::vector<std::string> subtypesSupers_str;
+ std::transform(subtypesSupers.begin(), subtypesSupers.end(), std::back_inserter(subtypesSupers_str), std::ptr_fun(ExName));
+#endif
// now compute port_containers: models that can contain a subtype as a port
std::set<MetaGME::Model> port_containers;
@@ -1247,6 +1262,10 @@
MetaGME::Model (*Model_cast)(const Udm::Object&) = &MetaGME::Model::Cast;
trans(flatten_set(base_port_containers_and_subtypes), port_containers, std::ptr_fun(Model_cast));
}
+#ifdef _DEBUG
+ std::vector<std::string> port_containers_str;
+ std::transform(port_containers.begin(), port_containers.end(), std::back_inserter(port_containers_str), std::ptr_fun(ExName));
+#endif
// Now compute refport_containers: the references that refer to port_containers
std::set<MetaGME::Reference> refport_containers;
More information about the Mobies-commit
mailing list