-
Notifications
You must be signed in to change notification settings - Fork 278
Description
The existing Time class must have a clock type. In use cases where you just want to represent a time (which could e.g. come from a message with a time field) that data structure isn't suitable since there isn't a specific clock associated to the time.
But on the other hand you want to be able to leverage the features available in the existing time class (like conversion to nanoseconds, operations, normalization of the seconds / nanoseconds.
Therefore I would propose to have a Time class which only contains the data. and a separate TimeWithClock (names just for illustration) which contains an instance of the Time class and a clock (which performs the checks for same clocks before applying the operators defined in the Time class).
--
An alternative would be to use the builtin_interfaces/Time message as the data type but that would require that this data structure can be enhanced with operators and accessors.