Changeset 38:925ca77b7361 in finroc_plugins_composite_ports


Ignore:
Timestamp:
09.01.2022 09:10:44 (4 months ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Tags:
tip
Message:

Fixes connect option processing for child connectors (issue introduced in recent changeset ea39cd84ad73)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tInterfaceBase.cpp

    r36 r38  
    191191 
    192192//! Connector with operations for custom connecting attached 
     193const core::tConnectionFlags cRETAIN_FLAGS_FOR_CHILD_CONNECTIONS = core::tConnectionFlag::SCHEDULING_NEUTRAL | core::tConnectionFlag::DIRECTION_TO_SOURCE | core::tConnectionFlag::DIRECTION_TO_DESTINATION; 
     194 
    193195class tConversionConnector : public core::tConnector 
    194196{ 
     
    202204    tConnector(source_port, destination_port, connect_options, this->connect_options.conversion_operations), 
    203205    connect_options(connect_options), 
    204     original_flags(connect_options.flags) 
     206    original_flags(connect_options.flags.Raw() & cRETAIN_FLAGS_FOR_CHILD_CONNECTIONS.Raw()) 
    205207  {} 
    206208 
    207   const core::tConnectOptions& ConnectOptions() const 
     209  const core::tConnectOptions& ChildConnectOptions() const 
    208210  { 
    209211    connect_options.flags = original_flags; 
     
    211213  } 
    212214 
    213   const core::tConnectOptions& ConnectOptions(const core::tConnectionFlag direction_flag) const 
    214   { 
     215  const core::tConnectOptions& ChildConnectOptions(const core::tConnectionFlag direction_flag) const 
     216  { 
     217    connect_options.flags = original_flags; 
    215218    connect_options.flags.Set(core::tConnectionFlag::DIRECTION_TO_SOURCE, direction_flag == core::tConnectionFlag::DIRECTION_TO_SOURCE); 
    216219    connect_options.flags.Set(core::tConnectionFlag::DIRECTION_TO_DESTINATION, direction_flag == core::tConnectionFlag::DIRECTION_TO_DESTINATION); 
     
    994997      if (partner_is_destination) 
    995998      { 
    996         primary_backend.custom_connect_function(*this, other, conversion_connector->ConnectOptions()); 
     999        primary_backend.custom_connect_function(*this, other, conversion_connector->ChildConnectOptions()); 
    9971000      } 
    9981001      else 
    9991002      { 
    1000         primary_backend.custom_connect_function(other, *this, conversion_connector->ConnectOptions()); 
     1003        primary_backend.custom_connect_function(other, *this, conversion_connector->ChildConnectOptions()); 
    10011004      } 
    10021005      primary_backend.operation_on_all_elements_pending = false; 
     
    10121015        { 
    10131016          core::tConnectionFlag direction = (this->IsOutputPort() == this_backend.second->IsOutputPort() ? partner_is_destination : (!partner_is_destination)) ? core::tConnectionFlag::DIRECTION_TO_DESTINATION : core::tConnectionFlag::DIRECTION_TO_SOURCE; 
    1014           this_backend.second->ConnectTo(*other_backend.second, conversion_connector->ConnectOptions(direction)); 
    1015           this_backend.second->ConnectChildPortsByName(*other_backend.second, conversion_connector->ConnectOptions(direction)); 
     1017          this_backend.second->ConnectTo(*other_backend.second, conversion_connector->ChildConnectOptions(direction)); 
     1018          this_backend.second->ConnectChildPortsByName(*other_backend.second, conversion_connector->ChildConnectOptions(direction)); 
    10161019        } 
    10171020      } 
Note: See TracChangeset for help on using the changeset viewer.