diff --git a/src/qvi-hwpool.cc b/src/qvi-hwpool.cc index e33ba93..a54ce2f 100644 --- a/src/qvi-hwpool.cc +++ b/src/qvi-hwpool.cc @@ -193,6 +193,12 @@ qvi_hwpool_dev_s::operator==( return m_uuid == x.m_uuid; } +qv_hw_obj_type_t +qvi_hwpool_dev_s::type(void) + const { + return m_type; +} + int qvi_hwpool_dev_s::id( qv_device_id_type_t format, @@ -388,7 +394,7 @@ qvi_hwpool_s::add_device( const qvi_hwpool_dev_s &dev ) { auto shdev = std::make_shared(dev); - m_devs.insert({dev.m_type, shdev}); + m_devs.insert({dev.type(), shdev}); return QV_SUCCESS; } diff --git a/src/qvi-hwpool.h b/src/qvi-hwpool.h index a231cbb..037c279 100644 --- a/src/qvi-hwpool.h +++ b/src/qvi-hwpool.h @@ -68,8 +68,6 @@ struct qvi_hwpool_cpu_s : qvi_hwpool_res_s { * because we only maintain information relevant for user-facing operations. */ struct qvi_hwpool_dev_s : qvi_hwpool_res_s { - /** Hardware pools are our friends. */ - friend qvi_hwpool_s; private: /** Device type. */ qv_hw_obj_type_t m_type = QV_HW_OBJ_LAST; @@ -99,6 +97,9 @@ struct qvi_hwpool_dev_s : qvi_hwpool_res_s { operator==( const qvi_hwpool_dev_s &x ) const; + /** Returns the device's type. */ + qv_hw_obj_type_t + type(void) const ; /** Returns the device's ID string formatted as specified. */ int id(