diff --git a/Graph.cpp b/Graph.cpp index 0023262..f6f1956 100644 --- a/Graph.cpp +++ b/Graph.cpp @@ -26,6 +26,11 @@ Graph::Graph(Graph&& new_location) noexcept e_capacity(std::exchange(new_location.e_capacity, 0)) {} // End : Construction & Deconstruction +// ----------------------- BEGIN : Printing ----------------------- + + +// ----------------------- END : Printing ----------------------- + // ----------------------- BEGIN : Getters ----------------------- @@ -42,27 +47,27 @@ Edge* Graph::get_p_edges(int p_index) noexcept if(head_idx == -1) return nullptr; return &all_edges[head_idx]; -} +} // ----------------------- END : Getters ----------------------- // ----------------------- BEGIN : Mutators ----------------------- Point* Graph::add_point(std::string name, float x, float y, float z) noexcept { - int target_idx = -1; + int target = -1; if (next_free_point != -1) { - target_idx = next_free_point; + target = next_free_point; // The hijacked 'first_edge' tells us where the NEXT hole is - next_free_point = all_points[target_idx].first_edge; + next_free_point = all_points[target].first_edge; } else if (num_points < p_capacity) { - target_idx = (int)num_points; + target = (int)num_points; num_points++; } else return nullptr; - Point* p = &all_points[target_idx]; + Point* p = &all_points[target]; p->name = name; p->x = x; p->y = y; p->z = z; p->first_edge = -1; diff --git a/documentation/html/annotated.html b/documentation/html/annotated.html deleted file mode 100644 index bf9bc37..0000000 --- a/documentation/html/annotated.html +++ /dev/null @@ -1,111 +0,0 @@ - - -
- - - - -|
- Graph Theory
-
- |
-
|
- Graph Theory
-
- |
-
This is the complete list of members for Graph, including all inherited members.
-| add_edge(int start_point_index, int end_point_index) noexcept | Graph | |
| get_p_edges(int p_index) noexcept | Graph | |
| Graph(size_t maxPoints, size_t maxEdges) noexcept | Graph | |
| Graph(Graph &&other) noexcept | Graph | |
| Graph(const Graph &)=delete (defined in Graph) | Graph | |
| operator=(const Graph &)=delete (defined in Graph) | Graph | |
| ~Graph() | Graph |
|
- Graph Theory
-
- |
-
-Public Member Functions | |
| Graph (size_t maxPoints, size_t maxEdges) noexcept | |
| ~Graph () | |
| Graph (Graph &&other) noexcept | |
| Edge * | get_p_edges (int p_index) noexcept |
| void | add_edge (int start_point_index, int end_point_index) noexcept |
| - | Graph (const Graph &)=delete |
| -Graph & | operator= (const Graph &)=delete |
-
|
- -noexcept | -
| Graph::~Graph | -( | -) | -- |
Deconstruction NOTE on the '~Graph()': The ~ flags this block as a deconstructor. It makes it so this runs before the object is removed from memory preventing memory leaks Find the memory buffers pointed to by all_points and all_edges, and mark that memory as available for other programs to use.
- -
-
|
- -noexcept | -
Move Constructor Instructions to move the current graph object from one memory location to another without copying
- -
-
|
- -noexcept | -
add_edge Adds an edge between two points
-| start_point_index | : the index of the starting point |
| end_point_index | : the index of the ending point |
-
|
- -noexcept | -
Getter Function: get_p_edges Gets the address of the first edge for Point P at index p_index
-| p_index | : The index (int) of the point |
|
- Graph Theory
-
- |
-
|
- Graph Theory
-
- |
-
|
- Graph Theory
-
- |
-
|
- Graph Theory
-
- |
-
|
- Graph Theory
-
- |
-
|
- Graph Theory
-
- |
-