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

#ifndef SENDDATACOMPONENT_H_
#define SENDDATACOMPONENT_H_

#include "component/Behavior.h"
#include "logger/LogWriter.h"
#include "utils/FlexArray.h"

class DataReader;
class MissionItem;
class MissionNode;
class Module;
class SendDestination;

/**
 *  Behavior that is embedded in scripted code within a mission file.
 *
 *  \ingroup missionScript
 */

class SendDataComponent: public Behavior
{
public:
    static SendDataComponent* Instance( MissionNode* node, const Str& itemName, MissionItem* parent, const Module* module, Logger& logger );
    virtual ~SendDataComponent();
    virtual void initialize();
    virtual void run();
    virtual bool runIfUnsatisfied();
    virtual void uninitialize();

protected:

    /// Protected constructor
    SendDataComponent( const Str& name );

    FlexArray<DataReader*> dataReaders_;
    Service::ServiceType serviceType_;
    SendDestination* destination_;

private:
    // Note that the copy constructor below is private and not given a body.
    // Any attempt to call it will return a compiler error.
    SendDataComponent( const SendDataComponent& old ); // disallow copy constructor
};

#endif /* SENDDATACOMPONENT_H_ */
