
#include <cmath>
#include <complex>
#include <algorithm>
#include <iostream>

#include "hark-lib/node/NOT.h"

namespace hark
{
namespace node
{
    NOT::NOT():
        NodeDef("NOT")
    {
        *this
            << Terminal::in("INPUT")
            >> Terminal::out("OUTPUT");
    }

    void
    NOT::reset()
    {
    }

    void
    NOT::initialize(InputDataBundle &input)
    {
    }

    bool
    NOT::operator () (size_t count, InputDataBundle &input, OutputDataBundle &output)
    {
#ifdef DEBUG
        ptime start_time;
        ptime end_time;
        start_time = microsec_clock::local_time();
#endif

        output["OUTPUT"].push(data::create<bool>(!input["INPUT"].last().as<bool>()));

#ifdef DEBUG
        end_time = microsec_clock::local_time();
        std::cout << end_time - start_time << std::endl;
#endif

        return true;
    }
}
}

/* end of file */
