Changeset 8685

Show
Ignore:
Timestamp:
02/15/09 20:07:52 (4 years ago)
Author:
mcarrick
Message:

hwdevreg and childhwdev work for a single level

Location:
ossiedev/branches/mcarrick/DPD
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/branches/mcarrick/DPD/DevicePkgRef.cpp

    r8679 r8685  
    2020        type = elem->Attribute("type"); // store type from devicepkgref tag 
    2121 
    22         std::cout << "creating reference to devicepkgref localfile..." << std::endl; 
    2322        TiXmlElement *local = elem->FirstChildElement("localfile"); // get link to localfile tag 
    24  
    25         std::cout << "getting devicepkgref localfile..." << std::endl; 
    2623        localfile = local->Attribute("name"); // store path 
    2724} 
    2825 
    29 std::string DevicePkgRef::getType() 
     26std::string DevicePkgRef::getTypeDevPkgRef() 
    3027{ 
    3128        return type; 
    3229} 
    3330 
    34 std::string DevicePkgRef::getLocalFile() 
     31std::string DevicePkgRef::getLocalFileDevPkgRef() 
    3532{ 
    3633        return localfile; 
  • ossiedev/branches/mcarrick/DPD/DevicePkgRef.h

    r8679 r8685  
    1616                ~DevicePkgRef(); 
    1717 
    18                 std::string getType(); 
    19                 std::string getLocalFile(); 
     18                std::string getTypeDevPkgRef(); 
     19                std::string getLocalFileDevPkgRef(); 
    2020 
    2121        protected: 
  • ossiedev/branches/mcarrick/DPD/HWDeviceRegistration.cpp

    r8680 r8685  
    1111{ 
    1212        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 
    2714} 
    2815 
     
    3118} 
    3219 
     20void 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 
    3337void HWDeviceRegistration::parseElement(TiXmlElement *elem) 
    3438{ 
     
    5155} 
    5256 
    53 ChildHWDevice* HWDeviceRegistration::parseChildHWDevice(TiXmlElement *elem) 
     57ChildHWDevice::ChildHWDevice(TiXmlElement *elem):DevicePkgRef(elem->FirstChildElement("devicepkgref")),HWDeviceRegistration(elem->FirstChildElement("hwdeviceregistration")) 
    5458{ 
    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; 
    6160} 
    6261 
  • ossiedev/branches/mcarrick/DPD/HWDeviceRegistration.h

    r8679 r8685  
    3434        protected: 
    3535                void parseElement(TiXmlElement *elem); 
    36                 ChildHWDevice* parseChildHWDevice(TiXmlElement *elem); 
     36                void constructChildHWDevice(TiXmlElement *elem); 
    3737 
    3838        private: 
     
    5151}; 
    5252 
    53 class ChildHWDevice:public DevicePkgRef 
     53class ChildHWDevice:public DevicePkgRef, public HWDeviceRegistration 
    5454{ 
    5555        public: 
     
    5757                ~ChildHWDevice(); 
    5858 
    59                 //HWDeviceRegistration getHWDeviceRegistration(); 
     59        //      HWDeviceRegistration getHWDeviceRegistration(); 
    6060 
    6161        protected: 
     
    6666                ChildHWDevice(const ChildHWDevice& aChildHWDevice); // no copying 
    6767 
    68                 //HWDeviceRegistration hwDeviceReg(TiXmlElement *elem); 
    69                 //void parseHWDeviceRegistration(TiXmlElement *elem); 
     68        //      HWDeviceRegistration hwDeviceReg(TiXmlElement *elem); 
     69        //      void parseHWDeviceRegistration(TiXmlElement *elem); 
    7070 
    7171}; 
  • ossiedev/branches/mcarrick/DPD/testApp.cpp

    r8681 r8685  
    1 //#include "DeviceClass.h" 
    21#include "DevicePkgRef.h" 
    3 //#include "PropertyFile.h" 
    42#include "HWDeviceRegistration.h" 
    53//#include "DevicePkg.h" 
     
    7573                std::cout << std::endl << std::endl; 
    7674 
    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; 
    8583 
    8684                for (int i = 0; i < parse.getDeviceClass().size(); i++) 
    8785                { 
    88                         std::cout << "                  <class>" << parse.getDeviceClass()[i] << "</class>" << std::endl; 
     86                        std::cout << "          <class>" << parse.getDeviceClass()[i] << "</class>" << std::endl; 
    8987                } 
    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; 
    91107                std::cout << "</hwdeviceregistration>" << std::endl; 
     108 
    92109 
    93110                std::cout << std::endl << std::endl; 
     
    117134                std::cout << "********************" << std::endl; 
    118135                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; 
    121138                std::cout << "********************" << std::endl; 
    122139