Remove "maybe unused" as that is not helping

This commit is contained in:
James P. Howard, II
2022-08-02 19:09:05 -04:00
parent cddf317ee6
commit 3faa5b4c50
13 changed files with 40 additions and 40 deletions

View File

@@ -49,14 +49,14 @@ std::shared_ptr<std::ranlux24> rng = nullptr;
template <>
struct fmt::formatter<kami::AgentID> : fmt::formatter<std::string> {
[[maybe_unused]] static auto format(kami::AgentID agent_id, format_context &ctx) {
static auto format(kami::AgentID agent_id, format_context &ctx) {
return format_to(ctx.out(), "{}", agent_id.to_string());
}
};
template <>
struct fmt::formatter<kami::GridCoord1D> : fmt::formatter<std::string> {
[[maybe_unused]] static auto format(const kami::GridCoord1D& coord, format_context &ctx) {
static auto format(const kami::GridCoord1D& coord, format_context &ctx) {
return format_to(ctx.out(), "{}", coord.to_string());
}
};

View File

@@ -48,14 +48,14 @@ std::shared_ptr<std::ranlux24> rng = nullptr;
template <>
struct fmt::formatter<kami::AgentID> : fmt::formatter<std::string> {
[[maybe_unused]] static auto format(kami::AgentID agent_id, format_context &ctx) {
static auto format(kami::AgentID agent_id, format_context &ctx) {
return format_to(ctx.out(), "{}", agent_id.to_string());
}
};
template <>
struct fmt::formatter<kami::GridCoord2D> : fmt::formatter<std::string> {
[[maybe_unused]] static auto format(const kami::GridCoord2D& coord, format_context &ctx) {
static auto format(const kami::GridCoord2D& coord, format_context &ctx) {
return format_to(ctx.out(), "{}", coord.to_string());
}
};

View File

@@ -49,7 +49,7 @@ namespace kami {
* @details Moore neighborhood types include diagonally-adjacent cells as
* neighbors.
*/
Moore [[maybe_unused]],
Moore,
/**
* @brief Von Neumann neighborhood
@@ -57,7 +57,7 @@ namespace kami {
* @details Von Neumann neighborhood types do not include
* diagonally-adjacent cells as neighbors.
*/
VonNeumann [[maybe_unused]]
VonNeumann
};
/**
@@ -71,7 +71,7 @@ namespace kami {
* connecting two points. This is commonly called a "beeline" or
* "as the crow flies."
*/
Euclidean [[maybe_unused]],
Euclidean,
/**
* @brief Manhattan distance.
@@ -81,7 +81,7 @@ namespace kami {
* "taxicab distance," "rectilinear distance," or many other [formal
* names](https://en.wikipedia.org/wiki/Taxicab_geometry).
*/
Manhattan [[maybe_unused]]
Manhattan
};
/**

View File

@@ -119,7 +119,7 @@ namespace kami {
*
* @returns false if the agent is not removed, otherwise, true.
*/
[[maybe_unused]] [[maybe_unused]] bool delete_agent(AgentID agent_id);
bool delete_agent(AgentID agent_id);
/**
* Remove agent from the grid at the specified location
@@ -184,7 +184,7 @@ namespace kami {
*
* @return true if the grid wraps, and false otherwise
*/
[[maybe_unused]] [[maybe_unused]] [[nodiscard]] bool get_wrap_x() const;
[[nodiscard]] bool get_wrap_x() const;
/**
* Return the neighborhood of the specified Agent
@@ -215,7 +215,7 @@ namespace kami {
*
* @return the length of the grid in the `x` dimension
*/
[[maybe_unused]] [[nodiscard]] unsigned int get_maximum_x() const;
[[nodiscard]] unsigned int get_maximum_x() const;
protected:
/**

View File

@@ -130,7 +130,7 @@ namespace kami {
*
* @returns false if the agent is not removed, otherwise, true.
*/
[[maybe_unused]] bool delete_agent(AgentID agent_id);
bool delete_agent(AgentID agent_id);
/**
* Remove agent from the grid at the specified location
@@ -195,14 +195,14 @@ namespace kami {
*
* @return true if the grid wraps, and false otherwise
*/
[[maybe_unused]] [[nodiscard]] bool get_wrap_x() const;
[[nodiscard]] bool get_wrap_x() const;
/**
* Inquire to whether the grid wraps in the `y` dimension.
*
* @return true if the grid wraps, and false otherwise
*/
[[maybe_unused]] [[nodiscard]] bool get_wrap_y() const;
[[nodiscard]] bool get_wrap_y() const;
/**
* Return the neighborhood of the specified Agent
@@ -239,14 +239,14 @@ namespace kami {
*
* @return the length of the grid in the `x` dimension
*/
[[maybe_unused]] [[nodiscard]] unsigned int get_maximum_x() const;
[[nodiscard]] unsigned int get_maximum_x() const;
/**
* Get the size of the grid in the `y` dimension.
*
* @return the length of the grid in the `xy dimension
*/
[[maybe_unused]] [[nodiscard]] unsigned int get_maximum_y() const;
[[nodiscard]] unsigned int get_maximum_y() const;
protected:
/**

View File

@@ -41,7 +41,7 @@ namespace kami {
class Population;
class Scheduler;
[[maybe_unused]] inline semver::version get_version() { return version; }
inline semver::version get_version() { return version; }
} // namespace kami

View File

@@ -53,7 +53,7 @@ namespace kami {
*
* @param[in] n the number of time steps to execute.
*/
[[maybe_unused]] virtual void run(unsigned int n) = 0;
virtual void run(unsigned int n) = 0;
/**
* Execute a single time-step for the model.
@@ -66,7 +66,7 @@ namespace kami {
/**
* @brief Get the `Domain` associated with this model
*/
[[maybe_unused]] std::shared_ptr<Domain> get_domain();
std::shared_ptr<Domain> get_domain();
/**
* @brief Add a `Domain` to this scheduler
@@ -74,7 +74,7 @@ namespace kami {
* @details This method will associate a model with the
* scheduler.
*/
[[maybe_unused]] void set_domain(std::shared_ptr<Domain> domain);
void set_domain(std::shared_ptr<Domain> domain);
/**
* @brief Get the `Population` associated with this model
@@ -87,12 +87,12 @@ namespace kami {
* @details This method will associate a model with the
* scheduler.
*/
[[maybe_unused]] void set_population(std::shared_ptr<Population> population);
void set_population(std::shared_ptr<Population> population);
/**
* @brief Get the `Scheduler` associated with this model
*/
[[maybe_unused]] std::shared_ptr<Scheduler> get_scheduler();
std::shared_ptr<Scheduler> get_scheduler();
/**
* @brief Add a `Model` to this scheduler
@@ -100,7 +100,7 @@ namespace kami {
* @details This method will associate a model with the
* scheduler.
*/
[[maybe_unused]] void set_scheduler(std::shared_ptr<Scheduler> scheduler);
void set_scheduler(std::shared_ptr<Scheduler> scheduler);
};
} // namespace kami

View File

@@ -63,7 +63,7 @@ namespace kami {
*
* @param agent_id The AgentID of the agent to remove.
*/
[[maybe_unused]] void delete_agent(AgentID agent_id);
void delete_agent(AgentID agent_id);
/*
* Returns the agent list.

View File

@@ -46,7 +46,7 @@ namespace kami {
*
* @note First create a Model for the scheduler to live in.
*/
class LIBKAMI_EXPORT [[maybe_unused]] StagedScheduler : public SequentialScheduler {
class LIBKAMI_EXPORT StagedScheduler : public SequentialScheduler {
private:
/**
* @brief Advance a single time step.

View File

@@ -64,7 +64,7 @@ namespace kami {
delete[] _agent_grid;
}
[[maybe_unused]] bool Grid1D::delete_agent(AgentID agent_id) {
bool Grid1D::delete_agent(AgentID agent_id) {
GridCoord1D coord = get_location_by_agent(agent_id);
return delete_agent(agent_id, coord);
@@ -137,9 +137,9 @@ namespace kami {
return nullptr;
}
[[maybe_unused]] bool Grid1D::get_wrap_x() const { return _wrap_x; }
bool Grid1D::get_wrap_x() const { return _wrap_x; }
[[maybe_unused]] unsigned int Grid1D::get_maximum_x() const { return _maximum_x; }
unsigned int Grid1D::get_maximum_x() const { return _maximum_x; }
GridCoord1D Grid1D::get_location_by_agent(AgentID agent_id) const {
return _agent_index->at(agent_id);

View File

@@ -80,7 +80,7 @@ namespace kami {
delete[] _agent_grid;
}
[[maybe_unused]] bool Grid2D::delete_agent(AgentID agent_id) {
bool Grid2D::delete_agent(AgentID agent_id) {
auto coord = get_location_by_agent(agent_id);
return delete_agent(agent_id, coord);
@@ -121,8 +121,8 @@ namespace kami {
return false;
}
[[maybe_unused]] bool Grid2D::get_wrap_x() const { return _wrap_x; }
[[maybe_unused]] bool Grid2D::get_wrap_y() const { return _wrap_y; }
bool Grid2D::get_wrap_x() const { return _wrap_x; }
bool Grid2D::get_wrap_y() const { return _wrap_y; }
std::vector<GridCoord2D> Grid2D::get_neighborhood(
AgentID agent_id, GridNeighborhoodType neighborhood_type,
@@ -196,8 +196,8 @@ namespace kami {
return nullptr;
}
[[maybe_unused]] unsigned int Grid2D::get_maximum_x() const { return _maximum_x; }
[[maybe_unused]] unsigned int Grid2D::get_maximum_y() const { return _maximum_y; }
unsigned int Grid2D::get_maximum_x() const { return _maximum_x; }
unsigned int Grid2D::get_maximum_y() const { return _maximum_y; }
GridCoord2D Grid2D::coord_wrap(const GridCoord2D& coord) const {
auto x = coord.get_x_location();

View File

@@ -31,27 +31,27 @@
namespace kami {
[[maybe_unused]] [[maybe_unused]] std::shared_ptr<Domain> Model::get_domain() {
std::shared_ptr<Domain> Model::get_domain() {
return(_domain);
}
[[maybe_unused]] void Model::set_domain(std::shared_ptr<Domain> domain) {
void Model::set_domain(std::shared_ptr<Domain> domain) {
_domain = std::move(domain);
}
[[maybe_unused]] std::shared_ptr<Population> Model::get_population() {
std::shared_ptr<Population> Model::get_population() {
return(_pop);
}
[[maybe_unused]] void Model::set_population(std::shared_ptr<Population> population) {
void Model::set_population(std::shared_ptr<Population> population) {
_pop = std::move(population);
}
[[maybe_unused]] [[maybe_unused]] std::shared_ptr<Scheduler> Model::get_scheduler() {
std::shared_ptr<Scheduler> Model::get_scheduler() {
return(_sched);
}
[[maybe_unused]] void Model::set_scheduler(std::shared_ptr<Scheduler> scheduler) {
void Model::set_scheduler(std::shared_ptr<Scheduler> scheduler) {
_sched = std::move(scheduler);
}

View File

@@ -47,6 +47,6 @@ namespace kami {
this->_rng = std::move(rng);
}
[[maybe_unused]] std::shared_ptr<std::ranlux24> RandomScheduler::get_rng() { return (this->_rng); }
std::shared_ptr<std::ranlux24> RandomScheduler::get_rng() { return (this->_rng); }
} // namespace kami