/** \file
 *
 *  Contains the LogSplitterComponent class implementation.
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#include "LogSplitterComponent.h"

#include "data/UniversalDataWriter.h"
#include "supervisor/Supervisor.h"

LogSplitterComponent::LogSplitterComponent()
    : SyncLoggerComponent( "LogSplitter", NULL ),
      anyDataRequested_( false )
{
    communicationsWriter_ = newUniversalWriter( UniversalURI::PLATFORM_COMMUNICATIONS );
}

void LogSplitterComponent::run()
{
    if( communicationsWriter_->isAnyDataRequested() != anyDataRequested_ )
    {
        anyDataRequested_ = !anyDataRequested_;
        if( anyDataRequested_ )
        {
            Supervisor::IncrementShoreFile();
        }
    }

}
