Changeset 149:ec260a097a47 in rrlib_rtti


Ignore:
Timestamp:
02.10.2020 17:37:38 (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:
5 edited

Legend:

Unmodified
Added
Removed
  • detail/tTypeInfo.cpp

    r147 r149  
    373373    typeid(std::string).name(), "String", 
    374374    typeid(rrlib::time::tDuration).name(), "Duration", 
    375     typeid(rrlib::time::tTimestamp).name(), "Timestamp" 
     375    typeid(rrlib::time::tSystemTimestamp).name(), "Timestamp", 
     376    typeid(rrlib::time::tSteadyTimestamp).name(), "SteadyTimestamp" 
    376377  }; 
    377378 
  • tDataType.cpp

    r138 r149  
    8181template class detail::tDataTypeInfo<bool>; 
    8282template class detail::tDataTypeInfo<std::string>; 
    83 template class detail::tDataTypeInfo<rrlib::time::tTimestamp>; 
     83template class detail::tDataTypeInfo<rrlib::time::tSystemTimestamp>; 
     84template class detail::tDataTypeInfo<rrlib::time::tSteadyTimestamp>; 
    8485template class detail::tDataTypeInfo<rrlib::time::tDuration>; 
    8586 
     
    9798template class detail::tDataTypeInfo<std::vector<bool>>; 
    9899template class detail::tDataTypeInfo<std::vector<std::string>>; 
    99 template class detail::tDataTypeInfo<std::vector<rrlib::time::tTimestamp>>; 
     100template class detail::tDataTypeInfo<std::vector<rrlib::time::tSystemTimestamp>>; 
     101template class detail::tDataTypeInfo<std::vector<rrlib::time::tSteadyTimestamp>>; 
    100102template class detail::tDataTypeInfo<std::vector<rrlib::time::tDuration>>; 
    101103 
     
    115117  tDataType<float>(), 
    116118  tDataType<bool>(), 
    117   tDataType<rrlib::time::tTimestamp>(), 
     119  tDataType<rrlib::time::tSystemTimestamp>(), 
     120  tDataType<rrlib::time::tSteadyTimestamp>(), 
    118121  tDataType<rrlib::time::tDuration>() 
    119122}; 
  • tDataType.h

    r138 r149  
    108108extern template class detail::tDataTypeInfo<bool>; 
    109109extern template class detail::tDataTypeInfo<std::string>; 
    110 extern template class detail::tDataTypeInfo<rrlib::time::tTimestamp>; 
     110extern template class detail::tDataTypeInfo<rrlib::time::tSystemTimestamp>; 
     111extern template class detail::tDataTypeInfo<rrlib::time::tSteadyTimestamp>; 
    111112extern template class detail::tDataTypeInfo<rrlib::time::tDuration>; 
    112113 
     
    124125extern template class detail::tDataTypeInfo<std::vector<bool>>; 
    125126extern template class detail::tDataTypeInfo<std::vector<std::string>>; 
    126 extern template class detail::tDataTypeInfo<std::vector<rrlib::time::tTimestamp>>; 
     127extern template class detail::tDataTypeInfo<std::vector<rrlib::time::tSystemTimestamp>>; 
     128extern template class detail::tDataTypeInfo<std::vector<rrlib::time::tSteadyTimestamp>>; 
    127129extern template class detail::tDataTypeInfo<std::vector<rrlib::time::tDuration>>; 
    128130 
  • tests/rtti.cpp

    r143 r149  
    170170    } 
    171171    { 
    172       tDataType<std::tuple<std::string, rrlib::time::tTimestamp, std::vector<std::string>>> type; 
     172      tDataType<std::tuple<std::string, rrlib::time::tSystemTimestamp, std::vector<std::string>>> type; 
    173173      RRLIB_UNIT_TESTS_EQUALITY_MESSAGE("Names '" + type.GetName() + "' and 'Tuple<String, Timestamp, List<String>>' are not equal", type.GetName() == "Tuple<String, Timestamp, List<String>>", true); 
    174174      RRLIB_UNIT_TESTS_ASSERT(type.HasName("Tuple<String, Timestamp, List<String>>")); 
     
    176176    } 
    177177    { 
    178       tDataType<TemplateClass<std::vector<rrlib::time::tTimestamp>>> type; 
     178      tDataType<TemplateClass<std::vector<rrlib::time::tSystemTimestamp>>> type; 
    179179      RRLIB_UNIT_TESTS_EQUALITY_MESSAGE("Names '" + type.GetName() + "' and 'rrlib.rtti.test.TemplateClass<List<Timestamp>>' are not equal", type.GetName() == "rrlib.rtti.test.TemplateClass<List<Timestamp>>", true); 
    180180    } 
    181181    { 
    182       tDataType<std::pair<std::string, rrlib::time::tTimestamp>> type; 
     182      tDataType<std::pair<std::string, rrlib::time::tSystemTimestamp>> type; 
    183183      RRLIB_UNIT_TESTS_EQUALITY_MESSAGE("Names '" + type.GetName() + "' and Pair<String, Timestamp>' are not equal", type.GetName() == "Pair<String, Timestamp>", true); 
    184184      RRLIB_UNIT_TESTS_ASSERT(type.HasName("Pair<String, Timestamp>")); 
  • type_traits.h

    r139 r149  
    273273struct TypeName 
    274274{ 
    275   enum { cTYPE_DEFINED_IN_RRLIB_RTTI_WITH_NONSTANDARD_NAME = (std::is_integral<T>::value || std::is_same<T, std::string>::value || std::is_same<T, rrlib::time::tDuration>::value || std::is_same<T, rrlib::time::tTimestamp>::value) && (!std::is_same<T, bool>::value) }; 
     275  enum { cTYPE_DEFINED_IN_RRLIB_RTTI_WITH_NONSTANDARD_NAME = (std::is_integral<T>::value || std::is_same<T, std::string>::value || std::is_same<T, rrlib::time::tDuration>::value || std::is_same<T, rrlib::time::tSystemTimestamp>::value || std::is_same<T, rrlib::time::tSteadyTimestamp>::value) && (!std::is_same<T, bool>::value) }; 
    276276 
    277277  static constexpr tGetTypenameFunction value = cTYPE_DEFINED_IN_RRLIB_RTTI_WITH_NONSTANDARD_NAME ? &detail::tTypeInfo::GetTypeNameDefinedInRRLibRtti : &detail::tTypeInfo::GetDefaultTypeName; 
Note: See TracChangeset for help on using the changeset viewer.