Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature/boost datetime implementation #2278

Merged
merged 10 commits into from
Aug 28, 2018

Conversation

conlain-k
Copy link
Contributor

@conlain-k conlain-k commented Jun 18, 2018

Addresses #1523.

This PR is ready for review.

Risk

This PR makes major API changes.

Testing Plan

Use ATF and unit tests to ensure that code using datetime utilities still works correctly

Summary

Remove uses of struct timeval and replace it with boost::posix_time::time_duration, allowing platform-independent usage and cleaner use/helper functions. Boost handles most helper functions, with topical wrappers to preserve old functionality and abstract from the underlying implementation.
Also removes useless date_time::DateTime class that just held static members in favor of a flat date_time namespace containing all helper functions.

Note that src/components/telemetry_monitor/src/telemetry_monitor.cc still uses struct timeval as required for the select POSIX call; this should eventually be replaced as well.

Tasks Remaining:

  • Testing for changed behavior -- use of old struct timeval allowed some poorly-defined behavior such as overflowing the tv_usec field (over 1 million microseconds). Boost's implementation doesn't allow mutating specific fields, meaning that changing said behavior could cause a bug.

CLA

also cleans up date_time namespacing but maintains helper functions
@JenkinsSDLOnCloud
Copy link

Can one of the admins verify this patch?

@jacobkeeler jacobkeeler force-pushed the feature/boost_datetime_implementation branch from dec6e04 to 370c752 Compare August 23, 2018 13:11
@jacobkeeler jacobkeeler merged commit 721fcfe into develop Aug 28, 2018
@jacobkeeler jacobkeeler mentioned this pull request Oct 19, 2018
@jacobkeeler jacobkeeler deleted the feature/boost_datetime_implementation branch October 22, 2018 13:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants