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

Value parse problem with user defined data in a property bag #326

Open
liufang-robot opened this issue Jan 1, 2021 · 0 comments
Open

Value parse problem with user defined data in a property bag #326

liufang-robot opened this issue Jan 1, 2021 · 0 comments

Comments

@liufang-robot
Copy link

Hello, I have a problem...
When I try to add a user defined type data in a property bag, the value parse will get an error with the user data.

Here is an example:
Create a simple data structure:.

struct UserData
{
   /** Contains a sequence of doubles. */
   std::vector<double> samples;
   std::string name;
   int id;
};

create the typekit by typegen (or manually).
add the UserData property instance in a component (simply named 'hello'):

/// user_data_, user_data_in_bag_ are UserData type members of hello component.
/// test_bag_ is PropertyBag type member of hello component

/// in the constructor of component.
/// add a UserData type data as a plain property.
addProperty("user_data", user_data_)
/// add a UserData type data in a propertybag.
test_bag_.addProperty("user_data",user_data_in_bag_);
addProperty("test_bag",test_bag_);

And the ValueParser will not handle the propertybag case correctly.
we can simple use deployer to check(deployer use rtt scripting ValueParser to get the value).
In a deployer:

# input this and enter, try to get the id value. this is OK
hello.user_data.id

# input this and enter, try to get the id value.  this is Not OK
hello.test_bag.user_data.id
# It gives an error:
Semantic error: Property test_bag not present in PropertyBag test_bag in hello.

The error is logged in scripting/ValueParser.cpp line 168.
I looked into the code and found it seems that the case a user defined data in a property bag is never considered.
In the code, it only try to recursively use a propertybag to analysis the expression.
Is this true?
Thanks for your reply.

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