src/common/baseresources.cpp
bool BaseResources::hasDev(const std::string& type) const
{
    if (type == m_type)
    {
        // whole list indicates that type match
        return true;
    }

    IDevList devlist = getDevList();

    IDevList::const_iterator i = std::find_if(
        devlist.begin(), devlist.end(),
        boost::bind<bool>(IsDevHasParam(), _1, dev::TYPE, type));

    if (i != devlist.end())
        return true; // found in dev list

    boost::function1<bool, IResourcesPtr>
        compare = boost::bind(&IResources::hasDev, _1, type);
    // not found, try sub resources
    IResourcesList reslist = getResourcesList();
    IResourcesList::const_iterator j = std::find_if(
        reslist.begin(), reslist.end(),
        boost::bind<bool>(compare, _1));
    if (j != reslist.end())
        return true; // found in sub resources

    return false;
}
// Check is there the specified dev type
// @param[in] type - the dev's typ[e to be checked
Check is there the specified dev type
Check is there the specified dev type
bool BaseResources::hasDev(const std::string& type) const
{
    if (type == m_type)
    {
        return true;
    }
    IDevList devlist = getDevList();
    IDevList::const_iterator i = std::find_if(
        devlist.begin(), devlist.end(),
        boost::bind<bool>(IsDevHasParam(), _1, dev::TYPE, type));
    if (i != devlist.end())
        return true; 
    boost::function1<bool, IResourcesPtr>
        compare = boost::bind(&IResources::hasDev, _1, type);
    IResourcesList reslist = getResourcesList();
    IResourcesList::const_iterator j = std::find_if(
        reslist.begin(), reslist.end(),
        boost::bind<bool>(compare, _1));
    if (j != reslist.end())
        return true; 
    return false;
}
bool BaseResources :: hasDev ( const std :: string & type ) const { if ( type == m_type ) { return true ; } IDevList devlist = getDevList ( ) ; IDevList :: const_iterator i = std :: find_if ( devlist . begin ( ) , devlist . end ( ) , boost :: bind < bool > ( IsDevHasParam ( ) , _1 , dev :: TYPE , type ) ) ; if ( i != devlist . end ( ) ) return true ; boost :: function1 < bool , IResourcesPtr > compare = boost :: bind ( & IResources :: hasDev , _1 , type ) ; IResourcesList reslist = getResourcesList ( ) ; IResourcesList :: const_iterator j = std :: find_if ( reslist . begin ( ) , reslist . end ( ) , boost :: bind < bool > ( compare , _1 ) ) ; if ( j != reslist . end ( ) ) return true ; return false ; }
Check is there the specified dev type
Check is there the specified dev type
// whole list indicates that type match // found in dev list // not found, try sub resources // found in sub resources