Class CipEPATH

  • Direct Known Subclasses:
    CipEPATH.CipPadEPATH, DynEPATH

    public class CipEPATH
    extends BaseDataType<CipPath>
    Packed and Padded EPath implementation, with variants, with options for no length prefix, an USINT length, or an UINT length. Defaults to an UINT length prefix for constructors that don't specify it.
    Author:
    philip
    • Field Detail

      • padded

        public final boolean padded
    • Constructor Detail

      • CipEPATH

        public CipEPATH()
      • CipEPATH

        public CipEPATH​(boolean padded)
      • CipEPATH

        public CipEPATH​(boolean padded,
                        CipPath path)
      • CipEPATH

        public CipEPATH​(int[] dimensions)
      • CipEPATH

        public CipEPATH​(boolean padded,
                        int[] dimensions)
      • CipEPATH

        protected CipEPATH​(CipEPATH data,
                           int[] indices)
    • Method Detail

      • crcName

        public java.lang.String crcName()
        Description copied from class: BaseDataType
        Obtain the name of this type as used for computing structure CRCs. Can be different from the name(s) used by the CipPath parser.
        Overrides:
        crcName in class BaseDataType<CipPath>
        Returns:
      • get

        public CipPath get​(int[] indices)
        Description copied from class: BaseDataType
        Application-side value retrieval. Subclasses must implement this function to retrieve elements of the storage array in the application data type.
        Specified by:
        get in class BaseDataType<CipPath>
        Parameters:
        indices - Array subscripts. Missing subscripts not allowed.
        Returns:
      • set

        public void set​(int[] indices,
                        CipPath val)
        Description copied from class: BaseDataType
        Application-side value storage. Subclasses must implement this function to store one value or complex element into the storage array.
        Specified by:
        set in class BaseDataType<CipPath>
        Parameters:
        indices - Array subscripts. Missing subscripts not allowed.
      • bytesEach

        public int bytesEach()
        Description copied from class: BaseDataType
        Obtain the bytes-per-element of this object's payload encoding. Objects with variable length encodings must return zero and implement the bytesImpl(), minEach(), maxEach(), and alignment() methods instead.
        Specified by:
        bytesEach in class BaseDataType<CipPath>
        Returns:
        encoded bytes per element
      • setPayload

        public void setPayload​(java.nio.ByteBuffer source,
                               int... indices)
        Description copied from class: BaseDataType
        Decode a value from specification wire format to instance storage.
        Overrides:
        setPayload in class BaseDataType<CipPath>
      • setPayloadImpl

        protected void setPayloadImpl​(java.nio.ByteBuffer source,
                                      int[] indices)
        Description copied from class: BaseDataType
        All concrete implementations must supply their per-element decoder here.
        Specified by:
        setPayloadImpl in class BaseDataType<CipPath>
      • putPayload

        public void putPayload​(java.nio.ByteBuffer dest,
                               int... indices)
        Description copied from class: BaseDataType
        All CIP datatypes must provide bytestream payloads. When an array, and fewer indices are supplied than dimensions, multiple consecutive payloads are to be written from the array into the destination buffer.
        Overrides:
        putPayload in class BaseDataType<CipPath>
      • putPayloadImpl

        protected void putPayloadImpl​(java.nio.ByteBuffer dest,
                                      int[] indices)
        Description copied from class: BaseDataType
        All concrete implementations must supply their per-element encoder here.
        Specified by:
        putPayloadImpl in class BaseDataType<CipPath>
      • bytesImpl

        protected int bytesImpl​(int[] indices)
        Description copied from class: BaseDataType
        Retrieve the bytes payload size of a single array element (or sole element). Objects with fixed element sizes may simply return bytesEach() here.
        Specified by:
        bytesImpl in class BaseDataType<CipPath>
        Returns:
      • wrap

        public CipEPATH wrap​(int[] indices)
        Description copied from class: BaseDataType
        Application-side wrapper for inner dimensions. Implementations must update memberOffsets if not not using the protected constructor.
        Specified by:
        wrap in class BaseDataType<CipPath>
        Parameters:
        indices - Array subscripts. Missing subscripts are allowed.