Changeset 131:930bc1674f74 in finroc_plugins_data_ports


Ignore:
Timestamp:
15.10.2017 22:46:34 (2 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
17.03
Phase:
public
Message:

Makes type conversion connectors retain timestamps of input data

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • common/tAbstractPortBufferManager.h

    r46 r131  
    9898   * \return Timestamp for currently managed data 
    9999   */ 
    100   inline rrlib::time::tTimestamp GetTimestamp() const 
     100  inline const rrlib::time::tTimestamp& GetTimestamp() const 
    101101  { 
    102102    return timestamp; 
  • common/tConversionConnector.cpp

    r127 r131  
    8282{} 
    8383 
    84 void tConversionConnector::Publish(const rrlib::rtti::tGenericObject& input_data, tChangeStatus change_constant) const 
     84void tConversionConnector::Publish(const rrlib::rtti::tGenericObject& input_data, const rrlib::time::tTimestamp& timestamp, tChangeStatus change_constant) const 
    8585{ 
    8686  try 
     
    8888    tGenericPort& generic_port = const_cast<tGenericPort&>(reinterpret_cast<const tGenericPort&>(destination_port_generic_memory[0])); 
    8989    tPortDataPointer<rrlib::rtti::tGenericObject> buffer = generic_port.GetUnusedBuffer(); 
     90    buffer.SetTimestamp(timestamp); 
    9091    conversion_operation.Convert(input_data, *buffer); 
    9192    generic_port.BrowserPublish(buffer, true, change_constant); 
  • common/tConversionConnector.h

    r107 r131  
    9090   * 
    9191   * \param input_data Input data (to convert and publish) 
     92   * \param timestamp Timestamp of data 
    9293   * \param change_constant Change constant to use 
    9394   */ 
    94   void Publish(const rrlib::rtti::tGenericObject& input_data, tChangeStatus change_constant) const; 
     95  void Publish(const rrlib::rtti::tGenericObject& input_data, const rrlib::time::tTimestamp& timestamp, tChangeStatus change_constant) const; 
    9596 
    9697//---------------------------------------------------------------------- 
  • common/tPublishOperation.h

    r114 r131  
    133133        if (it->Flags().Get(core::tConnectionFlag::CONVERSION)) 
    134134        { 
    135           static_cast<const tConversionConnector&>(*it).Publish(this->GetObject(), CHANGE_CONSTANT); 
     135          static_cast<const tConversionConnector&>(*it).Publish(this->GetObject(), this->GetTimestamp(), CHANGE_CONSTANT); 
    136136        } 
    137137        else 
     
    168168        if (it->Flags().Get(core::tConnectionFlag::CONVERSION)) 
    169169        { 
    170           static_cast<const tConversionConnector&>(*it).Publish(publishing_data.GetObject(), CHANGE_CONSTANT); 
     170          static_cast<const tConversionConnector&>(*it).Publish(publishing_data.GetObject(), publishing_data.GetTimestamp(), CHANGE_CONSTANT); 
    171171        } 
    172172        else 
  • optimized/tCheapCopyPort.cpp

    r123 r131  
    387387  if (typeid(connector) == typeid(common::tConversionConnector)) 
    388388  { 
    389     static_cast<common::tConversionConnector&>(connector).Publish(unused_manager->GetObject(), tChangeStatus::CHANGED_INITIAL); 
     389    static_cast<common::tConversionConnector&>(connector).Publish(unused_manager->GetObject(), unused_manager->GetTimestamp(), tChangeStatus::CHANGED_INITIAL); 
    390390  } 
    391391  else 
  • optimized/tCheapCopyPort.h

    r123 r131  
    479479      return published_buffer->GetObject(); 
    480480    } 
     481    const rrlib::time::tTimestamp& GetTimestamp() 
     482    { 
     483      return published_buffer->GetTimestamp(); 
     484    } 
    481485 
    482486    /*! 
     
    576580    { 
    577581      return published_buffer->GetObject(); 
     582    } 
     583    const rrlib::time::tTimestamp& GetTimestamp() 
     584    { 
     585      return published_buffer->GetTimestamp(); 
    578586    } 
    579587 
  • optimized/tSingleThreadedCheapCopyPortGeneric.cpp

    r123 r131  
    166166  if (typeid(connector) == typeid(common::tConversionConnector)) 
    167167  { 
    168     static_cast<common::tConversionConnector&>(connector).Publish(*current_value.data, tChangeStatus::CHANGED_INITIAL); 
     168    static_cast<common::tConversionConnector&>(connector).Publish(*current_value.data, current_value.timestamp, tChangeStatus::CHANGED_INITIAL); 
    169169  } 
    170170  else 
  • optimized/tSingleThreadedCheapCopyPortGeneric.h

    r123 r131  
    111111      return *value->data; 
    112112    } 
     113    const rrlib::time::tTimestamp& GetTimestamp() 
     114    { 
     115      return value->timestamp; 
     116    } 
    113117 
    114118    template <typename T> 
  • standard/tStandardPort.cpp

    r118 r131  
    274274  if (typeid(connector) == typeid(common::tConversionConnector)) 
    275275  { 
    276     static_cast<common::tConversionConnector&>(connector).Publish(manager->GetObject(), tChangeStatus::CHANGED_INITIAL); 
     276    static_cast<common::tConversionConnector&>(connector).Publish(manager->GetObject(), manager->GetTimestamp(), tChangeStatus::CHANGED_INITIAL); 
    277277  } 
    278278  else 
  • standard/tStandardPort.h

    r114 r131  
    367367      return published_buffer->GetObject(); 
    368368    } 
     369    const rrlib::time::tTimestamp& GetTimestamp() 
     370    { 
     371      return published_buffer->GetTimestamp(); 
     372    } 
    369373 
    370374    void Init(tPortBufferManager* published) 
Note: See TracChangeset for help on using the changeset viewer.