| 486 | } |
| 487 | |
| 488 | boost::optional<unsigned> ModelObject_Impl::connectedObjectPort(unsigned port) const { |
| 489 | OptionalWorkspaceObject wo = this->getTarget(port); |
| 490 | if (wo) { |
| 491 | auto connection = wo->cast<Connection>(); |
| 492 | |
| 493 | if (boost::optional<ModelObject> sourceObject = connection.sourceObject()) { |
| 494 | if (sourceObject->handle() == this->handle()) { |
| 495 | return connection.targetObjectPort(); |
| 496 | } |
| 497 | } |
| 498 | if (boost::optional<ModelObject> targetObject = connection.targetObject()) { |
| 499 | if (targetObject->handle() == this->handle()) { |
| 500 | return connection.sourceObjectPort(); |
| 501 | } |
| 502 | } |
| 503 | } |
| 504 | return {}; |
| 505 | } |
| 506 | |
| 507 | ModelObject ModelObject_Impl::clone(Model model) const { |
| 508 | // UniqueModelObject. |
no test coverage detected