Changeset 198:eda7de072dc4 in rrlib_serialization


Ignore:
Timestamp:
02.10.2020 17:36:11 (3 weeks ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
17.03
Phase:
public
Message:

Adapts to changes in rrlib_time (adds support for both timestamp types)

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tInputStream.h

    r187 r198  
    737737  return stream; 
    738738} 
    739 template <typename D> 
    740 inline tInputStream& operator>> (tInputStream& stream, std::chrono::time_point<std::chrono::system_clock, D>& t) 
     739template <typename TClock, typename D> 
     740inline tInputStream& operator>> (tInputStream& stream, std::chrono::time_point<TClock, D>& t) 
    741741{ 
    742742  D d; 
    743743  stream >> d; 
    744   t = std::chrono::time_point<std::chrono::system_clock, D>(d); 
     744  t = std::chrono::time_point<TClock, D>(d); 
    745745  return stream; 
    746746} 
  • tOutputStream.h

    r190 r198  
    711711  return stream; 
    712712} 
    713 template <typename D> 
    714 inline tOutputStream& operator<< (tOutputStream& stream, const std::chrono::time_point<std::chrono::system_clock, D>& t) 
     713template <typename TClock, typename D> 
     714inline tOutputStream& operator<< (tOutputStream& stream, const std::chrono::time_point<TClock, D>& t) 
    715715{ 
    716716  stream << t.time_since_epoch(); 
  • tStringInputStream.h

    r194 r198  
    332332  return stream; 
    333333} 
     334template <typename D> 
     335inline tStringInputStream& operator>> (tStringInputStream& stream, std::chrono::time_point<std::chrono::steady_clock, D>& t) 
     336{ 
     337  t = std::chrono::time_point<std::chrono::steady_clock, D>(rrlib::time::ParseIsoDuration(stream.ReadLine())); 
     338  return stream; 
     339} 
    334340#endif 
    335341 
  • tStringOutputStream.h

    r173 r198  
    231231  return stream; 
    232232} 
    233 template <typename D> 
    234 inline tStringOutputStream& operator<< (tStringOutputStream& stream, const std::chrono::time_point<std::chrono::system_clock, D>& t) 
     233template <typename TClock, typename D> 
     234inline tStringOutputStream& operator<< (tStringOutputStream& stream, const std::chrono::time_point<TClock, D>& t) 
    235235{ 
    236236  stream << rrlib::time::ToIsoString(t); 
Note: See TracChangeset for help on using the changeset viewer.