Changeset 8699

Show
Ignore:
Timestamp:
02/16/09 15:29:09 (4 years ago)
Author:
mcarrick
Message:

reducing ambiguity in member functions, cleaning up calls

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

Legend:

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

    r8691 r8699  
    1212DeviceClass::~DeviceClass() 
    1313{ 
    14         std::cout << "dev class deconstruct ... " << std::endl; 
    1514} 
    1615 
  • ossiedev/branches/mcarrick/DPD/DeviceClass.h

    r8679 r8699  
    1515                DeviceClass(TiXmlElement *elem); 
    1616                ~DeviceClass(); 
     17 
    1718                std::vector <std::string> getDeviceClass(); 
    1819 
  • ossiedev/branches/mcarrick/DPD/DevicePkg.cpp

    r8697 r8699  
    1212DevicePkg::~DevicePkg() 
    1313{ 
    14         std::cout << "dev pkg deconstruct ... " << std::endl; 
    1514} 
    1615 
     
    2019 
    2120        // get attributes from devicepkg 
     21        parseAttributes(elem); 
     22 
     23        // parse info from author, title and description tags 
     24        parseChildElements(elem); 
     25} 
     26 
     27void DevicePkg::parseAttributes(TiXmlElement *elem) 
     28{ 
    2229        id = elem->Attribute("id"); 
    2330        name = elem->Attribute("name"); 
    2431        version = elem->Attribute("version"); 
     32} 
    2533 
    26         // parse info from author, title and description tags 
     34void DevicePkg::parseChildElements(TiXmlElement *elem) 
     35{ 
    2736        TiXmlElement *auth = elem->FirstChildElement("author"); 
    2837        author = auth->GetText(); 
     
    3342        TiXmlElement *descrip = elem->FirstChildElement("description"); 
    3443        description = descrip->GetText(); 
    35  
    3644} 
    3745 
    38 std::string DevicePkg::getIDDevPkg() 
     46std::string DevicePkg::getDevPkgID() 
    3947{ 
    4048        return id; 
    4149} 
    4250 
    43 std::string DevicePkg::getNameDevPkg() 
     51std::string DevicePkg::getDevPkgName() 
    4452{ 
    4553        return name; 
    4654} 
    4755 
    48 std::string DevicePkg::getVersionDevPkg() 
     56std::string DevicePkg::getDevPkgVersion() 
    4957{ 
    5058        return version; 
    5159} 
    5260 
    53 std::string DevicePkg::getTitle() 
     61std::string DevicePkg::getDevPkgTitle() 
    5462{ 
    5563        return title; 
    5664} 
    5765 
    58 std::string DevicePkg::getAuthor() 
     66std::string DevicePkg::getDevPkgAuthor() 
    5967{ 
    6068        return author; 
    6169} 
    6270 
    63 std::string DevicePkg::getDescription() 
     71std::string DevicePkg::getDevPkgDescription() 
    6472{ 
    6573        return description; 
  • ossiedev/branches/mcarrick/DPD/DevicePkg.h

    r8697 r8699  
    1818                ~DevicePkg(); 
    1919 
    20                 std::string getIDDevPkg(); 
    21                 std::string getNameDevPkg(); 
    22                 std::string getVersionDevPkg(); 
     20                std::string getDevPkgID(); 
     21                std::string getDevPkgName(); 
     22                std::string getDevPkgVersion(); 
    2323 
    24                 std::string getTitle(); 
    25                 std::string getAuthor(); 
    26                 std::string getDescription(); 
     24                std::string getDevPkgTitle(); 
     25                std::string getDevPkgAuthor(); 
     26                std::string getDevPkgDescription(); 
    2727 
    2828        protected: 
    2929                void parseElement(TiXmlElement *elem); 
     30                void parseAttributes(TiXmlElement *elem); 
     31                void parseChildElements(TiXmlElement *elem); 
    3032 
    3133        private: 
  • ossiedev/branches/mcarrick/DPD/HWDeviceRegistration.cpp

    r8697 r8699  
    1616HWDeviceRegistration::~HWDeviceRegistration() 
    1717{ 
    18 /* 
    19         std::cout << "hw device reg deconstruct ... " << std::endl; 
    20  
    21         for (int i = 0; i < childHWDevices.size(); i++) 
    22         { 
    23                 std::cout << "i: " << i << std::endl; 
    24                 delete [] childHWDevices[i]; 
    25                 std::cout << "deleted, i: " << i << std::endl; 
    26         } 
    27         std::cout << "exiting hwdev deconstruct ... " << std::endl; 
    28 */ 
    2918} 
    3019 
     
    6453} 
    6554 
    66 ChildHWDevice::ChildHWDevice(TiXmlElement *elem):DevicePkgRef(elem->FirstChildElement("devicepkgref")),HWDeviceRegistration(elem->FirstChildElement("hwdeviceregistration")) 
     55ChildHWDevice::ChildHWDevice(TiXmlElement *elem):DevicePkgRef(elem->FirstChildElement("devicepkgref")) 
    6756{ 
    6857} 
     
    7059ChildHWDevice::~ChildHWDevice() 
    7160{ 
    72         std::cout << "child hw dev deconstruct ... " << std::endl; 
    7361} 
    7462 
     
    7866} 
    7967 
    80 std::string HWDeviceRegistration::getIDHWDevReg() 
     68std::string HWDeviceRegistration::getHWDevRegID() 
    8169{ 
    8270        return id; 
    8371} 
    8472 
    85 std::string HWDeviceRegistration::getVersionHWDevReg() 
     73std::string HWDeviceRegistration::getHWDevRegVersion() 
    8674{ 
    8775        return version; 
    8876} 
    8977 
    90 std::string HWDeviceRegistration::getNameHWDevReg() 
     78std::string HWDeviceRegistration::getHWDevRegName() 
    9179{ 
    9280        return name; 
    9381} 
    9482 
    95 std::string HWDeviceRegistration::getDescription() 
     83std::string HWDeviceRegistration::getHWDevRegDescription() 
    9684{ 
    9785        return description; 
    9886} 
    9987 
    100 std::string HWDeviceRegistration::getManufacturer() 
     88std::string HWDeviceRegistration::getHWDevRegManufacturer() 
    10189{ 
    10290        return manufacturer; 
    10391} 
    10492 
    105 std::string HWDeviceRegistration::getModelNumber() 
     93std::string HWDeviceRegistration::getHWDevRegModelNumber() 
    10694{ 
    10795        return modelnumber; 
     
    115103 
    116104 
    117  
  • ossiedev/branches/mcarrick/DPD/HWDeviceRegistration.h

    r8697 r8699  
    2323                ~HWDeviceRegistration(); 
    2424 
    25                 std::string getIDHWDevReg(); 
    26                 std::string getVersionHWDevReg(); 
    27                 std::string getNameHWDevReg(); 
    28                 std::string getDescription(); 
    29                 std::string getManufacturer(); 
    30                 std::string getModelNumber(); 
     25                std::string getHWDevRegID(); 
     26                std::string getHWDevRegVersion(); 
     27                std::string getHWDevRegName(); 
     28                std::string getHWDevRegDescription(); 
     29                std::string getHWDevRegManufacturer(); 
     30                std::string getHWDevRegModelNumber(); 
    3131 
    3232                std::vector <ChildHWDevice*> getChildHWDevice(); 
     
    5757                ~ChildHWDevice(); 
    5858 
    59         //      HWDeviceRegistration getHWDeviceRegistration(); 
     59                HWDeviceRegistration getHWDeviceRegistration(); 
    6060 
    6161        protected: 
  • ossiedev/branches/mcarrick/DPD/PropertyFile.cpp

    r8691 r8699  
    1212PropertyFile::~PropertyFile() 
    1313{ 
    14         std::cout << "prop file deconstruct ... " << std::endl; 
    1514} 
    1615 
     
    1918        std::cout << "DEBUG: parsing property file..." << std::endl; 
    2019 
    21         type = elem->Attribute("type"); // get type from propertyfile tag 
    22  
    23         TiXmlElement *local = elem->FirstChildElement("localfile"); // get link to localfile tag 
    24         localfile = local->Attribute("name"); // store path 
     20        parseAttributes(elem); // get type from propertyfile tag 
     21        parseChildElements(elem); // parse localfile tag 
    2522} 
    2623 
    27 std::string PropertyFile::getTypePropFile() 
     24void PropertyFile::parseAttributes(TiXmlElement *elem) 
     25{ 
     26        type = elem->Attribute("type"); 
     27} 
     28 
     29void PropertyFile::parseChildElements(TiXmlElement *elem) 
     30{ 
     31        TiXmlElement *local = elem->FirstChildElement("localfile"); 
     32        localfile = local->Attribute("name"); 
     33} 
     34 
     35std::string PropertyFile::getPropFileType() 
    2836{ 
    2937        return type; 
    3038} 
    3139 
    32 std::string PropertyFile::getLocalFilePropFile() 
     40std::string PropertyFile::getPropFileLocalFile() 
    3341{ 
    3442        return localfile; 
  • ossiedev/branches/mcarrick/DPD/PropertyFile.h

    r8686 r8699  
    1515                PropertyFile(TiXmlElement *elem); 
    1616                ~PropertyFile(); 
    17                 std::string getTypePropFile(); 
    18                 std::string getLocalFilePropFile(); 
     17                std::string getPropFileType(); 
     18                std::string getPropFileLocalFile(); 
    1919 
    2020        protected: 
    2121                void parseElement(TiXmlElement *elem); 
     22                void parseAttributes(TiXmlElement *elem); 
     23                void parseChildElements(TiXmlElement *elem); 
    2224 
    2325        private: 
  • ossiedev/branches/mcarrick/DPD/testApp.cpp

    r8697 r8699  
    4242                DevicePkg parse(devpkg); 
    4343 
    44  
     44                // print xml tags ... 
    4545                std::cout << "******************************" << std::endl; 
    4646                std::cout << "DevicePkg: " << std::endl; 
    47                 std::cout << "<devicepkg id=" << parse.getIDDevPkg() << " version=" << parse.getVersionDevPkg() << " name=" << parse.getNameDevPkg() << ">" << std::endl; 
    48                 std::cout << "  <title>" << parse.getTitle() << "</title>" << std::endl; 
    49                 std::cout << "  <author>" << parse.getAuthor() << "</author>" << std::endl; 
    50                 std::cout << "  <description>" << parse.getDescription() << "</description>" << std::endl; 
    51                 std::cout << "          <hwdeviceregistration id=" << parse.getIDHWDevReg() << std::endl; 
     47                std::cout << "<devicepkg id=" << parse.getDevPkgID() << " version=" << parse.getDevPkgVersion() << " name=" << parse.getDevPkgName() << ">" << std::endl; 
     48                std::cout << "  <title>" << parse.getDevPkgTitle() << "</title>" << std::endl; 
     49                std::cout << "  <author>" << parse.getDevPkgAuthor() << "</author>" << std::endl; 
     50                std::cout << "  <description>" << parse.getDevPkgDescription() << "</description>" << std::endl; 
     51                std::cout << "          <hwdeviceregistration id=" << parse.getHWDevRegID() << " version=" << parse.getHWDevRegVersion(); 
     52                        std::cout << " name=" << parse.getHWDevRegName() << ">" << std::endl; 
     53                std::cout << "                  <propertyfile type=" << parse.getPropFileType() << ">" << std::endl; 
     54                std::cout << "                          <localfile name=" << parse.getPropFileLocalFile() << "/>" << std::endl; 
     55                std::cout << "                  </propertyfile>" << std::endl; 
     56                std::cout << "                  <description>" << parse.getHWDevRegDescription() << "</description>" << std::endl; 
     57                std::cout << "                  <manufacturer>" << parse.getHWDevRegManufacturer() << "</manufacturer>" << std::endl; 
     58                std::cout << "                  <modelnumber>" << parse.getHWDevRegModelNumber() << "</modelnumber>" << std::endl; 
     59                std::cout << "                  <deviceclass>" << std::endl; 
     60                for (int i = 0; i < parse.getDeviceClass().size(); i++) 
     61                { 
     62                std::cout << "                          <class>" << parse.getDeviceClass()[i] << "</class>" << std::endl; 
     63                } 
     64                std::cout << "                  </deviceclass>" << std::endl; 
     65 
     66 
    5267                std::cout << "</devicepkg>" << std::endl; 
    5368        } 
     
    7388 
    7489                PropertyFile parse(propFile); 
    75  
    76                 std::cout << "******************" << std::endl; 
    77                 std::cout << "PropertyFile: " << std::endl; 
    78                 std::cout << "Type: " << parse.getTypePropFile() << std::endl; 
    79                 std::cout << "Localfile: " << parse.getLocalFilePropFile() << std::endl; 
    80                 std::cout << "******************" << std::endl; 
    8190        } 
    8291        else 
     
    101110 
    102111                HWDeviceRegistration parse(devReg); 
    103  
    104                 std::cout << std::endl << std::endl; 
    105  
    106                 std::cout << "<hwdeviceregistration id=" << parse.getIDHWDevReg() << " version=" << parse.getVersionHWDevReg(); 
    107                         std::cout << " name=" << parse.getNameHWDevReg() << ">" << std::endl; 
    108                 std::cout << "  <propertyfile type=" << parse.getTypePropFile() << ">" << std::endl; 
    109                 std::cout << "          <localfile name=" << parse.getLocalFilePropFile() << ">" << std::endl; 
    110                 std::cout << "  </propertyfile>" << std::endl; 
    111                 std::cout << "  <description>" << parse.getDescription() << "</description" << std::endl; 
    112                 std::cout << "  <manufacturer>" << parse.getManufacturer() << "</manufacturer>" << std::endl; 
    113                 std::cout << "  <modelnumber>" << parse.getModelNumber() << "</modelnumber>" << std::endl; 
    114                 std::cout << "  <deviceclass>" << std::endl; 
    115  
    116                 for (int i = 0; i < parse.getDeviceClass().size(); i++) 
    117                 { 
    118                         std::cout << "          <class>" << parse.getDeviceClass()[i] << "</class>" << std::endl; 
    119                 } 
    120                 std::cout << "  </deviceclass>" << std::endl; 
    121  
    122                 std::cout << "  <childhwdevice>" << std::endl; 
    123                 std::cout << "          <hwdeviceregistration id=" << parse.getChildHWDevice()[0]->getIDHWDevReg(); 
    124                         std::cout << " version=" << parse.getChildHWDevice()[0]->getVersionHWDevReg(); 
    125                         std::cout << " name=" << parse.getChildHWDevice()[0]->getNameHWDevReg() << " >" << std::endl; 
    126                 std::cout << "                  <propertyfile " << parse.getChildHWDevice()[0]->getTypePropFile() << "> " << std::endl; 
    127                 std::cout << "                          <localfile name=" << parse.getChildHWDevice()[0]->getLocalFilePropFile() << "/> " << std::endl; 
    128                 std::cout << "                  </propertyfile>" << std::endl; 
    129                 std::cout << "                  <description>" << parse.getChildHWDevice()[0]->getDescription() << "</description>" << std::endl; 
    130                 std::cout << "                  <manufacturer>" << parse.getChildHWDevice()[0]->getManufacturer() << "</manufacturer>" << std::endl; 
    131                 std::cout << "                  <modelnumber>" << parse.getChildHWDevice()[0]->getModelNumber() << "</modelnumber>" << std::endl; 
    132                 std::cout << "                  <deviceclass>" << std::endl; 
    133                 std::cout << "                          <class>" << parse.getChildHWDevice()[0]->getDeviceClass()[0] << "</class>" << std::endl; 
    134                 std::cout << "                  </deviceclass>" << std::endl; 
    135                 std::cout << "                  <childhwdevice>" << std::endl; 
    136                 std::cout << "                          <hwdeviceregistration id="; 
    137                         std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getIDHWDevReg();  
    138                         std::cout << " version=" << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getVersionHWDevReg(); 
    139                         std::cout << " name=" << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getNameHWDevReg() << ">" << std::endl; 
    140                 std::cout << "                                  <propertyfile type="; 
    141                         std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getTypePropFile() << ">" << std::endl; 
    142                 std::cout << "                                          <localfile name="; 
    143                         std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getLocalFilePropFile() << "/>" << std::endl; 
    144                         std::cout << "                                  </propertyfile>" << std::endl; 
    145                 std::cout << "                                  <description>"; 
    146                         std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getDescription(); 
    147                         std::cout << "</description>" << std::endl; 
    148                 std::cout << "                                  <manufacturer>"; 
    149                         std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getManufacturer(); 
    150                         std::cout << "</manufacturer>" << std::endl; 
    151                 std::cout << "                                  <modelnumber>"; 
    152                         std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getModelNumber(); 
    153                         std::cout << "</modelnumber>" << std::endl; 
    154                 std::cout << "                                  <deviceclass>" << std::endl; 
    155                         std::cout << "                                          <class>"; 
    156                         std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getDeviceClass()[0]; 
    157                         std::cout << "</class>" << std::endl; 
    158                         std::cout << "                                  </deviceclass>" << std::endl; 
    159                 std::cout << "                          </hwdeviceregistration>" << std::endl; 
    160                 std::cout << "                          <devicepkgref name=" << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getTypeDevPkgRef(); 
    161                         std::cout << std::endl; 
    162                 std::cout << "                                  <localfile name="; 
    163                         std::cout << parse.getChildHWDevice()[0]->getChildHWDevice()[0]->getLocalFileDevPkgRef() << "/>" << std::endl; 
    164                         std::cout << "                          </devicepkgref>" << std::endl; 
    165                 std::cout << "                  </childhwdevice>" << std::endl; 
    166                 std::cout << "          </hwdeviceregistration>" << std::endl; 
    167                 std::cout << "          <devicepkgref>" << std::endl; 
    168                 std::cout << "                  <localfile name=" << parse.getChildHWDevice()[0]->getLocalFileDevPkgRef() << "/>" << std::endl; 
    169                 std::cout << "          </devicepkgref>" << std::endl; 
    170                 std::cout << "  </childhwdevice>" << std::endl; 
    171  
    172  
    173                 std::cout << "  <childhwdevice>" << std::endl; 
    174                 std::cout << "          <hwdeviceregistration id=" << parse.getChildHWDevice()[1]->getIDHWDevReg(); 
    175                         std::cout << " version=" << parse.getChildHWDevice()[1]->getVersionHWDevReg(); 
    176                         std::cout << " name=" << parse.getChildHWDevice()[1]->getNameHWDevReg() << ">" << std::endl; 
    177                 std::cout << "                  <propertyfile type=" << parse.getChildHWDevice()[1]->getTypePropFile() << ">" << std::endl; 
    178                 std::cout << "                          <localfile name=" << parse.getChildHWDevice()[1]->getLocalFilePropFile() << "/>" << std::endl; 
    179                 std::cout << "                  </propertyfile>" << std::endl; 
    180                 std::cout << "                  <description>" << parse.getChildHWDevice()[1]->getDescription() << "</description>" << std::endl; 
    181                 std::cout << "                  <manufacturer>" << parse.getChildHWDevice()[1]->getManufacturer() << "</manufacturer>" << std::endl; 
    182                 std::cout << "                  <modelnumber>" << parse.getChildHWDevice()[1]->getModelNumber() << "</modelnumber>" << std::endl; 
    183                 std::cout << "                  <deviceclass>" << std::endl; 
    184                 std::cout << "                          <class>" << parse.getChildHWDevice()[1]->getDeviceClass()[0] << "</class>" << std::endl; 
    185                 std::cout << "                          <class>" << parse.getChildHWDevice()[1]->getDeviceClass()[1] << "</class>" << std::endl; 
    186                 std::cout << "                  </deviceclass>" << std::endl; 
    187                 std::cout << "          </hwdeviceregistration>" << std::endl; 
    188                 std::cout << "          <devicepkgref type=" << parse.getChildHWDevice()[1]->getTypeDevPkgRef() << ">" << std::endl; 
    189                 std::cout << "                  <localfile name=" << parse.getChildHWDevice()[1]->getLocalFileDevPkgRef() << "/>" << std::endl; 
    190                 std::cout << "          </devicepkgref>" << std::endl; 
    191  
    192  
    193  
    194                 std::cout << "</hwdeviceregistration>" << std::endl; 
    195  
    196112 
    197113                std::cout << std::endl << std::endl;