Class StructDef

  • Direct Known Subclasses:
    PermStructDef

    public class StructDef
    extends java.lang.Object
    • Field Detail

      • sLogger

        public static final org.slf4j.Logger sLogger
      • typeName

        public final java.lang.String typeName
      • CRCstring

        public final java.lang.String CRCstring
      • members

        public final java.util.List<? extends StructMember> members
      • copyCache

        protected final java.util.Map<StructDef,​int[]> copyCache
      • depth

        public final int depth
      • maxAlign

        public final int maxAlign
      • altAlign

        public final boolean altAlign
      • size

        public final int size
      • minSize

        public final int minSize
      • maxSize

        public final int maxSize
      • logixCompatible

        public final boolean logixCompatible
      • logixCRC

        protected final int logixCRC
      • applicationCRC

        protected java.lang.Integer applicationCRC
      • templateInstance

        protected int templateInstance
      • documentation

        protected java.lang.String documentation
    • Constructor Detail

      • StructDef

        public StructDef​(java.lang.String typeName,
                         int alignment,
                         java.util.List<? extends StructMember> members)
    • Method Detail

      • getAlignment

        public int getAlignment()
      • getLogixCRC

        public int getLogixCRC()
      • getApplicationCRC

        public java.lang.Integer getApplicationCRC()
      • getEffectiveCRC

        public int getEffectiveCRC()
      • setApplicationCRC

        public void setApplicationCRC​(java.lang.Integer applicationCRC)
      • getNestingSeg

        public StructDefSeg getNestingSeg()
        Get an abbreviated form, if possible. Name is preferred, then application CRC. If neither is available, deliver the anonymous definition.

        The abbreviated forms are overridden to return this StructDef without regard to a supplied context. See getStructSeg() for more details.

        Returns:
        A self-referential named or abbreviated StructDefSeg if possible. Otherwise returns the full definition.
      • getTemplateInstance

        public int getTemplateInstance()
      • setTemplateInstance

        public void setTemplateInstance​(int templateInstance)
      • getDocumentation

        public java.lang.String getDocumentation()
      • setDocumentation

        public void setDocumentation​(java.lang.String documentation)
      • checkCircular

        public void checkCircular​(java.lang.String[] excludes)
        Implementations that use named types must call this before any attempt to instantiate in order to verify no circular type reference would be established.
        Parameters:
        excludes - Array of strings of the named types that must not be defined in any nested type.
      • getMember

        public StructMember getMember​(PathSegment seg)
        Look up a structure member by path segment selector.

        Throws a CipPathException if not present.

        Parameters:
        seg - Path Segment selector to interpret.
        Returns:
        Structure member that corresponds.
      • getMember

        public StructMember getMember​(java.lang.String name)
        Look up a named member.
        Parameters:
        name - The member name.
        Returns:
        The structure member, or null if not present.
      • getMemberAt

        public java.util.List<StructMember> getMemberAt​(int offset,
                                                        int bytes)
        Locate the concrete member(s) that contain(s) the given byte offset. Used to resolve aliases in probe operations.
        Parameters:
        offset - Byte location.
        bytes - Required minimum size to consider.
        Returns:
        A list of possible structure members that contain that offset and have that minimum size. Ordered from smallest to largest, then by byte offset. This puts matching aliases first. Hosted bits and Aliases that resolve to booleans are skipped. Those would have already been searched.
      • getBooleanAt

        public StructMember getBooleanAt​(int bitOffset)
        Locate the hosted boolean member that exactly matches the given bit offset, or the alias member that resolves to the same.
        Parameters:
        bitOffset -
        Returns:
      • getCopyMap

        public int[] getCopyMap​(StructDef other)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toDetailString

        public java.lang.String toDetailString()