Package ptolemy.actor

Class PubSubPort

    • Field Detail

      • channel

        public StringParameter channel
        If set, then this port is used to communicate over a named publish and subscribe channel, rather than over manually established connections.
      • global

        public Parameter global
        Specification of whether the published data is global. This is ignored if channel is empty. If this is set to true, then a subscriber anywhere in the model that references the same channel by name will see values published by this port. If this is set to false (the default), then only those subscribers that are controlled by the same director will see values published on this channel.
      • initialTokens

        public Parameter initialTokens
        The values that will be made available in the initialize method. By default, this is empty, indicating that no initial tokens are available. If you wish for this port to have initial tokens, then give this parameter an array value specifying the sequence of initial values. If this is an output port, these initial values will be sent in the initialize() phase. If this is an input port, then these initial values will be available for reading after the initialize() phase. Changes to this parameter after initialize() has been invoked are ignored until the next execution of the model.
      • _channel

        protected java.lang.String _channel
        Cached channel name, for publish and subscribe.
      • _global

        protected boolean _global
        Cached variable indicating whether publishing or subscribing is global.
    • Constructor Detail

      • PubSubPort

        public PubSubPort​(ComponentEntity container,
                          java.lang.String name)
                   throws IllegalActionException,
                          NameDuplicationException
        Construct a subscriber port with a containing actor and a name. This is always an input port.
        Parameters:
        container - The container actor.
        name - The name of the port.
        Throws:
        IllegalActionException - If the port is not of an acceptable class for the container, or if the container does not implement the Actor interface.
        NameDuplicationException - If the name coincides with a port already in the container.