Is it possible to create a QueryCondition for a DDSStringDataReader?

3 posts / 0 new
Last post
Offline
Last seen: 10 years 2 months ago
Joined: 02/28/2013
Posts: 3
Is it possible to create a QueryCondition for a DDSStringDataReader?

I'm trying to create a QueryFilter for a DDSStringDataReader. I just want to filter on the string value. Is that possible? The query syntax seems to require a field name, but I have no idea what that is for the DDSStringDataReader's Topic data type.

::DDS::StringSeq lQueryParameters;
::DDS::QueryCondition* lCommandCondition = lStringReader->create_querycondition(
    ::DDS::ANY_SAMPLE_STATE,
    ::DDS::ANY_VIEW_STATE,
    ::DDS::ANY_INSTANCE_STATE,
    "??? MATCH 'TestString'",
    lQueryParameters);

I tried using ". MATCH 'TestString'" but then the condition's trigger value seems to be true no matter what the string actually is...

Offline
Last seen: 10 years 2 months ago
Joined: 02/28/2013
Posts: 3

Through a lucky guess I got it to work using "value MATCH 'TestString'".

Is that documented anywhere? The field names seem to be specified for KeyedString (value and key), but not plain old String.

Gerardo Pardo's picture
Offline
Last seen: 3 weeks 5 days ago
Joined: 06/02/2010
Posts: 602

Hello,

I think you are right and there is no documentation of the logical schema used for the DDS String builtin-type. 

The API's to read and write the data were simplified to take straight "char *" and for this reason I think we forgot to document what the actual type-schema is, which as you state you need to perform content filtering. I will file an internal issue to get this added to the documentation.  Thank you for pointing this out.

Your guess is correct and the schema is the same used for the  KeyedString except there is no key.

For future reference, there is another way you could have figured the schema associated with the data-type and that is by using one of the tools such as RTI Analyzer or Connext DDS View.  If you run these tools with other DDS applications it will show all the Topics that are being published/subscribed and the corresponding data-types and schemas.

Gerardo