void
PublisherDelegate::end_coherent_changes()
{
    this->check();
    u_result uResult = u_publisherCoherentEnd(u_publisher(this->userHandle));
    ISOCPP_U_RESULT_CHECK_AND_THROW(uResult, "Could not end coherent changes.");
}
void
PublisherDelegate::resume_publications()
{
    this->check();
    u_result uResult = u_publisherResume(u_publisher(this->userHandle));
    ISOCPP_U_RESULT_CHECK_AND_THROW(uResult, "Could not resume publications.");
}
Example #3
0
c_char*
cmx_writerNew(
    const c_char* publisher,
    const c_char* name,
    const c_char* topic,
    const c_char* qos)
{
    u_publisher pub;
    u_topic top;
    u_writer wri;
    c_char* result;
    cmx_entityArg arg;
    u_result ur;
    cmx_entityKernelArg kernelArg;
    v_writerQos wQos;
    
    result = NULL;
    pub = u_publisher(cmx_entityUserEntity(publisher));
    
    if(pub != NULL){
        top = u_topic(cmx_entityUserEntity(topic));
        
        if(top != NULL){
            kernelArg = cmx_entityKernelArg(os_malloc(C_SIZEOF(cmx_entityKernelArg)));
            u_entityAction(u_entity(pub), cmx_entityKernelAction, (c_voidp)kernelArg);
            
            if(qos != NULL){
                wQos = v_writerQos(cmx_qosKernelQosFromKind(qos, K_WRITER, c_getBase(c_object(kernelArg->kernel))));
                
                if(wQos == NULL){
                    wQos = v_writerQosNew(kernelArg->kernel, NULL);
                    wQos->reliability.kind = V_RELIABILITY_RELIABLE;
                }
            } else {
                wQos = v_writerQosNew(kernelArg->kernel, NULL);
                wQos->reliability.kind = V_RELIABILITY_RELIABLE;
            }
            wri = u_writerNew(pub, name, top, NULL, wQos, TRUE);
            os_free(kernelArg);
            c_free(wQos);
            
            if(wri != NULL){
                cmx_registerEntity(u_entity(wri));
                arg = cmx_entityArg(os_malloc(C_SIZEOF(cmx_entityArg)));
                arg->entity = u_entity(wri);
                arg->create = FALSE;
                arg->participant = NULL;
                arg->result = NULL;
                ur = u_entityAction(u_entity(wri), cmx_entityNewFromAction, (c_voidp)(arg));
                
                if(ur == U_RESULT_OK){
                    result = arg->result;
                    os_free(arg);
                }
            }
        }
    }
    return result;
}
void
PublisherDelegate::qos(const dds::pub::qos::PublisherQos& pqos)
{
    org::opensplice::core::ScopedObjectLock scopedLock(*this);
    u_publisherQos uQos;
    u_result uResult;

    pqos.delegate().check();
    uQos = pqos.delegate().u_qos();
    if (!uQos) {
        ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Could not convert publisher qos.");
    }

    uResult = u_publisherSetQos(u_publisher(this->userHandle), uQos);
    u_publisherQosFree(uQos);
    ISOCPP_U_RESULT_CHECK_AND_THROW(uResult, "Could not set publisher qos.");

    this->qos_ = pqos;
}
Example #5
0
const c_char*
cmx_publisherPublish(
    const c_char* publisher,
    const c_char* domainExpr)
{
    u_publisher pub;
    u_result ur;
    const c_char* result;
    
    pub = u_publisher(cmx_entityUserEntity(publisher));
    
    if(pub != NULL){
        ur = u_publisherPublish(pub, domainExpr);
        
        if(ur == U_RESULT_OK){
            result = CMX_RESULT_OK;
        } else {
            result = CMX_RESULT_FAILED;
        }
    } else {
        result = CMX_RESULT_FAILED;
    }
    return result;
}