CURocketEngineering / CURocketEngineering/Avionics
Replace all DataNames with a `CURE_` prefix
- Dominant language
- C++
- Stars
- 2
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
- Some of the data names in the `include/data_handling/DataNames.h` have name conflicts with the sensor drivers and other systems.
- To avoid ambiguity, it would be better to add the `CURE_` prefix to all their names.
- Perhaps there is a better prefix such as `CURE_DATALOG_`, but I want to avoid the names getting too long.
## Example
```c++
#define ACCELEROMETER_X 0
#define ACCELEROMETER_Y 1
```
Should be replaced with
```c++
#define CURE_ACCELEROMETER_X 0
#define CURE_ACCELEROMETER_Y 1
```
OR (for even less ambiguity)
```c++
#define CURE_DATA_ACCELEROMETER_X 0
#define CURE_DATA_ACCELEROMETER_Y 1
```
## Question
Can you think a situation where it would make sense for `CURE_ACCELEROMETER_X` and `CURE_DATA_ACCELEROMETER_X` to have two different definitions? If not, then we should just use `CURE_ACCELEROMETER_X`.
## Alternative
You could instead put the data names as an Enum Class in C++, so you automatically get the class's name as a namespace.
Example:
```C++
enum class DataName {
AccelerometerX = 0,
AccelerometerY = 1,
AccelerometerZ = 2,
GyroscopeX = 3,
GyroscopeY = 4,
GyroscopeZ = 5,
};
// To reference you use the :: operator
if (dataStreamID == DataNames::AccelerometerX) {
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.