Skip to content

semester_tasks #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

Stargazer2005
Copy link

topology sort algorithm (further will be extended to package manger simulating prorgram)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions


dg_1.AddDirEdge(0, 1);

PackageManager packman_1(dg_1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);


dg_2.AddDirEdge(0, 1);

PackageManager packman_2(dg_2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_2' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_2(dg_2);
PackageManager const packman_2(dg_2);

dg_3.AddDirEdge(2, 3);
dg_3.AddDirEdge(3, 4);

PackageManager packman_3(dg_3);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_3' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_3(dg_3);
PackageManager const packman_3(dg_3);

dg_4.AddDirEdge(4, 6);
dg_4.AddDirEdge(5, 7);
dg_4.AddDirEdge(6, 7);
PackageManager packman_4(dg_4);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_4' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_4(dg_4);
PackageManager const packman_4(dg_4);

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions


dg_1.AddDirEdge(0, 1);

PackageManager packman_1(dg_1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);


dg_2.AddDirEdge(0, 1);

PackageManager packman_2(dg_2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_2' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_2(dg_2);
PackageManager const packman_2(dg_2);

dg_3.AddDirEdge(2, 3);
dg_3.AddDirEdge(3, 4);

PackageManager packman_3(dg_3);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_3' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_3(dg_3);
PackageManager const packman_3(dg_3);

dg_4.AddDirEdge(4, 6);
dg_4.AddDirEdge(5, 7);
dg_4.AddDirEdge(6, 7);
PackageManager packman_4(dg_4);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_4' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_4(dg_4);
PackageManager const packman_4(dg_4);

@Stargazer2005 Stargazer2005 changed the title task_01 semestr_tasks Oct 31, 2024
@Stargazer2005 Stargazer2005 changed the title semestr_tasks semester_tasks Oct 31, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

}

protected:
std::vector<std::shared_ptr<Vertex<T>>> vertices_;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]

  std::vector<std::shared_ptr<Vertex<T>>> vertices_;
                                          ^


dg_1.AddDirEdge(0, 1);

PackageManager packman_1(dg_1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);


dg_2.AddDirEdge(0, 1);

PackageManager packman_2(dg_2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_2' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_2(dg_2);
PackageManager const packman_2(dg_2);

dg_3.AddDirEdge(2, 3);
dg_3.AddDirEdge(3, 4);

PackageManager packman_3(dg_3);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_3' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_3(dg_3);
PackageManager const packman_3(dg_3);

dg_4.AddDirEdge(4, 6);
dg_4.AddDirEdge(5, 7);
dg_4.AddDirEdge(6, 7);
PackageManager packman_4(dg_4);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'packman_4' of type 'PackageManager' can be declared 'const' [misc-const-correctness]

Suggested change
PackageManager packman_4(dg_4);
PackageManager const packman_4(dg_4);

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 15 out of 40. Check the log or trigger a new build to see more.

};

template <typename T, typename VT>
concept IsVertex = std::is_base_of<Vertex<VT>, T>::value;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'concept' [clang-diagnostic-error]

concept IsVertex = std::is_base_of<Vertex<VT>, T>::value;
^

/// @tparam VertexType
/// @tparam T
template <typename VertexType, typename T>
requires IsVertex<VertexType, T>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: expected ';' at end of declaration [clang-diagnostic-error]

Suggested change
requires IsVertex<VertexType, T>
requires IsVertex<VertexType, T>;

/// @tparam VertexType
/// @tparam T
template <typename VertexType, typename T>
requires IsVertex<VertexType, T>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'requires' [clang-diagnostic-error]

  requires IsVertex<VertexType, T>
  ^

/// @tparam VertexType
/// @tparam T
template <typename VertexType, typename T>
requires IsVertex<VertexType, T>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list [clang-diagnostic-error]

Suggested change
requires IsVertex<VertexType, T>
requires IsVertex

/// @tparam T
template <typename VertexType, typename T>
requires IsVertex<VertexType, T>
class Graph {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: constructor does not initialize these fields: vertices_ [cppcoreguidelines-pro-type-member-init]

lib/src/graph.hpp:209:

-   std::vector<std::shared_ptr<VertexType>> vertices_;
+   std::vector<std::shared_ptr<VertexType>> vertices_{};

* @param vertex
* @return size_t
*/
size_t Find(const T &vertex) const {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'T' [clang-diagnostic-error]

  size_t Find(const T &vertex) const {
                    ^

* Remove a vertex from the graph
* @param vertex
*/
virtual void RemoveVertex(std::shared_ptr<VertexType> vertex) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]

  virtual void RemoveVertex(std::shared_ptr<VertexType> vertex) {
                                            ^

* @param source
* @param target
*/
virtual void AddDirEdge(std::shared_ptr<VertexType> source,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]

  virtual void AddDirEdge(std::shared_ptr<VertexType> source,
                                          ^

* @param target
*/
virtual void AddDirEdge(std::shared_ptr<VertexType> source,
std::shared_ptr<VertexType> target) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]

                          std::shared_ptr<VertexType> target) {
                                          ^

* @param source
* @param target
*/
virtual void RemoveDirEdge(std::shared_ptr<VertexType> source,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]

  virtual void RemoveDirEdge(std::shared_ptr<VertexType> source,
                                             ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants