Changeset 82:42573a7a0c06 in finroc_plugins_data_ports


Ignore:
Timestamp:
06.01.2015 17:35:03 (5 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
14.08
Children:
83:3c2aa0afafd8, 85:b0cb42d24e96
Parents:
79:251fbb68b0f5 (diff), 81:45307b1a5d82 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merged with 13.10

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tPortCreationInfo.h

    r72 r82  
    159159  } 
    160160 
     161  // we replicate this here, since Set() for default values catches enums if T is e.g. rrlib::si_units::tQuantity type 
     162  void Set(core::tFrameworkElement::tFlag flag) 
     163  { 
     164    tAbstractPortCreationInfo::Set(flag); 
     165  } 
     166 
    161167  void SetDefault(const T& default_val, bool overwrite_default = false) 
    162168  { 
  • tPortCreationInfo.h

    r81 r82  
    7373class tPortCreationInfo : public common::tAbstractDataPortCreationInfo 
    7474{ 
    75   enum { cBOUNDABLE = tIsBoundable<T>::value }; 
     75  enum { cBOUNDABLE = IsBoundable<T>::value }; 
    7676 
    7777//---------------------------------------------------------------------- 
     
    126126 
    127127  /*! Various Set methods for different port properties */ 
    128   template <bool DISABLE = tIsString<T>::value> 
     128  template <bool DISABLE = IsString<T>::value> 
    129129  void Set(const typename std::enable_if < !DISABLE, T >::type& default_value) 
    130130  { 
     
    165165  } 
    166166 
     167  void SetDefault(const T& default_val, bool overwrite_default = false) 
     168  { 
     169    if (DefaultValueSet() && (!overwrite_default)) 
     170    { 
     171      FINROC_LOG_PRINT_STATIC(DEBUG_WARNING, "Default value already set"); 
     172    } 
     173    rrlib::serialization::tOutputStream os(default_value); 
     174    os << default_val; 
     175  } 
     176 
    167177//---------------------------------------------------------------------- 
    168178// Private fields and methods 
     
    170180private: 
    171181 
    172   template <bool STRING = tIsString<T>::value> 
     182  template <bool STRING = IsString<T>::value> 
    173183  void SetString(const typename std::enable_if < !STRING, tString >::type& s) 
    174184  { 
     
    176186  } 
    177187 
    178   template <bool STRING = tIsString<T>::value> 
     188  template <bool STRING = IsString<T>::value> 
    179189  void SetString(const typename std::enable_if<STRING, tString>::type& s) 
    180190  { 
     
    193203    } 
    194204  } 
    195  
    196   void SetDefault(const T& default_val) 
    197   { 
    198     if (DefaultValueSet()) 
    199     { 
    200       FINROC_LOG_PRINT_STATIC(DEBUG_WARNING, "Default value already set"); 
    201     } 
    202     rrlib::serialization::tOutputStream os(default_value); 
    203     os << default_val; 
    204   } 
    205205}; 
    206206 
Note: See TracChangeset for help on using the changeset viewer.