Program Listing for File cell2D_op.hpp

Return to documentation for file (cosm/ds/operations/cell2D_op.hpp)

#pragma once

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include "rcppsw/math/vector2.hpp"
#include "rcppsw/patterns/visitor/visitor.hpp"

#include "cosm/cosm.hpp"

/*******************************************************************************
 * Namespaces
 ******************************************************************************/
namespace cosm::ds {
class cell2D;
}
namespace cosm::fsm {
class cell2D_fsm;
}

namespace cosm::ds::operations {

/*******************************************************************************
 * Class Definitions
 ******************************************************************************/
class cell2D_op {
 protected:
  explicit cell2D_op(const rmath::vector2z& coord) : m_coord(coord) {}

 public:
  using visit_typelist = rmpl::typelist<ds::cell2D, fsm::cell2D_fsm>;

  virtual ~cell2D_op(void) = default;

  size_t x(void) const { return m_coord.x(); }
  size_t y(void) const { return m_coord.y(); }

  const rmath::vector2z& coord(void) const { return m_coord; }

 private:
  /* clang-format on */
  rmath::vector2z m_coord;
  /* clang-format off */
};

using cell2D_op_visitor = rpvisitor::filtered_visitor<cell2D_op>;

} /* namespace cosm::ds::operations */