Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/bdAstar/bdAstar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ class Pgr_bdAstar : public Pgr_bidirectional<G> {
}

~Pgr_bdAstar() = default;

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

Path pgr_bdAstar(V start_vertex, V end_vertex,
int heuristic,
Expand Down
5 changes: 5 additions & 0 deletions include/bdDijkstra/bdDijkstra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ class Pgr_bdDijkstra : public Pgr_bidirectional<G> {

~Pgr_bdDijkstra() = default;

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

Path pgr_bdDijkstra(V start_vertex, V end_vertex, bool only_cost) {
m_log << "pgr_bdDijkstra\n";
v_source = start_vertex;
Expand Down
5 changes: 5 additions & 0 deletions include/chinese/chinesePostman.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class PgrDirectedChPPGraph {
}

~PgrDirectedChPPGraph();

PgrDirectedChPPGraph(const PgrDirectedChPPGraph&) = delete;
PgrDirectedChPPGraph& operator=(const PgrDirectedChPPGraph&) = delete;
PgrDirectedChPPGraph(PgrDirectedChPPGraph&&) = delete;
PgrDirectedChPPGraph& operator=(PgrDirectedChPPGraph&&) = delete;


private:
Expand Down
20 changes: 13 additions & 7 deletions include/cpp_common/assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,19 @@ std::string get_backtrace(const std::string &);
* @brief Extends std::exception and is the exception that we throw if an assert fails.
*/
class AssertFailedException : public std::exception {
private:
const std::string str; ///< Holds what() we got as message

public:
const char *what() const noexcept override;
explicit AssertFailedException(std::string msg);
~AssertFailedException() noexcept override {}
private:
const std::string str; ///< Holds what() we got as message

public:
explicit AssertFailedException(std::string msg);
const char* what() const noexcept override;
~AssertFailedException() noexcept override = default;

AssertFailedException(const AssertFailedException&) = default;
AssertFailedException(AssertFailedException&&) = default;
AssertFailedException& operator=(const AssertFailedException&) = delete; // cannot assign const member
AssertFailedException& operator=(AssertFailedException&&) = delete; // cannot assign const member
};


#endif // INCLUDE_CPP_COMMON_ASSERT_HPP_
4 changes: 4 additions & 0 deletions include/cpp_common/basic_vertex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class Basic_vertex {

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

Basic_vertex(Basic_vertex&&) = default;
Basic_vertex& operator=(Basic_vertex&&) = default;
~Basic_vertex() = default;

Basic_vertex(const Edge_t &other, bool is_source) :
id(is_source? other.source : other.target) {}

Expand Down
6 changes: 6 additions & 0 deletions include/cpp_common/bidirectional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ class Pgr_bidirectional {
}

~Pgr_bidirectional() = default;

Pgr_bidirectional(const Pgr_bidirectional&) = delete;
Pgr_bidirectional& operator=(const Pgr_bidirectional&) = delete;
Pgr_bidirectional(Pgr_bidirectional&&) = delete;
Pgr_bidirectional& operator=(Pgr_bidirectional&&) = delete;


std::string log() const {return m_log.str();}
void clean_log() {m_log.clear();}
Expand Down
13 changes: 13 additions & 0 deletions include/cpp_common/line_vertex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ class Line_vertex {
source(v.source),
target(v.target),
cost(v.cost) {}
Line_vertex& operator=(const Line_vertex &v) {
cp_members(v);
return *this;
}


// Destructor
~Line_vertex() = default;

// Delete move operations
Line_vertex(Line_vertex&&) = delete;
Line_vertex& operator=(Line_vertex&&) = delete;


void cp_members(const Line_vertex &other) {
this->id = other.id;
Expand Down
5 changes: 5 additions & 0 deletions include/cpp_common/messages.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class Pgr_messages {
Pgr_messages() = default;
Pgr_messages(const Pgr_messages&) = delete;
Pgr_messages& operator=(const Pgr_messages&) = delete;

~Pgr_messages() = default;

Pgr_messages(Pgr_messages&&) = delete;
Pgr_messages& operator=(Pgr_messages&&) = delete;

/*! @brief get_log
*
Expand Down
6 changes: 6 additions & 0 deletions include/trsp/trspHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ class TrspHandler : public pgrouting::Pgr_messages {

~TrspHandler(void) = default;

TrspHandler(const TrspHandler&) = delete;
TrspHandler& operator=(const TrspHandler&) = delete;
TrspHandler(TrspHandler&&) = delete;
TrspHandler& operator=(TrspHandler&&) = delete;


std::deque<Path> process(const std::map<int64_t, std::set<int64_t>>&);

void clear();
Expand Down
4 changes: 4 additions & 0 deletions include/vrp/fleet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class Fleet {
/*!@}*/

Fleet& operator=(const Fleet &fleet);
~Fleet() = default; // add destructor
Fleet(Fleet&&) noexcept = default; // enable move constructor
Fleet& operator=(Fleet&&) noexcept = default; // enable move assignment


void set_compatibles(const PD_Orders &orders);

Expand Down
10 changes: 10 additions & 0 deletions include/vrp/pd_problem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,19 @@ class PD_problem {

/** @brief Not wllowing to copy the problem */
PD_problem(const PD_problem &problem) = delete;

/** @brief Not allowing copy assignment */
PD_problem& operator=(const PD_problem&) = delete;

/** @brief Not allowing initialization without information */
PD_problem() = delete;

/** @brief Destructor */
~PD_problem() = default;

/** @brief Prevent move */
PD_problem(PD_problem&&) = delete;
PD_problem& operator=(PD_problem&&) = delete;
};

} // namespace vrp
Expand Down
21 changes: 6 additions & 15 deletions include/vrp/solution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,15 @@ class Solution {
*
*/
Solution();
~Solution() = default; // destructor


/* copy operations */
Solution(const Solution&) = default;
Solution& operator=(const Solution&) = default;

/* @brief copy constructor */
Solution(const Solution &sol) :
EPSILON(0.0001),
fleet(sol.fleet),
trucks(sol.trucks)
{};

/* @brief copy assignment */
Solution& operator = (const Solution& sol) {
EPSILON = 0.0001,
fleet = sol.fleet;
trucks = sol.trucks;
return *this;
};

Solution(Solution&&) = default;
Solution& operator=(Solution&&) = default;

Initials_code get_kind() const;

Expand Down
7 changes: 7 additions & 0 deletions include/withPoints/withPoints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ class Pg_points_graph : public Pgr_messages {
public:
Pg_points_graph() = delete;
Pg_points_graph(const Pg_points_graph &) = delete;
Pg_points_graph& operator=(const Pg_points_graph&) = delete;

~Pg_points_graph() = default;

Pg_points_graph(Pg_points_graph&&) = delete;
Pg_points_graph& operator=(Pg_points_graph&&) = delete;

Pg_points_graph(
std::vector<Point_on_edge_t> p_points,
std::vector<Edge_t> p_edges_to_modify,
Expand Down
10 changes: 10 additions & 0 deletions include/yen/ksp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class Pgr_ksp : public Pgr_messages {
~Pgr_ksp() {
delete m_vis;
}
Pgr_ksp(const Pgr_ksp&) = delete;
Pgr_ksp& operator=(const Pgr_ksp&) = delete;
Pgr_ksp(Pgr_ksp&&) = delete;
Pgr_ksp& operator=(Pgr_ksp&&) = delete;

std::deque<Path> Yen(
G &graph,
Expand Down Expand Up @@ -121,8 +125,14 @@ class Pgr_ksp : public Pgr_messages {

class Visitor {
public:
Visitor() = default;
virtual ~Visitor() {}

Visitor(const Visitor&) = delete;
Visitor& operator=(const Visitor&) = delete;
Visitor(Visitor&&) = delete;
Visitor& operator=(Visitor&&) = delete;

virtual void on_insert_first_solution(const Path) const {
/* noop */
}
Expand Down