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

Access value of property of type size_t via getUnsignedIntegerValue() always return 0 #22

Open
yzhou-bcom opened this issue Jan 26, 2024 · 0 comments

Comments

@yzhou-bcom
Copy link

In class A, we defined a member variable m_prop as follows:
class A {
size_t m_prop;
}
and in constructor of class A,
A::A():ConfigurableBase(xpcf::toUUID())
{
declareProperty("prop", m_prop);
}

Then in class B, we had an object of class A named as a.
When we do a->bindToxpcf::IConfigurable()->getProperty("prop")->getUnsignedIntegerValue(), it always returned 0, whatever the value of "prop" we put in the xml file.

However, when we replace size_t by uint32_t, everything works, we get the expected property value.
class A {
uint32_t m_prop;
}

I think maybe it is related to the implementation below:

virtual uint32_t getUnsignedIntegerValue (uint32_t itemIndex = 0) const = 0;

It would suggest to log an error message, instead of return 0, when getUnsignedIntegerValue() is called to access the value of a property of type size_t ?

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant