Class GtuTransceiver
java.lang.Object
org.opentrafficsim.sim0mq.publisher.AbstractTransceiver
org.opentrafficsim.sim0mq.publisher.AbstractEventTransceiver
org.opentrafficsim.sim0mq.publisher.GtuTransceiver
- All Implemented Interfaces:
org.djutils.base.Identifiable
,TransceiverInterface
Transceiver for GTU data.
Copyright (c) 2020-2024 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
ConstructorDescriptionGtuTransceiver
(org.opentrafficsim.core.network.Network network, GtuIdTransceiver gtuIdSource) Construct a GtuTransceiver. -
Method Summary
Modifier and TypeMethodDescriptionfinal Object[]
get
(Object[] address, ReturnWrapper returnWrapper) Retrieve the data.final TransceiverInterface
getIdSource
(int addressLevel, ReturnWrapper returnWrapper) Retrieve the TransceiverInterface that can be used to get detailed information about a single object.boolean
Report if this transceiver has an id source.toString()
Methods inherited from class org.opentrafficsim.sim0mq.publisher.AbstractEventTransceiver
constructResultFields
Methods inherited from class org.opentrafficsim.sim0mq.publisher.AbstractTransceiver
getAddressFields, getId, getResultFields, verifyMetaData
-
Constructor Details
-
GtuTransceiver
public GtuTransceiver(org.opentrafficsim.core.network.Network network, GtuIdTransceiver gtuIdSource) Construct a GtuTransceiver.- Parameters:
network
- Network; the NetworkgtuIdSource
- GtuIdTransceiver; the transceiver that can produce all active GTU ids in the Network
-
-
Method Details
-
getIdSource
public final TransceiverInterface getIdSource(int addressLevel, ReturnWrapper returnWrapper) throws org.sim0mq.Sim0MQException, org.djutils.serialization.SerializationException Retrieve the TransceiverInterface that can be used to get detailed information about a single object.- Parameters:
addressLevel
- int; index of the argument in the address fieldsreturnWrapper
- ReturnWrapper; to be used to report problems- Returns:
- TransceiverInterface; to be used to get valid values for argument
addressLevel
, or null if valid values for the argument at indexaddressLevel
can not be obtained through a TransceiverInterface object - Throws:
org.sim0mq.Sim0MQException
- when the ReturnWrapper failsorg.djutils.serialization.SerializationException
- when the ReturnWrapper fails
-
hasIdSource
public boolean hasIdSource()Report if this transceiver has an id source.- Returns:
- boolean; true if this transceiver has an id source; false if this transceiver does not have an id source
-
get
public final Object[] get(Object[] address, ReturnWrapper returnWrapper) throws RemoteException, org.sim0mq.Sim0MQException, org.djutils.serialization.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:
RemoteException
- when communication needed to retrieve the data failedorg.sim0mq.Sim0MQException
- when encoding an error message failsorg.djutils.serialization.SerializationException
- when encoding an error message fails
-
toString
- Overrides:
toString
in classAbstractTransceiver
-