- 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
#define ACCELEROMETER_X 0
#define ACCELEROMETER_Y 1
Should be replaced with
#define CURE_ACCELEROMETER_X 0
#define CURE_ACCELEROMETER_Y 1
OR (for even less ambiguity)
#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:
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) {
}
include/data_handling/DataNames.hhave name conflicts with the sensor drivers and other systems.CURE_prefix to all their names.CURE_DATALOG_, but I want to avoid the names getting too long.Example
Should be replaced with
OR (for even less ambiguity)
Question
Can you think a situation where it would make sense for
CURE_ACCELEROMETER_XandCURE_DATA_ACCELEROMETER_Xto have two different definitions? If not, then we should just useCURE_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: