Class AbstractEventTransceiver
java.lang.Object
org.opentrafficsim.sim0mq.publisher.AbstractTransceiver
org.opentrafficsim.sim0mq.publisher.AbstractEventTransceiver
- All Implemented Interfaces:
org.djutils.base.Identifiable
,TransceiverInterface
- Direct Known Subclasses:
GtuTransceiver
Transceiver for DJUNITS events.
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
ConstructorDescriptionAbstractEventTransceiver
(String id, org.djutils.metadata.MetaData addressFields, org.djutils.event.EventType eventType) Construct a new AbstractEventTransceiver. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.djutils.metadata.MetaData
constructResultFields
(org.djutils.event.EventType eventType) Construct a Sim0MQ MetaData object that corresponds to the MetaData of DJUTILS EventType.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
get, getIdSource, hasIdSource
-
Constructor Details
-
AbstractEventTransceiver
public AbstractEventTransceiver(String id, org.djutils.metadata.MetaData addressFields, org.djutils.event.EventType eventType) Construct a new AbstractEventTransceiver.- Parameters:
id
- String; name of the new AbstractEventTransceiveraddressFields
- MetaData; address format accepted by the new AbstractEventTransceivereventType
- EventType; type of the event that the AbstractEventTransceiver can subscribe to in the network
-
-
Method Details
-
constructResultFields
public static org.djutils.metadata.MetaData constructResultFields(org.djutils.event.EventType eventType) throws ClassCastException Construct a Sim0MQ MetaData object that corresponds to the MetaData of DJUTILS EventType. Classes that do not have a corresponding Sim0MQ type will result in a ClassCastException.- Parameters:
eventType
- EventType; the event type- Returns:
- MetaData; a MetaData object that corresponds to the MetaData of the event type
- Throws:
ClassCastException
- when theeventType
contains a class that cannot be carried over Sim0MQ
-