Changeset 8685
- Timestamp:
- 02/15/09 20:07:52 (4 years ago)
- Location:
- ossiedev/branches/mcarrick/DPD
- Files:
-
- 5 modified
-
DevicePkgRef.cpp (modified) (1 diff)
-
DevicePkgRef.h (modified) (1 diff)
-
HWDeviceRegistration.cpp (modified) (3 diffs)
-
HWDeviceRegistration.h (modified) (4 diffs)
-
testApp.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/mcarrick/DPD/DevicePkgRef.cpp
r8679 r8685 20 20 type = elem->Attribute("type"); // store type from devicepkgref tag 21 21 22 std::cout << "creating reference to devicepkgref localfile..." << std::endl;23 22 TiXmlElement *local = elem->FirstChildElement("localfile"); // get link to localfile tag 24 25 std::cout << "getting devicepkgref localfile..." << std::endl;26 23 localfile = local->Attribute("name"); // store path 27 24 } 28 25 29 std::string DevicePkgRef::getType ()26 std::string DevicePkgRef::getTypeDevPkgRef() 30 27 { 31 28 return type; 32 29 } 33 30 34 std::string DevicePkgRef::getLocalFile ()31 std::string DevicePkgRef::getLocalFileDevPkgRef() 35 32 { 36 33 return localfile; -
ossiedev/branches/mcarrick/DPD/DevicePkgRef.h
r8679 r8685 16 16 ~DevicePkgRef(); 17 17 18 std::string getType ();19 std::string getLocalFile ();18 std::string getTypeDevPkgRef(); 19 std::string getLocalFileDevPkgRef(); 20 20 21 21 protected: -
ossiedev/branches/mcarrick/DPD/HWDeviceRegistration.cpp
r8680 r8685 11 11 { 12 12 parseElement(elem); // parse tags in hwdeviceregistration, with exception of propertyfile, deviceclass, childhwdevice 13 14 // parse childhwdevice tag(s) 15 TiXmlElement *child = elem->FirstChildElement("childhwdevice"); 16 for (; child; child=child->NextSiblingElement("childhwdevice")) 17 { 18 ChildHWDevice *cDevice; 19 cDevice = new ChildHWDevice(elem->FirstChildElement("childhwdevice")); 20 std::cout << "childhwdevice object created..." << std::endl; 21 22 childHWDevices.push_back(cDevice); 23 std::cout << "childhwdevice pushed..." << std::endl; 24 } 25 26 std::cout << "returning from hwdeviceregistration constructor..." << std::endl; 13 constructChildHWDevice(elem->FirstChildElement("childhwdevice")); // cannot call constructor on ChildHWDevice, use this function to do it 27 14 } 28 15 … … 31 18 } 32 19 20 void HWDeviceRegistration::constructChildHWDevice(TiXmlElement *elem) 21 { 22 std::cout << "constructing hwdeviceregistration ... " << std::endl; 23 24 // parse childhwdevice tag(s) 25 for (; elem; elem=elem->NextSiblingElement("childhwdevice")) 26 { 27 // create child device object 28 ChildHWDevice *cDevice; 29 cDevice = new ChildHWDevice(elem); 30 31 // push new child device onto vector 32 childHWDevices.push_back(cDevice); 33 } 34 } 35 36 // parse attributes within hwdeviceregistration tag 33 37 void HWDeviceRegistration::parseElement(TiXmlElement *elem) 34 38 { … … 51 55 } 52 56 53 ChildHWDevice * HWDeviceRegistration::parseChildHWDevice(TiXmlElement *elem)57 ChildHWDevice::ChildHWDevice(TiXmlElement *elem):DevicePkgRef(elem->FirstChildElement("devicepkgref")),HWDeviceRegistration(elem->FirstChildElement("hwdeviceregistration")) 54 58 { 55 std::cout << "parsing childhwdevice..." << std::endl; 56 } 57 58 ChildHWDevice::ChildHWDevice(TiXmlElement *elem):DevicePkgRef(elem->FirstChildElement("devicepkgref")) 59 { 60 std::cout << "child hw device constructor..." << std::endl; 59 std::cout << "childhwdevice constructor ... " << std::endl; 61 60 } 62 61 -
ossiedev/branches/mcarrick/DPD/HWDeviceRegistration.h
r8679 r8685 34 34 protected: 35 35 void parseElement(TiXmlElement *elem); 36 ChildHWDevice* parseChildHWDevice(TiXmlElement *elem);36 void constructChildHWDevice(TiXmlElement *elem); 37 37 38 38 private: … … 51 51 }; 52 52 53 class ChildHWDevice:public DevicePkgRef 53 class ChildHWDevice:public DevicePkgRef, public HWDeviceRegistration 54 54 { 55 55 public: … … 57 57 ~ChildHWDevice(); 58 58 59 //HWDeviceRegistration getHWDeviceRegistration();59 // HWDeviceRegistration getHWDeviceRegistration(); 60 60 61 61 protected: … … 66 66 ChildHWDevice(const ChildHWDevice& aChildHWDevice); // no copying 67 67 68 //HWDeviceRegistration hwDeviceReg(TiXmlElement *elem);69 //void parseHWDeviceRegistration(TiXmlElement *elem);68 // HWDeviceRegistration hwDeviceReg(TiXmlElement *elem); 69 // void parseHWDeviceRegistration(TiXmlElement *elem); 70 70 71 71 }; -
ossiedev/branches/mcarrick/DPD/testApp.cpp
r8681 r8685 1 //#include "DeviceClass.h"2 1 #include "DevicePkgRef.h" 3 //#include "PropertyFile.h"4 2 #include "HWDeviceRegistration.h" 5 3 //#include "DevicePkg.h" … … 75 73 std::cout << std::endl << std::endl; 76 74 77 std::cout << "<hwdeviceregistration " << parse.getID() << " version=" << parse.getVersion() << " name=" << parse.getName() << ">" << std::endl;78 std::cout << " <propertyfile type=" << parse.getType() << ">" << std::endl;79 std::cout << " <localfile name=" << parse.getLocalFile() << ">" << std::endl;80 std::cout << " </propertyfile>" << std::endl;81 std::cout << " <description>" << parse.getDescription() << "</description" << std::endl;82 std::cout << " <manufacturer>" << parse.getManufacturer() << "</manufacturer>" << std::endl;83 std::cout << " <modelnumber>" << parse.getModelNumber() << "</modelnumber>" << std::endl;84 std::cout << " <deviceclass>" << std::endl;75 std::cout << "<hwdeviceregistration id=" << parse.getID() << " version=" << parse.getVersion() << " name=" << parse.getName() << ">" << std::endl; 76 std::cout << " <propertyfile type=" << parse.getType() << ">" << std::endl; 77 std::cout << " <localfile name=" << parse.getLocalFile() << ">" << std::endl; 78 std::cout << " </propertyfile>" << std::endl; 79 std::cout << " <description>" << parse.getDescription() << "</description" << std::endl; 80 std::cout << " <manufacturer>" << parse.getManufacturer() << "</manufacturer>" << std::endl; 81 std::cout << " <modelnumber>" << parse.getModelNumber() << "</modelnumber>" << std::endl; 82 std::cout << " <deviceclass>" << std::endl; 85 83 86 84 for (int i = 0; i < parse.getDeviceClass().size(); i++) 87 85 { 88 std::cout << " <class>" << parse.getDeviceClass()[i] << "</class>" << std::endl;86 std::cout << " <class>" << parse.getDeviceClass()[i] << "</class>" << std::endl; 89 87 } 90 std::cout << " </deviceclass>" << std::endl; 88 std::cout << " </deviceclass>" << std::endl; 89 90 std::cout << " <childhwdevice>" << std::endl; 91 std::cout << " <hwdeviceregistration id=" << parse.getChildHWDevice()[0]->getID(); 92 std::cout << " version=" << parse.getChildHWDevice()[0]->getVersion() << " name=" << parse.getChildHWDevice()[0]->getName() << " >" << std::endl; 93 std::cout << " <propertyfile " << parse.getChildHWDevice()[0]->getType() << "> " << std::endl; 94 std::cout << " <localfile name=" << parse.getChildHWDevice()[0]->getLocalFile() << "/> " << std::endl; 95 std::cout << " </propertyfile>" << std::endl; 96 std::cout << " <description>" << parse.getChildHWDevice()[0]->getDescription() << "</description>" << std::endl; 97 std::cout << " <manufacturer>" << parse.getChildHWDevice()[0]->getManufacturer() << "</manufacturer>" << std::endl; 98 std::cout << " <modelnumber>" << parse.getChildHWDevice()[0]->getModelNumber() << "</modelnumber>" << std::endl; 99 std::cout << " <deviceclass>" << std::endl; 100 std::cout << " <class>" << parse.getChildHWDevice()[0]->getDeviceClass()[0] << "</class>" << std::endl; 101 std::cout << " </deviceclass>" << std::endl; 102 std::cout << " </hwdeviceregistration>" << std::endl; 103 std::cout << " <devicepkgref>" << std::endl; 104 std::cout << " <localfile name=" << parse.getChildHWDevice()[0]->getLocalFileDevPkgRef() << "/>" << std::endl; 105 std::cout << " </devicepkgref>" << std::endl; 106 std::cout << " </childhwdevice>" << std::endl; 91 107 std::cout << "</hwdeviceregistration>" << std::endl; 108 92 109 93 110 std::cout << std::endl << std::endl; … … 117 134 std::cout << "********************" << std::endl; 118 135 std::cout << "DevicePkgRef:" << std::endl; 119 std::cout << "type: " << parse.getType () << std::endl;120 std::cout << "localfile: " << parse.getLocalFile () << std::endl;136 std::cout << "type: " << parse.getTypeDevPkgRef() << std::endl; 137 std::cout << "localfile: " << parse.getLocalFileDevPkgRef() << std::endl; 121 138 std::cout << "********************" << std::endl; 122 139