Changeset 24:dff0cf79bc31 in finroc_plugins_composite_ports


Ignore:
Timestamp:
22.03.2021 00:46:09 (4 weeks ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Message:

Fixes warning when modifiers move RPC ports

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tInterfaceBase.cpp

    r23 r24  
    333333tInterfaceBase::tBackend::tBackend(core::tAbstractPortCreationInfo& creation_info, tBackend& primary) : 
    334334  tAbstractPort(creation_info), 
     335  parent_component(primary.parent_component), 
    335336  primary_backend(primary), 
     337  custom_connect_function(primary.custom_connect_function), 
    336338  convenience_port_type(false), 
    337339  primary_relation_id(primary.primary_relation_id), 
     
    435437  bool partial_interface_direction_is_output = GetAggregator(*this)->GetFlag(tFlag::INTERFACE_FOR_OUTPUTS); 
    436438  bool partial_interface_primary_relation_direction_is_output = !partial_interface_direction_is_output; 
     439  bool backend_for_client_port = false; 
    437440  if (GetParent() && typeid(*GetParent()).name() == typeid(tBackend).name()) 
    438441  { 
     
    553556      case internal::tPortTypeRelation::ePTR_SERVER_IF_INPUT: 
    554557      case internal::tPortTypeRelation::ePTR_CLIENT_IF_INPUT: 
     558        backend_for_client_port = (remaining_relations == 0) && ((opcode == internal::tPortTypeRelation::ePTR_CLIENT_IF_INPUT && original_flags.Get(tFlag::INTERFACE_FOR_INPUTS)) || (opcode == internal::tPortTypeRelation::ePTR_SERVER_IF_INPUT && original_flags.Get(tFlag::INTERFACE_FOR_OUTPUTS))); 
    555559        target_set_flags = tFlag::INTERFACE_FOR_RPC_PORTS; 
    556560        target_unset_flags = (partial_interface && (!parent_candidate)) ? target_set_flags : core::tFrameworkElementFlags(); // With partially instantiated interfaces, create service ports if the port types they are derived from are also created 
     
    633637  secondary_creation_info.parent = parent; 
    634638  secondary_creation_info.flags = core::tFrameworkElementFlags(tFlag::INTERFACE); 
    635   GetAggregator(*parent, &secondary_creation_info.flags); 
     639  auto aggregator = GetAggregator(*parent, &secondary_creation_info.flags); 
     640  if (backend_for_client_port && aggregator->GetFlag(tFlag::INTERFACE_FOR_RPC_PORTS)) 
     641  { 
     642    secondary_creation_info.flags.Set(tFlag::OUTPUT_PORT, backend_for_client_port); 
     643  } 
    636644  all_backends.push_back(new tBackend(secondary_creation_info, *this)); 
    637645  relation_backend_mapping.emplace_back(primary_relation_id, all_backends.back()); 
Note: See TracChangeset for help on using the changeset viewer.