-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduced duplicatable V2XMessage functionality (#390)
* introduced duplicatable V2XMessage functionality
- Loading branch information
1 parent
6a8a743
commit 2ec9187
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
lib/mosaic-objects/src/main/java/org/eclipse/mosaic/lib/objects/v2x/DuplicatableMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2024 Fraunhofer FOKUS and others. All rights reserved. | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contact: [email protected] | ||
*/ | ||
|
||
package org.eclipse.mosaic.lib.objects.v2x; | ||
|
||
/** | ||
* A message that can duplicate itself. | ||
* @param <T> a class that extends {@link V2xMessage} | ||
*/ | ||
public interface DuplicatableMessage<T extends V2xMessage> { | ||
|
||
/** | ||
* Creates a copy of the V2xMessage. | ||
* The message gets a new ID and routing (to use current vehicle position). | ||
* Only its contents (e.g. payload, type, ...) are copied. | ||
* | ||
* @param routing contains current vehicle position | ||
* @return cloned message | ||
*/ | ||
T duplicate(MessageRouting routing); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters