Package org.hlacerti.lib
Class MessageProcessing
- java.lang.Object
-
- org.hlacerti.lib.MessageProcessing
-
public class MessageProcessing extends java.lang.Object
This class implements the functionalities to encode/decode HLA values received from HLA/CERTI.
- Since:
- Ptolemy II 11.0
- Version:
- $Id: MessageProcessing.java 214 2018-04-01 13:32:02Z j.cardoso $
- Author:
- David Come, Contributors: Gilles Lasnier
- Pt.AcceptedRating:
- Red (glasnier)
- Pt.ProposedRating:
- Yellow (glasnier)
-
-
Constructor Summary
Constructors Constructor Description MessageProcessing()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Object
decodeHlaValue(HlaReflectable hs, Type type, byte[] buffer)
This generic method calls theEncodingHelpers
API provided by CERTI to handle type decoding operations for HLA value attribute that has been reflected (RAV).static byte[]
encodeHlaValue(HlaUpdatable hp, Token tok)
This generic method calls theEncodingHelpers
API or theMessageBuffer
API provided by CERTI to handle data encoding operation for updated value of HLA attribute that will be published to the federation.
-
-
-
Method Detail
-
decodeHlaValue
public static java.lang.Object decodeHlaValue(HlaReflectable hs, Type type, byte[] buffer) throws IllegalActionException
This generic method calls theEncodingHelpers
API provided by CERTI to handle type decoding operations for HLA value attribute that has been reflected (RAV).- Parameters:
hs
- The targeted HLA subscriber actor.type
- The type to decode the token.buffer
- The encoded value to decode.- Returns:
- The decoded value as an object.
- Throws:
IllegalActionException
- If the token is not handled or the decoding has failed.
-
encodeHlaValue
public static byte[] encodeHlaValue(HlaUpdatable hp, Token tok) throws IllegalActionException
This generic method calls theEncodingHelpers
API or theMessageBuffer
API provided by CERTI to handle data encoding operation for updated value of HLA attribute that will be published to the federation.- Parameters:
hp
- The HLA publisher actor which sends the HLA attribute value.tok
- The token to encode, i.e. the HLA attribute value to encode.- Returns:
- The encoded value as an array of byte.
- Throws:
IllegalActionException
- If the token is not handled or the encoding has failed.
-
-