Changeset 372

Show
Ignore:
Timestamp:
01/07/07 07:08:53 (16 years ago)
Author:
wagi
Message:

AvPlug::serialize: finished implementation (untested yet)
AvPlug::deserialize: likewise
AvPlug::deserializeUpdate: new function. second stage of deserializing
IODeserialize::isExisting: new function

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libfreebob/src/bebob/bebob_avdevice.cpp

    r371 r372  
    12731273} 
    12741274 
     1275static bool 
     1276deserializeUpdatePlugs( Glib::ustring basePath, 
     1277                        Util::IODeserialize& deser, 
     1278                        AvPlugVector& vec ) 
     1279{ 
     1280    bool result = true; 
     1281    for ( AvPlugVector::iterator it = vec.begin(); 
     1282          it != vec.end(); 
     1283          ++it ) 
     1284    { 
     1285        AvPlug* pPlug = *it; 
     1286        result &= pPlug->deserializeUpdate( basePath, deser ); 
     1287    } 
     1288    return result; 
     1289} 
     1290 
    12751291bool 
    12761292AvDevice::serialize( Glib::ustring basePath, Util::IOSerialize& ser ) 
     
    12871303    return result; 
    12881304} 
    1289  
    12901305 
    12911306AvDevice* 
     
    13111326        result &= deserializeVector<AvPlug>( basePath + "PCRPlug", deser, ieee1394Service, *pDev->m_pConfigRom.get(), pDev->m_plugManager, pDev->m_pcrPlugs ); 
    13121327        result &= deserializeVector<AvPlug>( basePath + "ExternalPlug", deser, ieee1394Service, *pDev->m_pConfigRom.get(), pDev->m_plugManager, pDev->m_externalPlugs ); 
     1328        result &= deserializeUpdatePlugs( basePath + "PCRPlug", deser, pDev->m_pcrPlugs ); 
     1329        result &= deserializeUpdatePlugs( basePath + "ExternalPlug", deser, pDev->m_externalPlugs ); 
     1330 
    13131331 
    13141332        // XXX ... 
  • trunk/libfreebob/src/bebob/bebob_avdevice.h

    r371 r372  
    147147protected: 
    148148    std::auto_ptr<ConfigRom>( m_pConfigRom ); 
    149     Ieee1394Service* m_1394Service; 
    150     int              m_verboseLevel; 
    151  
    152     AvPlugVector     m_pcrPlugs; 
    153     AvPlugVector     m_externalPlugs; 
    154  
    155     AvPlugConnectionVector m_plugConnections; 
    156  
    157     AvDeviceSubunitVector  m_subunits; 
    158  
    159     AvPlugManager    m_plugManager; 
    160  
    161     SyncInfoVector   m_syncInfos; 
    162     SyncInfo*        m_activeSyncInfo; 
    163  
    164     unsigned int m_id; 
     149    Ieee1394Service*          m_1394Service; 
     150    int                       m_verboseLevel; 
     151    AvPlugVector              m_pcrPlugs; 
     152    AvPlugVector              m_externalPlugs; 
     153    AvPlugConnectionVector    m_plugConnections; 
     154    AvDeviceSubunitVector     m_subunits; 
     155    AvPlugManager             m_plugManager; 
     156    SyncInfoVector            m_syncInfos; 
     157    SyncInfo*                 m_activeSyncInfo; 
     158    unsigned int              m_id; 
    165159 
    166160    // streaming stuff 
  • trunk/libfreebob/src/bebob/bebob_avplug.cpp

    r371 r372  
    2424#include "libfreebobavc/ieee1394service.h" 
    2525#include "libfreebobavc/avc_serialize.h" 
     26 
     27#include <sstream> 
    2628 
    2729namespace BeBoB { 
     
    14321434 
    14331435bool 
    1434 AvPlug::serialize( Glib::ustring basePath, Util::IOSerialize& ser ) 
     1436AvPlug::serializeChannelInfos( Glib::ustring basePath, 
     1437                               Util::IOSerialize& ser, 
     1438                               const ClusterInfo& clusterInfo ) const 
     1439
     1440    bool result = true; 
     1441    int i = 0; 
     1442    for ( ChannelInfoVector::const_iterator it = clusterInfo.m_channelInfos.begin(); 
     1443          it != clusterInfo.m_channelInfos.end(); 
     1444          ++it ) 
     1445    { 
     1446        const ChannelInfo& info = *it; 
     1447        std::ostringstream strstrm; 
     1448        strstrm << basePath << i; 
     1449 
     1450        result &= ser.write( strstrm.str() + "/m_streamPosition", info.m_streamPosition ); 
     1451        result &= ser.write( strstrm.str() + "/m_location", info.m_location ); 
     1452        result &= ser.write( strstrm.str() + "/m_name", info.m_name ); 
     1453    } 
     1454 
     1455    return result; 
     1456
     1457 
     1458bool 
     1459AvPlug::deserializeChannelInfos( Glib::ustring basePath, 
     1460                                 Util::IODeserialize& deser, 
     1461                                 ClusterInfo& clusterInfo ) 
     1462
     1463    int i = 0; 
     1464    bool bFinished = false; 
     1465    bool result = true; 
     1466    do { 
     1467        std::ostringstream strstrm; 
     1468        strstrm << basePath << i; 
     1469 
     1470        // check for one element to exist. when one exist the other elements 
     1471        // must also be there. otherwise just return (last) result. 
     1472        if ( deser.isExisting( strstrm.str() + "/m_streamPosition" ) ) { 
     1473            ChannelInfo info; 
     1474 
     1475            result &= deser.read( strstrm.str() + "/m_streamPosition", info.m_streamPosition ); 
     1476            result &= deser.read( strstrm.str() + "/m_location", info.m_location ); 
     1477            result &= deser.read( strstrm.str() + "/m_name", info.m_name ); 
     1478 
     1479            if ( result ) { 
     1480                clusterInfo.m_channelInfos.push_back( info ); 
     1481                i++; 
     1482            } else { 
     1483                bFinished = true; 
     1484            } 
     1485        } else { 
     1486            bFinished = true; 
     1487        } 
     1488    } while ( !bFinished ); 
     1489 
     1490    return result; 
     1491
     1492 
     1493 
     1494bool 
     1495AvPlug::serializeClusterInfos( Glib::ustring basePath, 
     1496                               Util::IOSerialize& ser ) const 
     1497
     1498    bool result = true; 
     1499    int i = 0; 
     1500    for ( ClusterInfoVector::const_iterator it = m_clusterInfos.begin(); 
     1501          it != m_clusterInfos.end(); 
     1502          ++it ) 
     1503    { 
     1504        const ClusterInfo& info = *it; 
     1505        std::ostringstream strstrm; 
     1506        strstrm << basePath << i; 
     1507 
     1508        result &= ser.write( strstrm.str() + "/m_index", info.m_index ); 
     1509        result &= ser.write( strstrm.str() + "/m_portType", info.m_portType ); 
     1510        result &= ser.write( strstrm.str() + "/m_name", info.m_name ); 
     1511        result &= ser.write( strstrm.str() + "/m_nrOfChannels", info.m_nrOfChannels ); 
     1512        result &= serializeChannelInfos( strstrm.str() + "/m_channelInfo", ser, info ); 
     1513        result &= ser.write( strstrm.str() + "/m_streamFormat", info.m_streamFormat ); 
     1514 
     1515    } 
     1516 
     1517    return result; 
     1518
     1519 
     1520bool 
     1521AvPlug::deserializeClusterInfos( Glib::ustring basePath, 
     1522                                 Util::IODeserialize& deser ) 
     1523
     1524    int i = 0; 
     1525    bool bFinished = false; 
     1526    bool result = true; 
     1527    do { 
     1528        std::ostringstream strstrm; 
     1529        strstrm << basePath << i; 
     1530 
     1531        // check for one element to exist. when one exist the other elements 
     1532        // must also be there. otherwise just return (last) result. 
     1533        if ( deser.isExisting( strstrm.str() + "/m_index" ) ) { 
     1534            ClusterInfo info; 
     1535 
     1536            result &= deser.read( strstrm.str() + "/m_index", info.m_index ); 
     1537            result &= deser.read( strstrm.str() + "/m_portType", info.m_portType ); 
     1538            result &= deser.read( strstrm.str() + "/m_name", info.m_name ); 
     1539            result &= deser.read( strstrm.str() + "/m_nrOfChannels", info.m_nrOfChannels ); 
     1540            result &= deserializeChannelInfos( strstrm.str() + "/m_channelInfo", deser, info ); 
     1541            result &= deser.read( strstrm.str() + "/m_streamFormat", info.m_streamFormat ); 
     1542 
     1543            if ( result ) { 
     1544                m_clusterInfos.push_back( info ); 
     1545                i++; 
     1546            } else { 
     1547                bFinished = true; 
     1548            } 
     1549        } else { 
     1550            bFinished = true; 
     1551        } 
     1552    } while ( !bFinished ); 
     1553 
     1554    return result; 
     1555
     1556 
     1557 
     1558bool 
     1559AvPlug::serializeFormatInfos( Glib::ustring basePath, 
     1560                              Util::IOSerialize& ser ) const 
     1561
     1562    bool result = true; 
     1563    int i = 0; 
     1564    for ( FormatInfoVector::const_iterator it = m_formatInfos.begin(); 
     1565          it != m_formatInfos.end(); 
     1566          ++it ) 
     1567    { 
     1568        const FormatInfo& info = *it; 
     1569        std::ostringstream strstrm; 
     1570        strstrm << basePath << i; 
     1571 
     1572        result &= ser.write( strstrm.str() + "/m_samplingFrequency", info.m_samplingFrequency ); 
     1573        result &= ser.write( strstrm.str() + "/m_isSyncStream", info.m_isSyncStream ); 
     1574        result &= ser.write( strstrm.str() + "/m_audioChannels", info.m_audioChannels ); 
     1575        result &= ser.write( strstrm.str() + "/m_midiChannels", info.m_midiChannels ); 
     1576        result &= ser.write( strstrm.str() + "/m_index", info.m_index ); 
     1577    } 
     1578    return result; 
     1579
     1580 
     1581bool 
     1582AvPlug::deserializeFormatInfos( Glib::ustring basePath, 
     1583                                Util::IODeserialize& deser ) 
     1584
     1585    int i = 0; 
     1586    bool bFinished = false; 
     1587    bool result = true; 
     1588    do { 
     1589        std::ostringstream strstrm; 
     1590        strstrm << basePath << i; 
     1591 
     1592        // check for one element to exist. when one exist the other elements 
     1593        // must also be there. otherwise just return (last) result. 
     1594        if ( deser.isExisting( strstrm.str() + "/m_samplingFrequency" ) ) { 
     1595            FormatInfo info; 
     1596 
     1597            result &= deser.read( strstrm.str() + "/m_samplingFrequency", info.m_samplingFrequency ); 
     1598            result &= deser.read( strstrm.str() + "/m_isSyncStream", info.m_isSyncStream ); 
     1599            result &= deser.read( strstrm.str() + "/m_audioChannels", info.m_audioChannels ); 
     1600            result &= deser.read( strstrm.str() + "/m_midiChannels", info.m_midiChannels ); 
     1601            result &= deser.read( strstrm.str() + "/m_index", info.m_index ); 
     1602 
     1603            if ( result ) { 
     1604                m_formatInfos.push_back( info ); 
     1605                i++; 
     1606            } else { 
     1607                bFinished = true; 
     1608            } 
     1609        } else { 
     1610            bFinished = true; 
     1611        } 
     1612    } while ( !bFinished ); 
     1613 
     1614    return result; 
     1615
     1616 
     1617 
     1618bool 
     1619AvPlug::serializeAvPlugVector( Glib::ustring basePath, 
     1620                               Util::IOSerialize& ser, 
     1621                               const AvPlugVector& vec) const 
     1622
     1623    bool result = true; 
     1624    int i = 0; 
     1625    for ( AvPlugVector::const_iterator it = vec.begin(); 
     1626          it != vec.end(); 
     1627          ++it ) 
     1628    { 
     1629        const AvPlug* pPlug = *it; 
     1630        std::ostringstream strstrm; 
     1631        strstrm << basePath << i; 
     1632 
     1633        result &= ser.write( strstrm.str() + "/global_id", pPlug->getGlobalId() ); 
     1634    } 
     1635    return result; 
     1636
     1637 
     1638bool 
     1639AvPlug::deserializeAvPlugVector( Glib::ustring basePath, 
     1640                                 Util::IODeserialize& deser, 
     1641                                 AvPlugVector& vec ) 
     1642
     1643    int i = 0; 
     1644    bool bFinished = false; 
     1645    bool result = true; 
     1646    do { 
     1647        std::ostringstream strstrm; 
     1648        strstrm << basePath << i; 
     1649 
     1650        // check for one element to exist. when one exist the other elements 
     1651        // must also be there. otherwise just return (last) result. 
     1652        if ( deser.isExisting( strstrm.str() + "/global_id" ) ) { 
     1653            unsigned int iPlugId; 
     1654            result &= deser.read( strstrm.str() + "/global_id", iPlugId ); 
     1655 
     1656            if ( result ) { 
     1657                AvPlug* pPlug = m_plugManager->getPlug( iPlugId ); 
     1658                if ( pPlug ) { 
     1659                    vec.push_back( pPlug ); 
     1660                } else { 
     1661                    result = false; 
     1662                    bFinished = true; 
     1663                } 
     1664                i++; 
     1665            } else { 
     1666                bFinished = true; 
     1667            } 
     1668        } else { 
     1669            bFinished = true; 
     1670        } 
     1671    } while ( !bFinished ); 
     1672 
     1673    return result; 
     1674
     1675 
     1676bool 
     1677AvPlug::serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const 
    14351678{ 
    14361679    bool result; 
    14371680    result  = ser.write( basePath + "m_subunitType", m_subunitType ); 
    14381681    result &= ser.write( basePath + "m_subunitId", m_subunitId ); 
    1439     /// XXX ... 
     1682    result &= ser.write( basePath + "m_functionBlockType", m_functionBlockType); 
     1683    result &= ser.write( basePath + "m_functionBlockId", m_functionBlockId); 
     1684    result &= ser.write( basePath + "m_addressType", m_addressType ); 
     1685    result &= ser.write( basePath + "m_direction", m_direction); 
     1686    result &= ser.write( basePath + "m_id", m_id); 
     1687    result &= ser.write( basePath + "m_infoPlugType", m_infoPlugType); 
     1688    result &= ser.write( basePath + "m_nrOfChannels", m_nrOfChannels); 
     1689    result &= ser.write( basePath + "m_name", m_name); 
     1690    result &= serializeClusterInfos( basePath + "m_clusterInfos", ser ); 
     1691    result &= ser.write( basePath + "m_samplingFrequency", m_samplingFrequency); 
     1692    result &= serializeFormatInfos( basePath + "m_formatInfo", ser ); 
     1693    result &= serializeAvPlugVector( basePath + "m_inputConnections", ser, m_inputConnections ); 
     1694    result &= serializeAvPlugVector( basePath + "m_outputConnections", ser, m_outputConnections ); 
     1695    result &= ser.write( basePath + "m_verboseLevel", m_verboseLevel); 
     1696    result &= ser.write( basePath + "m_globalId", m_globalId); 
     1697    result &= ser.write( basePath + "m_globalIdCounter", m_globalIdCounter ); 
    14401698 
    14411699    return result; 
     
    14601718    result  = deser.read( basePath + "m_subunitType", pPlug->m_subunitType ); 
    14611719    result &= deser.read( basePath + "m_subunitId", pPlug->m_subunitId ); 
    1462     // XXX ... 
     1720    result &= deser.read( basePath + "m_functionBlockType", pPlug->m_functionBlockType ); 
     1721    result &= deser.read( basePath + "m_functionBlockId", pPlug->m_functionBlockId ); 
     1722    result &= deser.read( basePath + "m_addressType", pPlug->m_addressType ); 
     1723    result &= deser.read( basePath + "m_direction", pPlug->m_direction ); 
     1724    result &= deser.read( basePath + "m_id", pPlug->m_id ); 
     1725    result &= deser.read( basePath + "m_infoPlugType", pPlug->m_infoPlugType ); 
     1726    result &= deser.read( basePath + "m_nrOfChannels", pPlug->m_nrOfChannels ); 
     1727    result &= deser.read( basePath + "m_name", pPlug->m_name ); 
     1728    result &= pPlug->deserializeClusterInfos( basePath + "m_clusterInfos", deser ); 
     1729    result &= deser.read( basePath + "m_samplingFrequency", pPlug->m_samplingFrequency ); 
     1730    result &= pPlug->deserializeFormatInfos( basePath + "m_formatInfos", deser ); 
     1731    // input and output connections can't be processed here because not all plugs might 
     1732    // deserialized at this point. so we do that in deserializeUpdate. 
     1733    result &= deser.read( basePath + "m_verboseLevel", pPlug->m_verboseLevel ); 
     1734    result &= deser.read( basePath + "m_globalId", pPlug->m_globalId ); 
     1735    result &= deser.read( basePath + "m_globalIdCounter", pPlug->m_globalIdCounter ); 
    14631736 
    14641737    if ( !result ) { 
     
    14681741 
    14691742    return pPlug; 
     1743} 
     1744 
     1745bool 
     1746AvPlug::deserializeUpdate( Glib::ustring basePath, 
     1747                           Util::IODeserialize& deser ) 
     1748{ 
     1749    bool result; 
     1750    result  = deserializeAvPlugVector( basePath + "m_inputConnections", deser, m_inputConnections ); 
     1751    result &= deserializeAvPlugVector( basePath + "m_outputConnections", deser, m_outputConnections ); 
     1752    return result; 
    14701753} 
    14711754 
     
    17592042} 
    17602043 
     2044AvPlug* 
     2045AvPlugManager::getPlug( int iGlobalId ) const 
     2046{ 
     2047    for ( AvPlugVector::const_iterator it = m_plugs.begin(); 
     2048          it !=  m_plugs.end(); 
     2049          ++it ) 
     2050    { 
     2051        AvPlug* pPlug = *it; 
     2052        if ( pPlug->getGlobalId() == iGlobalId ) { 
     2053            return pPlug; 
     2054        } 
     2055    } 
     2056 
     2057    return 0; 
     2058} 
     2059 
    17612060AvPlugVector 
    17622061AvPlugManager::getPlugsByType( AVCCommand::ESubunitType subunitType, 
  • trunk/libfreebob/src/bebob/bebob_avplug.h

    r371 r372  
    138138    void showPlug() const; 
    139139 
    140  
    141     struct ChannelInfo { 
    142         stream_position_t          m_streamPosition; 
    143         stream_position_location_t m_location; 
    144         std::string                m_name; 
    145     }; 
    146     typedef std::vector<ChannelInfo> ChannelInfoVector; 
    147  
    148     struct ClusterInfo { 
    149         int                      m_index; 
    150         port_type_t              m_portType; 
    151         std::string              m_name; 
    152  
    153         nr_of_channels_t         m_nrOfChannels; 
    154         ChannelInfoVector        m_channelInfos; 
    155         stream_format_t          m_streamFormat; 
    156     }; 
    157     typedef std::vector<ClusterInfo> ClusterInfoVector; 
    158     ClusterInfoVector& getClusterInfos() 
    159     { return m_clusterInfos; } 
    160  
    161     bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ); 
     140    bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 
    162141    static AvPlug* deserialize( Glib::ustring basePath, 
    163142                                Util::IODeserialize& deser, 
     
    165144                                ConfigRom& configRom, 
    166145                                AvPlugManager& plugManager ); 
     146    bool deserializeUpdate( Glib::ustring basePath, 
     147                            Util::IODeserialize& deser ); 
     148 
     149 public: 
     150    struct ChannelInfo { 
     151        stream_position_t          m_streamPosition; 
     152        stream_position_location_t m_location; 
     153        Glib::ustring              m_name; 
     154    }; 
     155    typedef std::vector<ChannelInfo> ChannelInfoVector; 
     156 
     157    struct ClusterInfo { 
     158        int                      m_index; 
     159        port_type_t              m_portType; 
     160        Glib::ustring            m_name; 
     161 
     162        nr_of_channels_t         m_nrOfChannels; 
     163        ChannelInfoVector        m_channelInfos; 
     164        stream_format_t          m_streamFormat; 
     165    }; 
     166    typedef std::vector<ClusterInfo> ClusterInfoVector; 
     167 
     168    ClusterInfoVector& getClusterInfos() 
     169        { return m_clusterInfos; } 
     170 
    167171protected: 
     172    AvPlug(); 
     173 
    168174    bool discoverPlugType(); 
    169175    bool discoverName(); 
     
    206212    EAvPlugDirection toggleDirection( EAvPlugDirection direction ) const; 
    207213 
     214    const ClusterInfo* getClusterInfoByIndex( int index ) const; 
     215 
     216    bool serializeChannelInfos( Glib::ustring basePath, 
     217                                Util::IOSerialize& ser, 
     218                                const ClusterInfo& clusterInfo ) const; 
     219    bool deserializeChannelInfos( Glib::ustring basePath, 
     220                                  Util::IODeserialize& deser, 
     221                                  ClusterInfo& clusterInfo ); 
     222 
     223    bool serializeClusterInfos( Glib::ustring basePath, 
     224                                Util::IOSerialize& ser ) const; 
     225    bool deserializeClusterInfos( Glib::ustring basePath, 
     226                                  Util::IODeserialize& deser ); 
     227 
     228    bool serializeFormatInfos( Glib::ustring basePath, 
     229                               Util::IOSerialize& ser ) const; 
     230    bool deserializeFormatInfos( Glib::ustring basePath, 
     231                                 Util::IODeserialize& deser ); 
     232 
     233    bool serializeAvPlugVector( Glib::ustring basePath, 
     234                                Util::IOSerialize& ser, 
     235                                const AvPlugVector& vec) const; 
     236    bool deserializeAvPlugVector( Glib::ustring basePath, 
     237                                  Util::IODeserialize& deser, 
     238                                  AvPlugVector& vec ); 
     239 
    208240private: 
    209     AvPlug(); 
    210  
    211 private: 
    212     Ieee1394Service*             m_1394Service; 
    213     ConfigRom*                   m_pConfigRom; 
    214     AVCCommand::ESubunitType     m_subunitType; 
    215     subunit_id_t                 m_subunitId; 
    216     function_block_type_t        m_functionBlockType; 
    217     function_block_id_t          m_functionBlockId; 
    218     EAvPlugAddressType           m_addressType; 
    219     EAvPlugDirection             m_direction; 
    220     plug_id_t                    m_id; 
    221  
    222     // Info plug type 
    223     EAvPlugType m_infoPlugType; 
    224  
    225     // Number of channels 
    226     nr_of_channels_t             m_nrOfChannels; 
    227  
    228     // Plug name 
    229     std::string                  m_name; 
    230  
    231     // Channel & Cluster Info 
    232  
    233     ClusterInfoVector        m_clusterInfos; 
    234  
    235     // Sampling frequency 
    236     sampling_frequency_t m_samplingFrequency; 
    237  
    238241    // Supported stream formats 
    239242    struct FormatInfo { 
     
    253256    typedef std::vector<FormatInfo> FormatInfoVector; 
    254257 
    255     FormatInfoVector         m_formatInfos; 
    256  
    257     const ClusterInfo* getClusterInfoByIndex( int index ) const; 
    258  
    259     AvPlugVector             m_inputConnections; 
    260     AvPlugVector             m_outputConnections; 
    261  
    262     AvPlugManager*           m_plugManager; 
    263  
    264     int                      m_verboseLevel; 
    265  
    266     int                      m_globalId; 
    267  
    268     static int               m_globalIdCounter; 
     258 
     259    Ieee1394Service*             m_1394Service; 
     260    ConfigRom*                   m_pConfigRom; 
     261    AVCCommand::ESubunitType     m_subunitType; 
     262    subunit_id_t                 m_subunitId; 
     263    function_block_type_t        m_functionBlockType; 
     264    function_block_id_t          m_functionBlockId; 
     265    EAvPlugAddressType           m_addressType; 
     266    EAvPlugDirection             m_direction; 
     267    plug_id_t                    m_id; 
     268    EAvPlugType                  m_infoPlugType; 
     269    nr_of_channels_t             m_nrOfChannels; 
     270    Glib::ustring                m_name; 
     271    ClusterInfoVector            m_clusterInfos; 
     272    sampling_frequency_t         m_samplingFrequency; 
     273    FormatInfoVector             m_formatInfos; 
     274    AvPlugVector                 m_inputConnections; 
     275    AvPlugVector                 m_outputConnections; 
     276    AvPlugManager*               m_plugManager; 
     277    int                          m_verboseLevel; 
     278    int                          m_globalId; 
     279    static int                   m_globalIdCounter; 
    269280 
    270281    DECLARE_DEBUG_MODULE; 
     
    294305                     AvPlug::EAvPlugDirection plugDirection, 
    295306                     plug_id_t plugId ) const; 
     307    AvPlug* getPlug( int iGlobalId ) const; 
    296308    AvPlugVector getPlugsByType( AVCCommand::ESubunitType subunitType, 
    297309                                 subunit_id_t subunitId, 
     
    314326    virtual ~AvPlugCluster(); 
    315327 
    316     std::string  m_name; 
    317  
    318     AvPlugVector m_avPlugs; 
     328    Glib::ustring  m_name; 
     329    AvPlugVector   m_avPlugs; 
    319330}; 
    320331 
  • trunk/libfreebob/src/libutil/serialize.cpp

    r365 r372  
    220220    return false; 
    221221} 
     222 
     223bool 
     224Util::XMLDeserialize::isExisting( std::string strMemberName ) 
     225{ 
     226 
     227    xmlpp::Node* pNode = m_parser.get_document()->get_root_node(); 
     228    xmlpp::NodeSet nodeSet = pNode->find( strMemberName ); 
     229    return nodeSet.size() > 0; 
     230} 
  • trunk/libfreebob/src/libutil/serialize.h

    r365 r372  
    5252 
    5353        template <typename T> bool read( std::string strMemberName, T& value ); 
     54 
     55        virtual bool isExisting( std::string strMemberName ) = 0; 
    5456    }; 
    5557 
     
    8082        virtual bool read( std::string strMemberName, 
    8183                           Glib::ustring& str ); 
     84 
     85        virtual bool isExisting( std::string strMemberName ); 
     86 
    8287    private: 
    8388        Glib::ustring    m_filepath;