PickNikRobotics / data_tamer

C++ library for Fearless Timeseries Logging
MIT License
199 stars 20 forks source link

Add example #5

Closed henrygerardmoore closed 10 months ago

henrygerardmoore commented 10 months ago

Currently, this example doesn't work and I'm not sure why. I was trying to make an example to show how to make an automatically managed shared ptr so that one could add logging to their application more easily. With this, the type is just std::shared_ptr<T> rather than std::shared_ptr<DataTamer::LoggedValue<T>> for a type T. Not sure this is necessary/useful, but I also figured it would be helpful for learning how to use DataTamer while making this example.

This builds and runs without error but doesn't log as I would expect. Maybe a better name than raii would be log_shared_ptr or something.

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (2cd0d31) 65.15% compared to head (76e804d) 65.19%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5 +/- ## ========================================== + Coverage 65.15% 65.19% +0.04% ========================================== Files 12 12 Lines 861 862 +1 ========================================== + Hits 561 562 +1 Misses 300 300 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

henrygerardmoore commented 10 months ago

After some discussion, will be closing this as the functionality doesn't really add anything. The logging wouldn't be thread-safe in this case, so kind of defeats the purpose of having a shared pointer.