Problem in assigning a value in sequence
In idl file containing
Struct B
{
Long id;
sequence <long , 5 > values;
sequence <long , 5 > value2;
}
Struct A
{
Long key;
B Emp;
}
Instance->key =1;
Instance->Emp.id =2;
Both this is correct but when assigning in sequence
Instance->Emp.value =1; this is causing problem
It is saying = invalid conversion from int to DDS_LongSeq
Help me
Hey,
"sequence <long , 5 > values" in the idl translates into a LongSeq in what I'm guessing is C++.
When instance is instantiated I believe all of its sequences are created "empty".
I think (haven't used c++ with rti so not certain) Instance->Emp.value.add(1) (or set(0, 1) may work.
Good luck,
Roy.
I tried it, but not working saying doesnt recognized add()
Please check out the documentation: http://community.rti.com/rti-doc/510/ndds/doc/html/api_cpp/structFooSeq.html
you can access sequences like an array (with []) or use the from_array method.
good luck.
I tried lot of things but still not happening. If anyone can share any example related to this it would be really helpful.