You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To do this, I go about registering a custom VariableDefinition based on ArrayDefinition. I then change the return value to void* next_ptr = &(it->second);
That's all and good, but I then immediately notice a problem. I have to return a new DataVariable for my result, but in order to do that, I need to know the VariableDefinition of the child element. That shouldn't be a problem, right? The ArrayDefinition constructor passes in the child VariableDefinition so I take a look at DataModelConstructor::RegisterArray and see that it gets the registered definition of the array's value_type using the DataTypeRegister. So I just need to ask the type register for one of my previously registered types and pass that inside my custom VariableDefinition. So where can I gain access to this type register that is storing all my registered types? Well its not accessible in the DataModelConstructor. Nor in any of the returned handles like StructHandle. Nor in the whole Context. As far as I can tell, it isn't publicly accessible anywhere.
Without access to the DataTypeRegister, I cannot make a custom VariableDefinition that contains a Child overload. There is no way to return child data without it. So am I missing something or is this an oversight?
The text was updated successfully, but these errors were encountered:
In your opinion, do you think it would be best to add a function to return the DataTypeRegister in the DataModelConstructor or the Context? I've added it to the DataModelConstructor personally and it works great.
Maybe I'm missing something but I find
RegisterCustomDataVariableDefinition
to be impossible to use. As an example, here is a use case:I have a
std::map<int, MyClass>
and I want to use this as a model. I want to be able to iterate over the items like an array:To do this, I go about registering a custom
VariableDefinition
based onArrayDefinition
. I then change the return value tovoid* next_ptr = &(it->second);
That's all and good, but I then immediately notice a problem. I have to return a new
DataVariable
for my result, but in order to do that, I need to know theVariableDefinition
of the child element. That shouldn't be a problem, right? TheArrayDefinition
constructor passes in the childVariableDefinition
so I take a look atDataModelConstructor::RegisterArray
and see that it gets the registered definition of the array'svalue_type
using theDataTypeRegister
. So I just need to ask the type register for one of my previously registered types and pass that inside my customVariableDefinition
. So where can I gain access to this type register that is storing all my registered types? Well its not accessible in theDataModelConstructor
. Nor in any of the returned handles likeStructHandle
. Nor in the wholeContext
. As far as I can tell, it isn't publicly accessible anywhere.Without access to the
DataTypeRegister
, I cannot make a customVariableDefinition
that contains aChild
overload. There is no way to return child data without it. So am I missing something or is this an oversight?The text was updated successfully, but these errors were encountered: