Class 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)
    • 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 the EncodingHelpers 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 the EncodingHelpers API or the MessageBuffer API provided by CERTI to handle data encoding operation for updated value of HLA attribute that will be published to the federation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MessageProcessing

        public MessageProcessing()
    • Method Detail

      • decodeHlaValue

        public static java.lang.Object decodeHlaValue​(HlaReflectable hs,
                                                      Type type,
                                                      byte[] buffer)
                                               throws IllegalActionException
        This generic method calls the EncodingHelpers 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 the EncodingHelpers API or the MessageBuffer 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.