Skip to content

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

@yzhou-bcom

Description

@yzhou-bcom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions