vendredi 26 janvier 2018

C++ implementation of GPS clock representation based on std::chrono

I'm updating my C++ skills to Modern C++ and I'm happy to come across the std::chrono abstraction.

I'm working on a project that interfaces with GPS receivers in a very low-level way. GPS time is internally represented as weeks since the GPS epoch, and seconds into the week. The seconds roll over every 604,800 seconds as the week increments.

I have some legacy code that typically deals just with the seconds of week (SOW) portion, but needs to handle the week rollover case. This whole thing just begs for an encapsulated implementation, and std::chrono seems designed for this task.

Before I go off and write something, is there an implementation that I can use already available?

Aucun commentaire:

Enregistrer un commentaire