pelican/server/src/DataManager.cpp
/**
 * @details
 * This method sets up a service 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 service 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 service buffer for the specified data type if it does not already exist . @param [ in ] type The data type held by the buffer .
ServiceDataBuffer* DataManager::getServiceBuffer(const QString& type)
{
    if (!_service.contains(type))
    {
        Config::TreeAddress configAddress(_bufferConfigBaseAddress);
        configAddress << Config::NodeId(type, "");
        ConfigNode config = _config->get(configAddress);
        qulonglong maxSize = config.getOption("buffer", "maxSize", "10240").toULongLong();
        qulonglong maxChunkSize = config.getOption("buffer", "maxChunkSize", 0).toULongLong();
        if (!_bufferMaxSizes.contains(type))
            _bufferMaxSizes[type] = maxSize;
        if (!_bufferMaxChunkSizes.contains(type)) {
            _bufferMaxChunkSizes[type] = maxChunkSize;
            if (!_bufferMaxChunkSizes[type])
                _bufferMaxChunkSizes[type] = _bufferMaxSizes[type];
        }
        setServiceDataBuffer(type, new ServiceDataBuffer(type,
                _bufferMaxSizes[type], _bufferMaxChunkSizes[type]));
    }
    return _service[type];
}
ServiceDataBuffer * DataManager :: getServiceBuffer ( const QString & type ) { if ( ! _service . contains ( type ) ) { Config :: TreeAddress configAddress ( _bufferConfigBaseAddress ) ; configAddress << Config :: NodeId ( type , " " ) ; ConfigNode config = _config -> get ( configAddress ) ; qulonglong maxSize = config . getOption ( " " , " " , " " ) . toULongLong ( ) ; qulonglong maxChunkSize = config . getOption ( " " , " " , 0 ) . toULongLong ( ) ; if ( ! _bufferMaxSizes . contains ( type ) ) _bufferMaxSizes [ type ] = maxSize ; if ( ! _bufferMaxChunkSizes . contains ( type ) ) { _bufferMaxChunkSizes [ type ] = maxChunkSize ; if ( ! _bufferMaxChunkSizes [ type ] ) _bufferMaxChunkSizes [ type ] = _bufferMaxSizes [ type ] ; } setServiceDataBuffer ( type , new ServiceDataBuffer ( type , _bufferMaxSizes [ type ] , _bufferMaxChunkSizes [ type ] ) ) ; } return _service [ type ] ; }
@details
 This method sets up a service buffer for the specified data type
 if it does not already exist.
@details This method sets up a service buffer for the specified data type if it does not already exist .