Program Listing for File cache_extent_clear.hpp

Return to documentation for file (cosm/arena/operations/cache_extent_clear.hpp)

#pragma once

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include "rcppsw/er/client.hpp"
#include "rcppsw/math/vector2.hpp"
#include "rcppsw/mpl/typelist.hpp"
#include "rcppsw/patterns/visitor/visitor.hpp"

#include "cosm/cosm.hpp"

/*******************************************************************************
 * Namespaces/Decls
 ******************************************************************************/
namespace cosm::arena::repr {
class arena_cache;
}

namespace cosm::arena::ds {
class arena_grid;
} /* namespace cosm::ds */

namespace cosm::arena::operations {
namespace detail {

/*******************************************************************************
 * Class Definitions
 ******************************************************************************/
class cache_extent_clear : public rer::client<cache_extent_clear> {
 private:
  struct visit_typelist_impl {
    using value = rmpl::typelist<cads::arena_grid>;
  };

 public:
  using visit_typelist = visit_typelist_impl::value;

  explicit cache_extent_clear(carepr::arena_cache* victim);
  cache_extent_clear& operator=(const cache_extent_clear&) = delete;
  cache_extent_clear(const cache_extent_clear&) = delete;

  void visit(cads::arena_grid& grid);

 private:
  /* clang-format off */
  carepr::arena_cache* m_victim;
  /* clang-format on */
};

} /* namespace detail */


using cache_extent_clear_visitor = rpvisitor::filtered_visitor<detail::cache_extent_clear>;

} /* namespace cosm::arena::operations */