| | 737 | // store implementation info from current SPD file |
| | 738 | std::vector <SPDImplementation*> *compImpl = spd.getImplementations(); |
| | 739 | |
| | 740 | // ----------------- (DELETE THESE LINES) --------------------- |
| | 741 | // ----------------- ( TEST VECTORS ) ------------------------- |
| | 742 | std::string os = "Linux"; |
| | 743 | std::string proc = "powerpc"; |
| | 744 | std::string version = "2.6.26.3"; |
| | 745 | |
| | 746 | // the if () statements will need to be changes once the real |
| | 747 | // variable name is given. |
| | 748 | |
| | 749 | // ------------------------------------------------------------ |
| | 750 | |
| | 751 | // search compImpl for matching implementation details from device |
| | 752 | // (this checking section will need to be expanded if other |
| | 753 | // options need to be verified: compiler, |
| | 754 | |
| | 755 | |
| | 756 | // (it is currently assumed in SPDImplementation.h, |
| | 757 | // DeviceManager.cpp, and other places that there is only |
| | 758 | // a single OS. this is incorrect and needs to be fixed.) |
| | 759 | |
| | 760 | DEBUG(4, AppFac, "Matching device implementation to candidate components."); |
| | 761 | for (int i = 0; i < compImpl->size(); i++) |
| | 762 | { |
| | 763 | // match OS name |
| | 764 | if ((*compImpl)[i]->getOperatingSystem().getOSName() == os) |
| | 765 | { |
| | 766 | // match OS version |
| | 767 | if ((*compImpl)[i]->getOperatingSystem().getOSVersion() == version) |
| | 768 | { |
| | 769 | // get list of candidate processors in component impl |
| | 770 | std::vector <std::string> procs = (*compImpl)[i]->getProcessors(); |
| | 771 | |
| | 772 | // loop through candidate procs, match to device |
| | 773 | for (int k = 0; k < procs.size(); k++) |
| | 774 | { |
| | 775 | // match processor |
| | 776 | if (procs[k] == proc) |
| | 777 | { |
| | 778 | DEBUG(4, AppFac, "Found operating system match: " |
| | 779 | << (*compImpl)[i]->getOperatingSystem().getOSName() |
| | 780 | << ", " |
| | 781 | << (*compImpl)[i]->getOperatingSystem().getOSVersion() ); |
| | 782 | |
| | 783 | |
| | 784 | DEBUG(4, AppFac, "Found processor match: " << procs[k]); |
| | 785 | |
| | 786 | // return path to executable |
| | 787 | std::string path = (*compImpl)[i]->getCodeFile(); |
| | 788 | implsToExecute.push_back(path); |
| | 789 | } |
| | 790 | } |
| | 791 | } |
| | 792 | } |
| | 793 | else |
| | 794 | { |
| | 795 | DEBUG(4, AppFac, "in getRequiredComponents, could not match component implementation to device."); |
| | 796 | } |
| | 797 | } |
| | 798 | |
| | 799 | |
| | 800 | |