Hello!
I need to use a data structure like a maps in c++, defining it into my idl file. I've read the DDS guide and i've seen several types but i cannot find a solution to my problem.
Anyone can tell me if is possibile to create maps?
Thanks a lot.
Hello!
I need to use a data structure like a maps in c++, defining it into my idl file. I've read the DDS guide and i've seen several types but i cannot find a solution to my problem.
Anyone can tell me if is possibile to create maps?
Thanks a lot.
Essentially yes, but by a combination of data type and DataReader behavior. Consider something like this:
Also assume a history depth of 1. As your DataWriter(s) populate the data space by writing instances and your DataReader(s) receive them, you could iterate over them with a basic read(). Or if you wanted to look up an instance by a specific key value, you could use lookup_instance() and then (in modern C++) select() and instance(). Technically, at the cost of efficiency, you could even use a Query Condition to look up instances by value.