Class Port

Inheritance Relationships

Derived Types

Class Documentation

class Port

Component’s port abstraction class. The Port means to be used as a local Component’s variable, which allows to interface with another Component. The controlled Component exposes a Connector, which shall be stored in the Port.

Subclassed by DataPort, SignalPort

Public Functions

Port() = default
virtual ~Port() = default
virtual void connect(std::weak_ptr<Connector> connector) = 0

Attach a Connector to the port.

Parameters

connectorConnector to be connected.

virtual void disconnect() final

Detach a Connector.

virtual bool empty() const final

Checks if there is any Connector attached to the Port.

Returns

true If the Connector is present.

virtual explicit operator bool() const final

A shorthand for empty() function.

Protected Attributes

std::weak_ptr<Connector> m_connector

A connector which Port interface with.