Program Listing for File cell3D_op.hpp

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

#pragma once

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

#include "cosm/cosm.hpp"

/*******************************************************************************
 * Namespaces
 ******************************************************************************/
namespace cosm::ds {
class cell3D;
}
namespace cosm::fsm {
class cell3D_fsm;
}

namespace cosm::ds::operations {

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

 public:
  using visit_typelist = rmpl::typelist<ds::cell3D, fsm::cell3D_fsm>;

  virtual ~cell3D_op(void) = default;

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

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

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

using cell3D_op_visitor = rpvisitor::precise_visitor<cell3D_op,
                                                     cell3D_op::visit_typelist>;
} /* namespace cosm::ds::operations */