Changeset 184:8066d94b4b5b in rrlib_math


Ignore:
Timestamp:
18.02.2019 08:36:57 (8 months ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
17.03
Children:
185:2f7b507346c0, 187:6b39d3d9f397
Phase:
public
Message:

Adds UnderlyingType trait specialization for vectors - and moves the one for angles to always-included header

Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • angle/tAngle.h

    r178 r184  
    5656#include <sstream> 
    5757#endif 
     58#ifdef _LIB_RRLIB_RTTI_PRESENT_ 
     59#include "rrlib/rtti/rtti.h" 
     60#endif 
    5861 
    5962//---------------------------------------------------------------------- 
     
    712715//---------------------------------------------------------------------- 
    713716} 
    714 } 
    715  
     717 
     718#ifdef _LIB_RRLIB_RTTI_PRESENT_ 
     719namespace rtti 
     720{ 
     721template <typename TElement, typename TUnitPolicy, typename TAutoWrapPolicy> 
     722struct UnderlyingType<math::tAngle<TElement, TUnitPolicy, TAutoWrapPolicy>> 
     723{ 
     724  typedef TElement type; 
     725  enum { cREVERSE_CAST_VALID = true }; 
     726  enum { cBINARY_SERIALIZATION_DIFFERS = false }; 
     727  enum { cOTHER_SERIALIZATION_DIFFERS = true }; 
     728}; 
     729} 
    716730#endif 
     731 
     732} 
     733 
     734#endif 
  • rtti.cpp

    r183 r184  
    2828 */ 
    2929//---------------------------------------------------------------------- 
    30  
    31 #include "rrlib/math/rtti.h" 
    3230 
    3331#ifdef _LIB_RRLIB_RTTI_PRESENT_ 
  • vector/tVector.h

    r176 r184  
    4343//---------------------------------------------------------------------- 
    4444#include <functional> 
     45 
     46#ifdef _LIB_RRLIB_RTTI_PRESENT_ 
     47#include "rrlib/rtti/rtti.h" 
     48#endif 
    4549 
    4650//---------------------------------------------------------------------- 
     
    125129//---------------------------------------------------------------------- 
    126130} 
     131 
     132#ifdef _LIB_RRLIB_RTTI_PRESENT_ 
     133namespace rtti 
     134{ 
     135template <size_t Tdimension, typename TElement, template <size_t, typename, typename ...> class TData, typename ... TAdditionalDataParameters> 
     136struct UnderlyingType<math::tVector<Tdimension, TElement, TData, TAdditionalDataParameters...>> 
     137{ 
     138  typedef math::tVector<Tdimension, TElement, TData, TAdditionalDataParameters...> tInternalVectorType; 
     139 
     140  typedef std::array<TElement, Tdimension> type; 
     141  static_assert(sizeof(type) == sizeof(tInternalVectorType), "Invalid trait implementation"); 
     142  enum { cREVERSE_CAST_VALID = true }; 
     143  enum { cBINARY_SERIALIZATION_DIFFERS = false }; 
     144  enum { cOTHER_SERIALIZATION_DIFFERS = true }; 
     145  enum { cINHERITS_ELEMENT_ACCESS_CONVERSION_OPERATIONS = true }; 
     146}; 
     147} 
     148#endif 
     149 
    127150} 
    128151 
Note: See TracChangeset for help on using the changeset viewer.