Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unfriend qvi_hwpool_s in qvi_hwpool_dev_s. #254

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading