Ejemplo n.º 1
0
/**************************************************************
 * private functions
 **************************************************************/
static c_bool
v_topicQosValidValues(
    v_topicQos qos)
{
    int valuesOk;
    
    valuesOk = 1;
    /* no typechecking, since qos might be allocated on heap! */
    if (qos != NULL) {
        /* value checking */
        valuesOk = 1;
        valuesOk &= v_durabilityPolicyValid(qos->durability);
        valuesOk &= v_durabilityServicePolicyValid(qos->durabilityService);
        valuesOk &= v_deadlinePolicyValid(qos->deadline);
        valuesOk &= v_latencyPolicyValid(qos->latency);
        valuesOk &= v_livelinessPolicyValid(qos->liveliness);
        valuesOk &= v_reliabilityPolicyValid(qos->reliability);
        valuesOk &= v_orderbyPolicyValid(qos->orderby);
        valuesOk &= v_historyPolicyValid(qos->history);
        valuesOk &= v_resourcePolicyValid(qos->resource);
        valuesOk &= v_transportPolicyValid(qos->transport);
        valuesOk &= v_lifespanPolicyValid(qos->lifespan);
        valuesOk &= v_ownershipPolicyValid(qos->ownership);
        valuesOk &= v_topicDataPolicyValid(qos->topicData);
    }

    return (valuesOk?TRUE:FALSE);
}
Ejemplo n.º 2
0
/**************************************************************
 * private functions
 **************************************************************/
static c_bool
v_readerQosValidValues(
    v_readerQos qos)
{
    int valuesOk;

    /* no typechecking, since qos might be allocated on heap! */
    valuesOk = 1; 
    if (qos != NULL) {
        /* value checking */
        valuesOk &= v_durabilityPolicyValid(qos->durability);
        valuesOk &= v_deadlinePolicyValid(qos->deadline);
        valuesOk &= v_latencyPolicyValid(qos->latency);
        valuesOk &= v_livelinessPolicyValid(qos->liveliness);
        valuesOk &= v_reliabilityPolicyValid(qos->reliability);
        valuesOk &= v_orderbyPolicyValid(qos->orderby);
        valuesOk &= v_historyPolicyValid(qos->history);
        valuesOk &= v_resourcePolicyValid(qos->resource);
        valuesOk &= v_ownershipPolicyValid(qos->ownership);
        valuesOk &= v_pacingPolicyValid(qos->pacing);
        valuesOk &= v_readerLifecyclePolicyValid(qos->lifecycle);
        valuesOk &= v_readerLifespanPolicyValid(qos->lifespan);
        valuesOk &= v_userDataPolicyValid(qos->userData);
        valuesOk &= v_userKeyPolicyValid(qos->userKey);
        valuesOk &= v_sharePolicyValid(qos->share);
    }
    return (valuesOk?TRUE:FALSE);
}
Ejemplo n.º 3
0
c_bool
v_historicalDataRequestIsValid(
    v_historicalDataRequest request,
    v_reader reader)
{
    c_bool result;
    q_expr expr;

    assert(C_TYPECHECK(request,v_historicalDataRequest));
    assert(C_TYPECHECK(reader,v_reader));

    if(request && reader){
        if(!v_resourcePolicyValid(request->resourceLimits)){
            result = FALSE;
        } else if((reader->qos->resource.max_samples != -1) &&
                  (reader->qos->resource.max_samples <
                   request->resourceLimits.max_samples))
        {
            result = FALSE;
        } else if((reader->qos->resource.max_instances != -1) &&
                  (reader->qos->resource.max_instances <
                   request->resourceLimits.max_instances))
        {
            result = FALSE;
        } else if((reader->qos->resource.max_samples_per_instance != -1) &&
                  (reader->qos->resource.max_samples_per_instance <
                   request->resourceLimits.max_samples_per_instance))
        {
            result = FALSE;
        } else if(!c_timeValid(request->minSourceTimestamp)){
            result = FALSE;
        } else if(!c_timeValid(request->maxSourceTimestamp)){
            result = FALSE;
        } else if(c_timeCompare(request->minSourceTimestamp,
                request->maxSourceTimestamp) == C_GT)
        {
            result = FALSE;
        } else if(request->filter){
            expr = q_parse(request->filter);

            if(expr){
                q_dispose(expr);
                result = TRUE;
            } else {
                result = FALSE;
            }
        } else {
            result = TRUE;
        }
    } else {
        result = FALSE;
    }
    return result;
}