/*
   HARK Library
   Copyright (C) 2021 Honda Research Institute Japan Inc.
 */

#if !defined(_HARKLIB_NODE_ESTIMATE_TF_H_INCLUDED_)
#define _HARKLIB_NODE_ESTIMATE_TF_H_INCLUDED_ 1

#include "hark-lib/hark-lib.h"
#include "hark-lib/node.h"
#include "hark-lib/matrix.h"
#include "hark-lib/source.h"
#include "hark-lib/tf.h"

#include "hark-lib/node/EstimationTransferFunction.hpp"

namespace hark
{
namespace node
{
    class EstimateTF: public NodeDef
    {
    public:
        EstimateTF();

        void initialize(InputDataBundle &input);
        virtual void reset();
        virtual bool operator () (size_t count, InputDataBundle &input, OutputDataBundle &output);

        enum class INPUT_TYPE : int { INPUT_TF, INPUT_INTERMEDIATE };
        enum class INITIAL_TF : int { OUTPUT_ALL, OUTPUT_PARTIAL };

    private:
        std::string filename;
        INITIAL_TF initial_tf;
        int num_frequency;
        int num_channel;
        int num_source;
        int in_progress;
        int is_senddata;
        int is_reset;
        int is_sendall;
        int target_count;
        int iocnt;
        int lookback_count;

        std::unique_ptr<EstimationTransferFunction> estimater;
    };
}
}

#endif /* #if !defined(_HARKLIB_NODE_ESTIMATE_TF_H_INCLUDED_) */

/* end of file */
