Class AbstractIdTransceiver
- java.lang.Object
-
- org.opentrafficsim.sim0mq.publisher.AbstractTransceiver
-
- org.opentrafficsim.sim0mq.publisher.AbstractIdTransceiver
-
- All Implemented Interfaces:
org.opentrafficsim.base.Identifiable
,TransceiverInterface
- Direct Known Subclasses:
GTUIdTransceiver
,LinkIdTransceiver
,NodeIdTransceiver
public abstract class AbstractIdTransceiver extends AbstractTransceiver
Common code for id transceivers that use an empty address.Copyright (c) 2020-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description AbstractIdTransceiver(org.opentrafficsim.core.network.OTSNetwork network, String id)
Construct a GTUIdTransceiver.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object[]
get(Object[] address, ReturnWrapper returnWrapper)
Retrieve the data.(package private) org.opentrafficsim.core.network.OTSNetwork
getNetwork()
Retrieve the network.(package private) abstract ImmutableSet<?>
getSet()
Retrieve the set of names of objects that can be individually subscribed to.-
Methods inherited from class org.opentrafficsim.sim0mq.publisher.AbstractTransceiver
getAddressFields, getId, getResultFields, toString, verifyMetaData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opentrafficsim.sim0mq.publisher.TransceiverInterface
getIdSource, hasIdSource
-
-
-
-
Constructor Detail
-
AbstractIdTransceiver
public AbstractIdTransceiver(org.opentrafficsim.core.network.OTSNetwork network, String id)
Construct a GTUIdTransceiver.- Parameters:
network
- OTSNetwork; the OTS networkid
- String; name of the IdTransceiver
-
-
Method Detail
-
getSet
abstract ImmutableSet<?> getSet()
Retrieve the set of names of objects that can be individually subscribed to.- Returns:
- Set<?>; the set of names of objects whose that can be subscribed to. Each object in this set should
implement
Identifiable
-
get
public final Object[] get(Object[] address, ReturnWrapper returnWrapper) throws Sim0MQException, SerializationException
Retrieve the data.- Parameters:
address
- Object[]; the address of the data to retrievereturnWrapper
- ReturnWrapper; to be used to report problems- Returns:
- Object[]; the retrieved data, or null when no object with the address could be found
- Throws:
Sim0MQException
- when encoding an error message failsSerializationException
- when encoding an error message fails
-
getNetwork
final org.opentrafficsim.core.network.OTSNetwork getNetwork()
Retrieve the network.- Returns:
- OTSNetwork; the network
-
-