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

#ifndef SYNCHANDLER_H_
#define SYNCHANDLER_H_

#include "component/Component.h"
#include "utils/Mutex.h"
#include "process/MultiHandler.h"

/**
 *  The SyncHandler and ControlThread are a bit of a strange
 *  arrangement.  ControlThread is a Component, which is a "thin wrapper"
 *  around the SyncHandler.  The SyncHandler, in turn is a
 *  container for all of the Components "owned" by the ControlThread.
 *  This maintains the handler->component->handler->component
 *  relationship.  Specifically:
 *
 *  ThreadHandler->ControlThread->SyncHandler->(components)
 *
 *  There's a bit of a balance of power between the two, though most of the
 *  "smarts" are in the SyncHandler.
 *
 *  \ingroup supervisor
 */
class SyncHandler : public MultiHandler
{
public:

    SyncHandler( class ControlThread &controlThread, Logger &logger );

    /// Destructor
    virtual ~SyncHandler();

    /// Run the component itself
    virtual void run()
    {
        MultiHandler::runAll();
    }

};


#endif /*SYNCHANDLER_H_*/
