Hi Thanks for your reply. Take for example following is the idl: struct STRUCT_USER_LIST { DDS_Char* username; UINT_8 user role; } struct USER_FUNCTION_LIST { STRUCT_USER_LIST struct_user_list; } I want to retrieve that sample whose username is User1. So I want to apply ddsquerycondition to attribute username within a structure struct_user_list of topic USER_FUNCTION_LIST.
Hi Shweta,
Can you be more specific about what you mean? Maybe provide the IDL and explain when you want the QueryCondition to become active...
In general you refer to the attributes of a structure by their name direcly. See take a look at this example https://community.rti.com/examples/waitset-query-condition. Since the structure has an attribute called
name
of type string the conditon expression can be something like:name match 'Fred'
Gerardo
Hi
Thanks for your reply.
Take for example following is the idl:
struct STRUCT_USER_LIST
{
DDS_Char* username;
UINT_8 user role;
}
struct USER_FUNCTION_LIST
{
STRUCT_USER_LIST struct_user_list;
}
I want to retrieve that sample whose username is User1.
So I want to apply ddsquerycondition to attribute username within a structure struct_user_list of topic USER_FUNCTION_LIST.
Oh I see your question was about nested structures. You can use the "." notation to refer to the nested members as you would do in C++, Java, or C#.
In your exaple you would use the expression:
struct_user_list.username match 'User1'
Gerardo
Hi
Take for example
Char* qc_params_list[1];
qc_params_list[0] = "'User1'";
DDS_StringSeq qc_params(1);
qc_params.from_array(qc_params_list,1);
DDSQueryCondition *query= reader->create_querycondition(DDS_ANY_SAMPLE_STATE,DDS_ANY_VIEW_STATE,DDS_ALIVE_INSTANCE_STATE,"struct_user_list.username=",qc_params);
Here null pointer is returned to query.
Sry second last argument is taken as "struct_user_list.username = %0"