Skip to content

Commit

Permalink
Unfriend qvi_hwpool_s in qvi_hwpool_dev_s. (#254)
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel K. Gutierrez <samuel@lanl.gov>
  • Loading branch information
samuelkgutierrez authored Jul 26, 2024
1 parent 46f6e1f commit b6c35ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/qvi-hwpool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -388,7 +394,7 @@ qvi_hwpool_s::add_device(
const qvi_hwpool_dev_s &dev
) {
auto shdev = std::make_shared<qvi_hwpool_dev_s>(dev);
m_devs.insert({dev.m_type, shdev});
m_devs.insert({dev.type(), shdev});
return QV_SUCCESS;
}

Expand Down
5 changes: 3 additions & 2 deletions src/qvi-hwpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit b6c35ec

Please sign in to comment.