/*
** Copyright 2016 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
** For more information : contact@centreon.com
*/

#include <cmath>
#include "com/centreon/broker/bam/bool_not_equal.hh"

using namespace com::centreon::broker::bam;

/**
 *  Default constructor.
 */
bool_not_equal::bool_not_equal() {}

/**
 *  Copy constructor.
 *
 *  @param[in] other  Object to copy.
 */
bool_not_equal::bool_not_equal(bool_not_equal const& other)
  : bool_binary_operator(other) {}

/**
 *  Destructor.
 */
bool_not_equal::~bool_not_equal() {}

/**
 *  Assignment operator.
 *
 *  @param[in] other  Object to copy.
 *
 *  @return This object.
 */
bool_not_equal& bool_not_equal::operator=(bool_not_equal const& other) {
  bool_binary_operator::operator=(other);
  return (*this);
}

/**
 *  Get the hard value.
 *
 *  @return Evaluation of the expression with hard values.
 */
double bool_not_equal::value_hard() {
  return ((std::fabs(_left_hard - _right_hard) >= COMPARE_EPSILON)
          ? 1.0
          : 0.0);
}

/**
 *  Get the soft value.
 *
 *  @return Evaluation of the expression with soft values.
 */
double bool_not_equal::value_soft() {
  return ((std::fabs(_left_soft - _right_soft) >= COMPARE_EPSILON)
          ? 1.0
          : 0.0);
}
