| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "na64calib/indices/range-override.hh" | ||
| 2 | |||
| 3 | #include <ctime> | ||
| 4 | |||
| 5 | namespace na64dp { | ||
| 6 | namespace calib { | ||
| 7 | namespace aux { | ||
| 8 | |||
| 9 | template<> std::string | ||
| 10 | ✗ | key_to_str_for_yaml(std::pair<time_t, uint32_t> timePair) { | |
| 11 | //std::ostringstream oss; | ||
| 12 | //oss << timePair.first << "." << timePair.second; | ||
| 13 | //return oss.str(); | ||
| 14 | char bf[128]; | ||
| 15 | struct tm tmVal; | ||
| 16 | ✗ | gmtime_r( &timePair.first, &tmVal ); | |
| 17 | //char timeBf[26]; // len defined by asctime_r() spec | ||
| 18 | //std::string strTime(asctime_r(&tm_val, timeBf)); | ||
| 19 | //strTime.pop_back(); | ||
| 20 | char tsBuf[64]; | ||
| 21 | ✗ | strftime(tsBuf, sizeof(tsBuf), "%F-%T", &tmVal); | |
| 22 | ✗ | snprintf(bf, sizeof(bf), "%s.%u", tsBuf, timePair.second); | |
| 23 | ✗ | return bf; | |
| 24 | } | ||
| 25 | |||
| 26 | template<> std::string | ||
| 27 | ✗ | key_to_str_for_yaml(EventID eid) { | |
| 28 | ✗ | return eid.to_str(); | |
| 29 | } | ||
| 30 | |||
| 31 | template<> std::pair<EventID, EventID> | ||
| 32 | ✗ | deduce_key( EventID oldEventID, EventID newEventID | |
| 33 | , const std::pair<time_t, uint32_t> & oldDatetime | ||
| 34 | , const std::pair<time_t, uint32_t> & newDateTime | ||
| 35 | ✗ | ) { return {oldEventID, newEventID}; } | |
| 36 | |||
| 37 | template<> std::pair<std::pair<time_t, uint32_t>, std::pair<time_t, uint32_t>> | ||
| 38 | ✗ | deduce_key( EventID oldEventID, EventID newEventID | |
| 39 | , const std::pair<time_t, uint32_t> & oldDatetime | ||
| 40 | , const std::pair<time_t, uint32_t> & newDateTime | ||
| 41 | ✗ | ) { return {oldDatetime, newDateTime}; } | |
| 42 | |||
| 43 | } // namespace ::na64dp::calib::aux | ||
| 44 | } // namespace ::na64dp::calib | ||
| 45 | } // namespace na64dp | ||
| 46 | |||
| 47 |