Can a reader get partition of sample?

3 posts / 0 new
Last post
Offline
Last seen: 7 years 1 month ago
Joined: 06/10/2014
Posts: 49
Can a reader get partition of sample?

Hi,

I've been investigating using partitions as a way to identify our data. If I use a string that identifies the location of the publisher like "Room_302" and my subscriber partition is "Room_*" is there a way that the reader can parse the publisher partition string to determine that the sample was published by Room 302? I haven't seen any reader methods that have the partition strings of the publisher.

Thanks,

Anne Fiore

Organization:
Offline
Last seen: 8 years 1 month ago
Joined: 04/29/2016
Posts: 9

I have done this by retrieving the publication data of the writer of the sample which can be found from the publication handle in the sample info. Something like the following:

DDS_ParticipantBuiltinTopicData participant_data;
reader->get_matched_publication_participant_data( participant_data, sample_info.publication_handle );

DDS_PublicationBuiltinTopicData publication_data;
reader->get_matched_publication_data( publication_data, info[i].publication_handle );
cout << publication_data.partition.name[0];

Offline
Last seen: 7 years 1 month ago
Joined: 06/10/2014
Posts: 49

Thanks very much. This worked.