/** Parse the CoreInfo and create the Core Contexts for the specified CPU context. */ ICoreDMContext[] parseCoresInfoForCores(ICPUDMContext cpuDmc, ICoreInfo[] coresInfo) { Vector<ICoreDMContext> coreDmcs = new Vector<ICoreDMContext>(); for (ICoreInfo core : coresInfo) { if (core.getPhysicalId().equals(cpuDmc.getId())) { // This core belongs to the right CPU coreDmcs.add(createCoreContext(cpuDmc, core.getId())); } } return coreDmcs.toArray(new ICoreDMContext[coreDmcs.size()]); }
/** Parse the CoreInfo and create the CPU Contexts for the hardwareTarget context. */ ICPUDMContext[] parseCoresInfoForCPUs(IHardwareTargetDMContext dmc, ICoreInfo[] coresInfo) { Set<String> cpuIds = new HashSet<String>(); ICPUDMContext[] CPUs; for (ICoreInfo core : coresInfo) { cpuIds.add(core.getPhysicalId()); } String[] cpuIdsArray = cpuIds.toArray(new String[cpuIds.size()]); CPUs = new ICPUDMContext[cpuIdsArray.length]; for (int i = 0; i < cpuIdsArray.length; i++) { CPUs[i] = createCPUContext(dmc, cpuIdsArray[i]); } return CPUs; }