Changeset 115:fd7b0e5ec9ea in finroc_plugins_data_ports


Ignore:
Timestamp:
08.06.2017 02:34:37 (22 months ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
17.03
Phase:
public
Rebase:
34346233396662386532633930663564396239663366666437323665613063346363616438636638
Message:

Makes initial pushing mechanism use/respect type conversion

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • optimized/tCheapCopyPort.cpp

    r114 r115  
    384384  tUnusedManagerPointer unused_manager(tGlobalBufferPools::Instance().GetUnusedBuffer(cheaply_copyable_type_index).release()); 
    385385  CopyCurrentValueToManager(*unused_manager, tStrategy::NEVER_PULL); 
    386   common::tPublishOperation<tCheapCopyPort, tPublishingDataGlobalBuffer> data(unused_manager); 
    387   tCheapCopyPort& target_port = static_cast<tCheapCopyPort&>(connector.Destination()); 
    388   common::tPublishOperation<tCheapCopyPort, tPublishingDataGlobalBuffer>::Receive<tChangeStatus::CHANGED_INITIAL>(data, target_port, *this); 
     386  if (typeid(connector) == typeid(common::tConversionConnector)) 
     387  { 
     388    static_cast<common::tConversionConnector&>(connector).Publish(unused_manager->GetObject(), tChangeStatus::CHANGED_INITIAL); 
     389  } 
     390  else 
     391  { 
     392    common::tPublishOperation<tCheapCopyPort, tPublishingDataGlobalBuffer> data(unused_manager); 
     393    tCheapCopyPort& target_port = static_cast<tCheapCopyPort&>(connector.Destination()); 
     394    common::tPublishOperation<tCheapCopyPort, tPublishingDataGlobalBuffer>::Receive<tChangeStatus::CHANGED_INITIAL>(data, target_port, *this); 
     395  } 
    389396} 
    390397 
  • optimized/tSingleThreadedCheapCopyPortGeneric.cpp

    r114 r115  
    162162void tSingleThreadedCheapCopyPortGeneric::InitialPushTo(core::tConnector& connector) 
    163163{ 
    164   common::tPublishOperation<tSingleThreadedCheapCopyPortGeneric, tPublishingData> data(current_value); 
    165   tSingleThreadedCheapCopyPortGeneric& target_port = static_cast<tSingleThreadedCheapCopyPortGeneric&>(connector.Destination()); 
    166   common::tPublishOperation<tSingleThreadedCheapCopyPortGeneric, tPublishingData>::Receive<tChangeStatus::CHANGED_INITIAL>(data, target_port, *this); 
     164  if (typeid(connector) == typeid(common::tConversionConnector)) 
     165  { 
     166    static_cast<common::tConversionConnector&>(connector).Publish(*current_value.data, tChangeStatus::CHANGED_INITIAL); 
     167  } 
     168  else 
     169  { 
     170    common::tPublishOperation<tSingleThreadedCheapCopyPortGeneric, tPublishingData> data(current_value); 
     171    tSingleThreadedCheapCopyPortGeneric& target_port = static_cast<tSingleThreadedCheapCopyPortGeneric&>(connector.Destination()); 
     172    common::tPublishOperation<tSingleThreadedCheapCopyPortGeneric, tPublishingData>::Receive<tChangeStatus::CHANGED_INITIAL>(data, target_port, *this); 
     173  } 
    167174} 
    168175 
  • standard/tStandardPort.cpp

    r114 r115  
    272272  assert(IsReady()); 
    273273 
    274   common::tPublishOperation<tStandardPort, tPublishingData> data(manager, 1000); 
    275   tStandardPort& target_port = static_cast<tStandardPort&>(connector.Destination()); 
    276   common::tPublishOperation<tStandardPort, tPublishingData>::Receive<tChangeStatus::CHANGED_INITIAL>(data, target_port, *this); 
     274  if (typeid(connector) == typeid(common::tConversionConnector)) 
     275  { 
     276    static_cast<common::tConversionConnector&>(connector).Publish(manager->GetObject(), tChangeStatus::CHANGED_INITIAL); 
     277  } 
     278  else 
     279  { 
     280    common::tPublishOperation<tStandardPort, tPublishingData> data(manager, 1000); 
     281    tStandardPort& target_port = static_cast<tStandardPort&>(connector.Destination()); 
     282    common::tPublishOperation<tStandardPort, tPublishingData>::Receive<tChangeStatus::CHANGED_INITIAL>(data, target_port, *this); 
     283  } 
    277284} 
    278285 
Note: See TracChangeset for help on using the changeset viewer.