/** \file
 *
 *  Contains the AsyncPiEstimator class declarations.
 *
 *  AsyncPiEstimator.h should only be included by AsyncPiEstimator.cpp
 *  Other classes should include AsyncPiEstimatorIF.h
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#ifndef ASYNCPIESTIMATOR_H_
#define ASYNCPIESTIMATOR_H_

#include "component/AsyncComponent.h"

class Measurement;

/**
 *  This Component uses an iterative method to calculate pi.
 *  Runs in its own thread, and written to burn cycles.
 *
 *  \ingroup modules_sample
 */
class AsyncPiEstimator : public AsyncComponent
{
public:

    AsyncPiEstimator( const Module* module );

    virtual ~AsyncPiEstimator();

    /// Initialize function
    void initialize( void );

    /// The actual "payload" of the component
    void run();

    /// Uninit function
    void uninitialize( void );

    void reset();

protected:

    DataWriter *piEstimateWriter_;
    double piEstimate_;
    double denominator_;

};

#endif /*ASYNCPIESTIMATOR_H_*/
