Exemplo n.º 1
0
int FilteredConsumer::last( Filter &filter )
{
    int error = 0;
    if ( filter.is_valid( ) )
    {
        Service *producer = this->producer( );
        error = filter.connect( *producer );
        if ( error == 0 )
            connect_producer( filter );
        delete producer;
    }
    else
    {
        error = 1;
    }
    return error;
}
Exemplo n.º 2
0
int FilteredConsumer::attach( Filter &filter )
{
    int error = 0;
    if ( filter.is_valid( ) )
    {
        Service *producer = first->producer( );
        error = filter.connect( *producer );
        if ( error == 0 )
        {
            first->connect_producer( filter );
            delete first;
            first = new Service( filter );
        }
        delete producer;
    }
    else
    {
        error = 1;
    }
    return error;
}