pelican/server/src/DataManager.cpp
/**
 * @details
 * This method sets up a stream buffer for the specified data type
 * if it does not already exist.
 *
 * @param[in] type The data type held by the buffer.
 */
@details
This method sets up a stream buffer for the specified data type
if it does not already exist.

@param[in] type The data type held by the buffer.
@details This method sets up a stream buffer for the specified data type if it does not already exist . @param [ in ] type The data type held by the buffer .
StreamDataBuffer* DataManager::getStreamBuffer(const QString& type)
{
    Q_ASSERT(type != "");
    if (!_streams.contains(type))
    {
        Config::TreeAddress configAddress(_bufferConfigBaseAddress);
        configAddress << Config::NodeId(type, "");
        ConfigNode config = _config->get(configAddress);
        if (!_bufferMaxSizes.contains(type))
        {
            _bufferMaxSizes[type] = config.getOption("buffer", "maxSize",
                    "10240").toULongLong();
        }
        if (!_bufferMaxChunkSizes.contains(type))
        {
            _bufferMaxChunkSizes[type] = config.getOption("buffer",
                    "maxChunkSize", 0).toULongLong();
            if (!_bufferMaxChunkSizes[type]) {
                _bufferMaxChunkSizes[type]=_bufferMaxSizes[type];
            }
        }
        setStreamDataBuffer(type, new StreamDataBuffer(type,
                _bufferMaxSizes[type], _bufferMaxChunkSizes[type]));
    }
    return _streams[type];
}
StreamDataBuffer * DataManager :: getStreamBuffer ( const QString & type ) { Q_ASSERT ( type != " " ) ; if ( ! _streams . contains ( type ) ) { Config :: TreeAddress configAddress ( _bufferConfigBaseAddress ) ; configAddress << Config :: NodeId ( type , " " ) ; ConfigNode config = _config -> get ( configAddress ) ; if ( ! _bufferMaxSizes . contains ( type ) ) { _bufferMaxSizes [ type ] = config . getOption ( " " , " " , " " ) . toULongLong ( ) ; } if ( ! _bufferMaxChunkSizes . contains ( type ) ) { _bufferMaxChunkSizes [ type ] = config . getOption ( " " , " " , 0 ) . toULongLong ( ) ; if ( ! _bufferMaxChunkSizes [ type ] ) { _bufferMaxChunkSizes [ type ] = _bufferMaxSizes [ type ] ; } } setStreamDataBuffer ( type , new StreamDataBuffer ( type , _bufferMaxSizes [ type ] , _bufferMaxChunkSizes [ type ] ) ) ; } return _streams [ type ] ; }
@details
 This method sets up a stream buffer for the specified data type
 if it does not already exist.
@details This method sets up a stream buffer for the specified data type if it does not already exist .