forked from kothiga/hri-physio
-
Notifications
You must be signed in to change notification settings - Fork 1
C Core Guidelines: Stream Module
Ayush Salunke edited this page Mar 5, 2025
·
22 revisions
-
Before Clang-tidy test:

-
Guidelines followed:
- ES: Expressions and statements
- ES.45: Avoid “magic constants”; use symbolic constants
- ES: Expressions and statements
-
After Clang-tidy test:

-
Before CLang-tidy test:

-
Guidelines followed:
- C: Classes and class hierarchies
- C.21: If you define or =delete any copy, move, or destructor function, define or =delete them all. Add default implementations for special member functions to follow the Rule of Five.
- C.35: A base class destructor should be either public and virtual, or protected and non-virtual. Since CsvStreamer is derived from StreamerInterface, it should have a virtual destructor to ensure proper cleanup of derived class objects when deleted via a base class pointer.
- C: Classes and class hierarchies
-
After Clang-tidy test:

-
Before Clang-tidy test:

-
Guidelines followed:
-
ES: Expressions and statements
-
I: Interfaces
- I.11: Never transfer ownership by a raw pointer (T*) or reference (T&)
-
-
After Clang-tidy test:

-
Before Clang-tidy test:

-
Guidelines followed:
- C: Classes and class hierarchies
- C.21: If you define or =delete any copy, move, or destructor function, define or =delete them all. Add default implementations for special member functions to follow the Rule of Five.
- C.35: A base class destructor should be either public and virtual, or protected and non-virtual. Since CsvStreamer is derived from StreamerInterface, it should have a virtual destructor to ensure proper cleanup of derived class objects when deleted via a base class pointer.
- C: Classes and class hierarchies
-
After Clang-tidy test:

-
Before Clang-tidy test:

-
Guidelines followed:
- Pro safety: Type-safety profile
- Type.6: Always initialize a data member: always initialize, possibly using default constructors or default member initializers. Clang-Tidy is complaining because sub and pub are uninitialized. The fix is explicit member initialization.
- ES: Expressions and statements
- ES.45: Avoid “magic constants”; use symbolic constants. There was a magic number 1000 in pub_buffer, replaced that with a variable.
- A Missing ROS header file error persists even though the header file exists and is in the correct directory. This error is related to the fact that the library cannot communicate properly with the ROS libraries in the local machine. The error can also be caused by the library requiring an ROS1 interface rather than ROS2.
- Pro safety: Type-safety profile
-
After Clang-tidy test:

-
Before Clang-tidy test:

-
Guidelines followed:
- Pro safety: Type-safety profile
- Type.6: Always initialize a data member: always initialize, possibly using default constructors or default member initializers. Clang-Tidy is complaining because sampling_rate and var, are uninitialized. The fix is explicit member initialization.
- Pro safety: Type-safety profile
-
After Clang-tidy test:

-
Before Clang-tidy test:

-
Guidelines followed:
- C: Classes and class hierarchies
- C.21: If you define or =delete any copy, move, or destructor function, define or =delete them all. Add default implementations for special member functions to follow the Rule of Five.
- C.35: A base class destructor should be either public and virtual, or protected and non-virtual. Since CsvStreamer is derived from StreamerInterface, it should have a virtual destructor to ensure proper cleanup of derived class objects when deleted via a base class pointer.
- C: Classes and class hierarchies
-
Before Clang-tidy test:

-
Guidelines followed:
- Pro safety: Type-safety profile
- Type.6: Always initialize a data member: always initialize, possibly using default constructors or default member initializers. Clang-Tidy is complaining because temp is uninitialized. The fix is explicit member initialization.
- Pro safety: Type-safety profile
-
After Clang-tidy test:
