public BoundAssemblyNode EnsureNode(RuntimicSystemModel runtimicSystem, StructuralAssemblyNode inputStructuralNode) { var boundModel = runtimicSystem.TypeSystems.Bound; if (boundModel.Assemblies.ByMetadataId.TryGetValue(inputStructuralNode.MetadataId, out BoundAssemblyNode boundAssemblyNode)) { return(boundAssemblyNode); } boundAssemblyNode = new BoundAssemblyNode() { Id = Runtimic.Identification.IssueId(runtimicSystem), StructuralNode = inputStructuralNode, MetadataId = inputStructuralNode.MetadataId, FullName = inputStructuralNode.FullName }; boundModel.Assemblies.ById.Add(boundAssemblyNode.Id, boundAssemblyNode); boundModel.Assemblies.ByMetadataId.Add(inputStructuralNode.MetadataId, boundAssemblyNode); boundModel.Assemblies.ByName.Add(boundAssemblyNode.FullName, boundAssemblyNode); boundAssemblyNode.BoundAssembly = Assemblies.Creation.CreateAssemblyEntry(runtimicSystem, boundAssemblyNode); return(boundAssemblyNode); }
public BoundModuleNode EnsureNode(RuntimicSystemModel runtimic, BoundAssemblyNode assemblyNode, StructuralModuleNode structuralModule) { var bound = runtimic.TypeSystems.Bound; if (bound.Modules.ByVersionId.TryGetValue(structuralModule.VersionId, out BoundModuleNode node)) { return(node); } var moduleNode = new BoundModuleNode() { AssemblyNode = assemblyNode, InputStructuralDefinition = structuralModule }; bound.Modules.ByVersionId.Add(structuralModule.VersionId, moduleNode); moduleNode.BoundModule = Modules.Creation.Create(runtimic, moduleNode); return(moduleNode); }
/// <summary> /// /// </summary> /// <param name="semanticModel"></param> /// <param name="assemblyDefinition"></param> /// <returns></returns> /// <remarks>The only way an semantic assembly should be created is via the use of an assembly definition. This forces the structural model to be /// updated to include the assembly definition first. </remarks> public BoundAssemblyMask_I CreateAssemblyEntry(RuntimicSystemModel runtimicSystem, BoundAssemblyNode assemblyNode) { var boundAssembly = new BoundAssembly() { Node = assemblyNode }; return(boundAssembly); }