Rename get and set filter functions for topic
Signed-off-by: Firas Sahli <firas.sahli@adlinktech.com>
This commit is contained in:
		
							parent
							
								
									05f961dec1
								
							
						
					
					
						commit
						9f51f6f9dc
					
				
					 3 changed files with 39 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -1061,6 +1061,13 @@ typedef bool (*dds_topic_filter_fn) (const void * sample);
 | 
			
		|||
 */
 | 
			
		||||
_Pre_satisfies_((topic & DDS_ENTITY_KIND_MASK) == DDS_KIND_TOPIC)
 | 
			
		||||
DDS_EXPORT void
 | 
			
		||||
dds_set_topic_filter(
 | 
			
		||||
        dds_entity_t topic,
 | 
			
		||||
        dds_topic_filter_fn filter);
 | 
			
		||||
 | 
			
		||||
_Pre_satisfies_((topic & DDS_ENTITY_KIND_MASK) == DDS_KIND_TOPIC)
 | 
			
		||||
DDS_EXPORT void
 | 
			
		||||
DDS_DEPRECATED_EXPORT
 | 
			
		||||
dds_topic_set_filter(
 | 
			
		||||
        dds_entity_t topic,
 | 
			
		||||
        dds_topic_filter_fn filter);
 | 
			
		||||
| 
						 | 
				
			
			@ -1074,6 +1081,12 @@ dds_topic_set_filter(
 | 
			
		|||
 */
 | 
			
		||||
_Pre_satisfies_((topic & DDS_ENTITY_KIND_MASK) == DDS_KIND_TOPIC)
 | 
			
		||||
DDS_EXPORT dds_topic_filter_fn
 | 
			
		||||
dds_get_topic_filter(
 | 
			
		||||
        dds_entity_t topic);
 | 
			
		||||
 | 
			
		||||
_Pre_satisfies_((topic & DDS_ENTITY_KIND_MASK) == DDS_KIND_TOPIC)
 | 
			
		||||
DDS_EXPORT dds_topic_filter_fn
 | 
			
		||||
DDS_DEPRECATED_EXPORT
 | 
			
		||||
dds_topic_get_filter(
 | 
			
		||||
        dds_entity_t topic);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -528,7 +528,7 @@ dds_topic_mod_filter(
 | 
			
		|||
 | 
			
		||||
_Pre_satisfies_((topic & DDS_ENTITY_KIND_MASK) == DDS_KIND_TOPIC)
 | 
			
		||||
void
 | 
			
		||||
dds_topic_set_filter(
 | 
			
		||||
dds_set_topic_filter(
 | 
			
		||||
        dds_entity_t topic,
 | 
			
		||||
        dds_topic_filter_fn filter)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -537,9 +537,18 @@ dds_topic_set_filter(
 | 
			
		|||
    dds_topic_mod_filter (topic, &chaining, &realf, true);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
_Pre_satisfies_((topic & DDS_ENTITY_KIND_MASK) == DDS_KIND_TOPIC)
 | 
			
		||||
void
 | 
			
		||||
dds_topic_set_filter(
 | 
			
		||||
        dds_entity_t topic,
 | 
			
		||||
        dds_topic_filter_fn filter)
 | 
			
		||||
{
 | 
			
		||||
    dds_set_topic_filter(topic, filter);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
_Pre_satisfies_((topic & DDS_ENTITY_KIND_MASK) == DDS_KIND_TOPIC)
 | 
			
		||||
dds_topic_filter_fn
 | 
			
		||||
dds_topic_get_filter(
 | 
			
		||||
dds_get_topic_filter(
 | 
			
		||||
        dds_entity_t topic)
 | 
			
		||||
{
 | 
			
		||||
    dds_topic_intern_filter_fn filter;
 | 
			
		||||
| 
						 | 
				
			
			@ -548,6 +557,14 @@ dds_topic_get_filter(
 | 
			
		|||
    return (filter == dds_topic_chaining_filter) ? (dds_topic_filter_fn)ctx : 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
_Pre_satisfies_((topic & DDS_ENTITY_KIND_MASK) == DDS_KIND_TOPIC)
 | 
			
		||||
dds_topic_filter_fn
 | 
			
		||||
dds_topic_get_filter(
 | 
			
		||||
        dds_entity_t topic)
 | 
			
		||||
{
 | 
			
		||||
    return dds_get_topic_filter(topic);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
dds_topic_set_filter_with_ctx(
 | 
			
		||||
        dds_entity_t topic,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -351,20 +351,20 @@ Test(ddsc_entity, inconsistent_topic)
 | 
			
		|||
    dds_inconsistent_topic_status_t topic_status;
 | 
			
		||||
 | 
			
		||||
    top = dds_create_topic(participant, &RoundTripModule_DataType_desc, "RoundTrip1", NULL, NULL);
 | 
			
		||||
    cr_assert_gt(top, 0, "fails %d", dds_err_nr(top));
 | 
			
		||||
    CU_ASSERT_FATAL(top > 0);
 | 
			
		||||
 | 
			
		||||
    /*Set reader topic and writer topic statuses enabled*/
 | 
			
		||||
    ret = dds_set_status_mask(top, DDS_INCONSISTENT_TOPIC_STATUS);
 | 
			
		||||
    cr_assert_dds_return_t_eq(ret, DDS_RETCODE_OK);
 | 
			
		||||
    CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK);
 | 
			
		||||
    ret = dds_set_status_mask(top, DDS_INCONSISTENT_TOPIC_STATUS);
 | 
			
		||||
    cr_assert_dds_return_t_eq(ret, DDS_RETCODE_OK);
 | 
			
		||||
    CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK);
 | 
			
		||||
 | 
			
		||||
    /* Wait for pub inconsistent topic status callback */
 | 
			
		||||
    ret = dds_waitset_wait(waitSetwr, wsresults, wsresultsize, waitTimeout);
 | 
			
		||||
    CU_ASSERT_EQUAL_FATAL(ret, (dds_return_t)wsresultsize);
 | 
			
		||||
    ret = dds_get_inconsistent_topic_status (top, &topic_status);
 | 
			
		||||
    cr_assert_dds_return_t_eq(ret, DDS_RETCODE_OK);
 | 
			
		||||
    cr_assert_gt(topic_status.total_count, 0);
 | 
			
		||||
    CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK);
 | 
			
		||||
    CU_ASSERT_FATAL(topic_status.total_count > 0);
 | 
			
		||||
 | 
			
		||||
    /*Getting the status should have reset the trigger, waitset should timeout */
 | 
			
		||||
    status = dds_waitset_wait(waitSetrd, wsresults, wsresultsize, shortTimeout);
 | 
			
		||||
| 
						 | 
				
			
			@ -374,8 +374,8 @@ Test(ddsc_entity, inconsistent_topic)
 | 
			
		|||
    ret = dds_waitset_wait(waitSetrd, wsresults, wsresultsize, waitTimeout);
 | 
			
		||||
    CU_ASSERT_EQUAL_FATAL(status, wsresultsize);
 | 
			
		||||
    ret = dds_get_inconsistent_topic_status (top, &topic_status);
 | 
			
		||||
    cr_assert_dds_return_t_eq(ret, DDS_RETCODE_OK);
 | 
			
		||||
    cr_assert_gt(topic_status.total_count, 0);
 | 
			
		||||
    CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK);
 | 
			
		||||
    CU_ASSERT_FATAL(topic_status.total_count > 0);
 | 
			
		||||
 | 
			
		||||
    /*Getting the status should have reset the trigger, waitset should timeout */
 | 
			
		||||
    status = dds_waitset_wait(waitSetrd, wsresults, wsresultsize, shortTimeout);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue