DDS_StatusCondition DDS_Subscriber_get_statuscondition (DDS_Subscriber sp) { Domain_t *dp; StatusCondition_t *scp; ctrc_printd (DCPS_ID, DCPS_S_G_SCOND, &sp, sizeof (sp)); if (!subscriber_ptr (sp, NULL)) return (NULL); dp = domain_ptr (sp->domain, 1, NULL); if (!dp) return (NULL); scp = sp->condition; if (!scp) { scp = dcps_new_status_condition (); if (!scp) return (NULL); scp->entity = (Entity_t *) sp; sp->condition = scp; } lock_release (dp->lock); return ((DDS_StatusCondition) scp); }
DDS_StatusCondition DDS_DataWriter_get_statuscondition (DDS_DataWriter wp) { StatusCondition_t *scp; ctrc_printd (DCPS_ID, DCPS_DW_G_SCOND, &wp, sizeof (wp)); if (!writer_ptr (wp, 1, NULL)) return (NULL); scp = wp->w_condition; if (!scp) { scp = dcps_new_status_condition (); if (!scp) return (NULL); scp->entity = (Entity_t *) wp; wp->w_condition = scp; } lock_release (wp->w_lock); return ((DDS_StatusCondition) scp); }
DDS_StatusCondition DDS_Topic_get_statuscondition (DDS_Topic tp) { StatusCondition_t *scp; ctrc_printd (DCPS_ID, DCPS_T_G_SCOND, &tp, sizeof (tp)); if (!topic_ptr (tp, 1, NULL)) return (NULL); scp = tp->condition; if (!scp) { scp = dcps_new_status_condition (); if (!scp) return (NULL); scp->entity = (Entity_t *) tp; tp->condition = scp; } lock_release (tp->lock); return ((DDS_StatusCondition) scp); }
DDS_StatusCondition DDS_DomainParticipant_get_statuscondition (DDS_DomainParticipant dp) { StatusCondition_t *scp; ctrc_printd (DCPS_ID, DCPS_DP_G_SCOND, &dp, sizeof (dp)); /* Get Domain Participant. */ if (!domain_ptr (dp, 1, NULL)) { log_printf (DCPS_ID, 0, "get_statuscondition: domain doesn't exist!\r\n"); return (NULL); } scp = (StatusCondition_t *) dp->condition; if (!scp) { scp = dcps_new_status_condition (); if (!scp) return (NULL); scp->entity = (Entity_t *) dp; dp->condition = scp; } lock_release (dp->lock); return ((DDS_StatusCondition) scp); }