pelican/server/src/ChunkerManager.cpp
/**
 * @details
 * Initialises the registered chunkers and calls the start() method on each
 * data receiver.
 */
@details
Initialises the registered chunkers and calls the start() method on each
data receiver.
@details Initialises the registered chunkers and calls the start () method on each data receiver .
bool ChunkerManager::init(DataManager& dataManager)
{
    foreach (const QString& type, _streamDataTypes) {
        dataManager.getStreamBuffer(type);
    }
    foreach (const QString& type, _serviceDataTypes) {
        dataManager.getServiceBuffer(type);
    }
    try {
        foreach (AbstractChunker* chunker, _chunkers) {
            chunker->setDataManager(&dataManager);
            DataReceiver* receiver = new DataReceiver(chunker);
            _dataReceivers.insert(chunker, receiver);
            receiver->start();
#if 0 
            while (!receiver->isRunning()) { sleep(1); }
#endif
        }
    }
    catch (const QString& msg)
    {
        std::cerr << "Error Initiating Chunkers: " << msg.toStdString() << std::endl;
        return false;
    }
    return true;
}
bool ChunkerManager :: init ( DataManager & dataManager ) { foreach ( const QString & type , _streamDataTypes ) { dataManager . getStreamBuffer ( type ) ; } foreach ( const QString & type , _serviceDataTypes ) { dataManager . getServiceBuffer ( type ) ; } try { foreach ( AbstractChunker * chunker , _chunkers ) { chunker -> setDataManager ( & dataManager ) ; DataReceiver * receiver = new DataReceiver ( chunker ) ; _dataReceivers . insert ( chunker , receiver ) ; receiver -> start ( ) ; #if 0 while ( ! receiver -> isRunning ( ) ) { sleep ( 1 ) ; } #endif } } catch ( const QString & msg ) { std :: cerr << " " << msg . toStdString ( ) << std :: endl ; return false ; } return true ; }
@details
 Initialises the registered chunkers and calls the start() method on each
 data receiver.
@details Initialises the registered chunkers and calls the start () method on each data receiver .
// Create the stream and service data buffers. // Set up data-stream inputs. // needed? note the isRunning() method below on ChunkerManager (this class)