Beispiel #1
0
c_bool
v_readerUnSubscribe(
    v_reader r,
    v_partition d)
{
    assert(C_TYPECHECK(r,v_reader));

    switch(v_objectKind(r)) {
    case K_DATAREADER:
        return v_dataReaderUnSubscribe(v_dataReader(r),d);
    case K_DELIVERYSERVICE:
        return v_deliveryServiceUnSubscribe(v_deliveryService(r),d);
    case K_GROUPQUEUE:
        return v_groupStreamUnSubscribe(v_groupStream(r),d);
    case K_NETWORKREADER:
        return v_networkReaderUnSubscribe(v_networkReader(r),d);
    default:
        OS_REPORT_1(OS_ERROR,"v_readerUnSubscribe failed",0,
                    "illegal reader kind (%d) specified",
                    v_objectKind(r));
        assert(FALSE);
    }

    return TRUE;
}
Beispiel #2
0
/**************************************************************
 * Public functions
 **************************************************************/
c_bool
v_readerSubscribe(
    v_reader r,
    v_partition d)
{
    c_bool result;

    assert(C_TYPECHECK(r,v_reader));

    switch(v_objectKind(r)) {
    case K_DATAREADER:
        result = v_dataReaderSubscribe(v_dataReader(r),d);
    break;
    case K_DELIVERYSERVICE:
        result = v_deliveryServiceSubscribe(v_deliveryService(r),d);
    break;
    case K_GROUPQUEUE:
        result = v_groupStreamSubscribe(v_groupStream(r),d);
    break;
    case K_NETWORKREADER:
        result = v_networkReaderSubscribe(v_networkReader(r),d);
    break;
    default:
        OS_REPORT_1(OS_ERROR,"v_readerSubscribe failed",0,
                    "illegal reader kind (%d) specified",
                    v_objectKind(r));
        assert(FALSE);
        result = FALSE;
    break;
    }
    readerGetHistoricalData(r);

    return result;
}
Beispiel #3
0
c_bool
v_readerUnSubscribeGroup(
    v_reader reader,
    v_group group)
{
    c_bool result;

    assert(C_TYPECHECK(reader, v_reader));

    switch(v_objectKind(reader)) {
    case K_DATAREADER:
        result = v_dataReaderUnSubscribeGroup(v_dataReader(reader), group);
    break;
    case K_GROUPQUEUE:
        result = v_groupStreamUnSubscribeGroup(v_groupStream(reader), group);
    break;
    case K_NETWORKREADER:
        result = v_networkReaderUnSubscribeGroup(v_networkReader(reader), group);
    break;
    default:
        OS_REPORT_1(OS_ERROR,"v_readerUnSubscribeGroup failed",0,
                    "illegal reader kind (%d) specified",
                    v_objectKind(reader));
        assert(FALSE);
        result = FALSE;
    }

    return result;
}
Beispiel #4
0
static c_bool
notifyGroupQueues(
    v_reader reader,
    v_group group)
{
    if(v_objectKind(reader) == K_GROUPQUEUE){
        v_groupStreamConnectNewGroups(v_groupStream(reader), group);
    }
    return TRUE;
}
Beispiel #5
0
/**************************************************************
 * Protected functions
 **************************************************************/
c_bool
v_readerSubscribeGroup(
    v_reader _this,
    v_group group)
{
    c_bool result;

    assert(C_TYPECHECK(_this, v_reader));
    switch(v_objectKind(_this)) {
    case K_DATAREADER:
        /* ES, dds1576: For the K_DATAREADER object we need to verify if
         * the access rights are correct. No subscriptions may be made onto
         * groups which have a v_accessMode of write only.
         */
        if(v_groupPartitionAccessMode(group) == V_ACCESS_MODE_READ_WRITE ||
           v_groupPartitionAccessMode(group) == V_ACCESS_MODE_READ)
        {
            result = v_dataReaderSubscribeGroup(v_dataReader(_this), group);
            readerGetHistoricalData(_this);
        } else
        {
            result = FALSE;
        }
    break;
    case K_GROUPQUEUE:
        result = v_groupStreamSubscribeGroup(v_groupStream(_this), group);
    break;
    case K_NETWORKREADER:
        result = v_networkReaderSubscribeGroup(v_networkReader(_this), group);
        readerGetHistoricalData(_this);
    break;
    default:
        OS_REPORT_1(OS_ERROR,"v_readerSubscribeGroup failed",0,
                    "illegal reader kind (%d) specified",
                    v_objectKind(_this));
        assert(FALSE);
        result = FALSE;
    }
    return result;
}