Changeset 472:caae658585be in finroc_core
- Timestamp:
- 25.02.2020 06:58:33 (2 years ago)
- Branch:
- 17.03
- Children:
- 473:4b81cd5b0170, 474:fbdcd51b85a7
- Phase:
- public
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
port/tAbstractPort.cpp
r464 r472 563 563 // count parents 564 564 int this_parent_node_count = 1; 565 tFrameworkElement* parent = this->GetParent();565 const tFrameworkElement* parent = this; 566 566 while ((parent = parent->GetParent())) 567 567 { 568 this_parent_node_count++; 568 if (!parent->IsPort()) 569 { 570 this_parent_node_count++; 571 } 569 572 } 570 573 571 574 int other_parent_node_count = 1; 572 parent = other.GetParent();575 parent = &other; 573 576 while ((parent = parent->GetParent())) 574 577 { 575 other_parent_node_count++; 578 if (!parent->IsPort()) 579 { 580 other_parent_node_count++; 581 } 576 582 } 577 583 … … 607 613 else 608 614 { 609 tFrameworkElement* component = (GetParent() && GetParent()->GetFlag(tFlag::INTERFACE)) ? GetParent()->GetParent() : nullptr; 615 tFrameworkElement* interface_candidate = this->GetParent(); 616 while (interface_candidate && interface_candidate->IsPort()) 617 { 618 interface_candidate = interface_candidate->GetParent(); 619 } 620 tFrameworkElement* component = (interface_candidate && interface_candidate->GetFlag(tFlag::INTERFACE)) ? interface_candidate->GetParent() : nullptr; 610 621 if (component) 611 622 { … … 617 628 else 618 629 { 619 FINROC_LOG_PRINT(WARNING, "This proxy port is not part of a interface. So far, no heuristics for this case have been implemented. Guessing connect direction to be its primary connect direction.");630 FINROC_LOG_PRINT(WARNING, "This proxy port is not part of an interface. So far, no heuristics for this case have been implemented. Guessing connect direction to be its primary connect direction."); 620 631 to_destination = this->IsOutputPort(); 621 632 } -
port/tAbstractPort.h
r464 r472 416 416 virtual tConnectDirection InferConnectDirection(const tPath& path) const; 417 417 418 virtual void OnManagedDelete() override; 419 418 420 //---------------------------------------------------------------------- 419 421 // Private fields and methods … … 494 496 } 495 497 496 virtual void OnManagedDelete() override;497 498 498 }; 499 499 -
port/tEdgeAggregator.cpp
r439 r472 145 145 while (current) 146 146 { 147 if (current->GetFlag(tFlag::EDGE_AGGREGATOR) && (!current->GetFlag(tFlag::NETWORK_ELEMENT)) )147 if (current->GetFlag(tFlag::EDGE_AGGREGATOR) && (!current->GetFlag(tFlag::NETWORK_ELEMENT)) && (!current->IsPort())) 148 148 { 149 149 return static_cast<tEdgeAggregator*>(current); -
port/tEdgeAggregator.h
r440 r472 139 139 inline static bool IsDataFlowType(const rrlib::rtti::tType& type) 140 140 { 141 return type.GetTypeClassification() != rrlib::rtti::tTypeClassification::RPC_TYPE ;141 return type.GetTypeClassification() != rrlib::rtti::tTypeClassification::RPC_TYPE && type.GetTypeClassification() != rrlib::rtti::tTypeClassification::PORT_COMPOSITE_INTERFACE; 142 142 } 143 143 -
port/tPortGroup.h
r414 r472 175 175 * \return Default flags for any ports to be created in this Group 176 176 */ 177 tFlags GetDefaultPortFlags() 177 tFlags GetDefaultPortFlags() const 178 178 { 179 179 return default_port_flags; -
tFrameworkElement.cpp
r469 r472 120 120 creater_thread_uid(rrlib::thread::tThread::CurrentThreadId()), 121 121 #endif 122 flags(flags), 123 children(flags.Get(tFlag::PORT) ? &empty_child_set : new tChildSet()) 124 { 125 if (flags.Raw() & cSTATUS_FLAGS.Raw()) 126 { 127 FINROC_LOG_PRINT(ERROR, "No status flags may be set in constructor"); 128 abort(); 129 } 122 flags(flags.Raw() & (~cSTATUS_FLAGS.Raw())), 123 children(flags.Get(tFlag::PORT) && (!flags.Get(tFlag::COMPOSITE_PORT)) ? &empty_child_set : new tChildSet()) 124 { 130 125 if (name.length() > 0) 131 126 { … … 184 179 void tFrameworkElement::AddChild(tLink& child) 185 180 { 186 if (IsPort() )181 if (IsPort() && (!flags.Get(tFlag::COMPOSITE_PORT))) 187 182 { 188 183 FINROC_LOG_PRINT(ERROR, "Cannot add children to port"); -
tFrameworkElementFlags.h
r439 r472 110 110 // Constant flags 111 111 UNUSED_CONSTANT_PORT_FLAG_4 = EDGE_AGGREGATOR, 112 UNUSED_CONSTANT_PORT_FLAG_3,112 COMPOSITE_PORT, //!< Port with child ports 113 113 SENSOR_DATA_PORT, //!< Is the data processed in this port sensor data? (hint for visualization; relevant for interface especially) 114 114 CONTROLLER_DATA_PORT, //!< Is the data processed in this port controller data? (hint for visualization; relevant for interface especially)
Note: See TracChangeset
for help on using the changeset viewer.