Program Listing for File base_entity.hpp

Return to documentation for file (cosm/repr/base_entity.hpp)

#pragma once

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include "rcppsw/types/type_uuid.hpp"

#include "cosm/cosm.hpp"
#include "cosm/repr/entity_dimensionality.hpp"

/*******************************************************************************
 * Namespaces
 ******************************************************************************/
namespace cosm::repr {

/*******************************************************************************
 * Class Definitions
 ******************************************************************************/
class base_entity {
 public:
  base_entity(void) : base_entity{ rtypes::constants::kNoUUID } {}
  explicit base_entity(const rtypes::type_uuid& id) : m_id(id) {}

  base_entity(const base_entity&) = default;
  base_entity& operator=(const base_entity&) = default;

  virtual ~base_entity(void) = default;

  void id(const rtypes::type_uuid& id) { m_id = id; }

  const rtypes::type_uuid& id(void) const { return m_id; }

  void vis_id(bool b) { m_vis_id = b; }

  bool vis_id(void) const { return m_vis_id; }

 private:
  /* clang-format off */
  bool              m_vis_id{false};
  rtypes::type_uuid m_id{rtypes::constants::kNoUUID};
  /* clang-format on */
};

} /* namespace cosm::repr */