Class StructDefSeg
- java.lang.Object
-
- com.automation_pros.odva.cip.path.PathSegment
-
- com.automation_pros.odva.cip.path.DataDefinitionSeg
-
- com.automation_pros.odva.cip.path.StructDefSeg
-
- All Implemented Interfaces:
java.lang.Comparable<PathSegment>
- Direct Known Subclasses:
AbbrevStructSeg,AnonStructSeg,NamedStructSeg
public abstract class StructDefSeg extends DataDefinitionSeg
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStructDefSeg.ParserParse after the keyword "Struct" to obtain either an abbreviated structure segment (numeric CRC code) or a named structure segment (anything other identifier).-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.path.DataDefinitionSeg
DataDefinitionSeg.DataDefinitionFragment
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.path.PathSegment
PathSegment.HasAlternateHex
-
-
Field Summary
-
Fields inherited from class com.automation_pros.odva.cip.path.DataDefinitionSeg
sLogger
-
Fields inherited from class com.automation_pros.odva.cip.path.PathSegment
identifierChars, segtype
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedStructDefSeg(byte segtype)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intalignment(DataContext ctx)Alignment is normally the natural size of a primitive element.java.util.List<PathSegment>browseInner(DataContext ctx)DecoratedDefSegfollow(PathSegment seg, DataContext ctx)Step into this type definition by the given selector, returning the inner type definition.protected StructMemberfollowMember(PathSegment seg, DataContext ctx)DataDefinitionSeg.DataDefinitionFragmentfollowOffsets(java.lang.Integer outerByteOffset, PathSegment seg, DataContext ctx)Step into this type definition by the given selector, returning the inner type definition.abstract java.lang.IntegergetCRC()abstract StructDefgetDef(DataContext ctx)protected intgetSizeImpl(DataContext ctx)Return the number of bytes occupied by a single instance of the given data type.abstract java.lang.StringgetTypeName()intmaxSize(DataContext ctx)Some data types need to offer a range of sizes for the encoded form of their data.intminSize(DataContext ctx)Some data types need to offer a range of sizes for the encoded form of their data.abstract voidsetCRC(int CRC)abstract voidsetTypeName(java.lang.String typeName)java.lang.StringsimpleString()Supply s simple descriptive name usable when browsing a hierarchy.-
Methods inherited from class com.automation_pros.odva.cip.path.DataDefinitionSeg
construct, construct, fromClass, fromData, getPermItem, getSize, isBoolHost, isBoolImpl, isStringData, nestedMaxSize, nestedMinSize, nestedSize, nestedSizeImpl
-
Methods inherited from class com.automation_pros.odva.cip.path.PathSegment
compareTo, decode, decodeAll, equals, getBytes, getSegtype, getTokens, getWords, hexString, mergeTokens, put, registerHandler, set, setSegtype, toString
-
-
-
-
Method Detail
-
getDef
public abstract StructDef getDef(DataContext ctx)
-
getCRC
public abstract java.lang.Integer getCRC()
-
setCRC
public abstract void setCRC(int CRC)
-
getTypeName
public abstract java.lang.String getTypeName()
-
setTypeName
public abstract void setTypeName(java.lang.String typeName)
-
getSizeImpl
protected int getSizeImpl(DataContext ctx)
Description copied from class:DataDefinitionSegReturn the number of bytes occupied by a single instance of the given data type. When the data is indirect, size is zero. When the data is variable length, size is -1;- Specified by:
getSizeImplin classDataDefinitionSeg- Returns:
- Number of bytes.
-
minSize
public int minSize(DataContext ctx)
Description copied from class:DataDefinitionSegSome data types need to offer a range of sizes for the encoded form of their data. The common case is fixed.- Overrides:
minSizein classDataDefinitionSeg- Returns:
-
maxSize
public int maxSize(DataContext ctx)
Description copied from class:DataDefinitionSegSome data types need to offer a range of sizes for the encoded form of their data. The common case is fixed.- Overrides:
maxSizein classDataDefinitionSeg- Returns:
-
alignment
public int alignment(DataContext ctx)
Description copied from class:DataDefinitionSegAlignment is normally the natural size of a primitive element. Structured types and variable length types must override this method.- Overrides:
alignmentin classDataDefinitionSeg- Returns:
-
simpleString
public java.lang.String simpleString()
Description copied from class:PathSegmentSupply s simple descriptive name usable when browsing a hierarchy. A simple type name for elementary types, a non-detailed description for complex types.- Specified by:
simpleStringin classPathSegment- Returns:
-
followMember
protected StructMember followMember(PathSegment seg, DataContext ctx)
-
follow
public DecoratedDefSeg follow(PathSegment seg, DataContext ctx)
Description copied from class:DataDefinitionSegStep into this type definition by the given selector, returning the inner type definition. Look up inner types with the given context.- Overrides:
followin classDataDefinitionSeg- Returns:
-
followOffsets
public DataDefinitionSeg.DataDefinitionFragment followOffsets(java.lang.Integer outerByteOffset, PathSegment seg, DataContext ctx)
Description copied from class:DataDefinitionSegStep into this type definition by the given selector, returning the inner type definition. Look up inner types with the given context. Deliver a null byteOffset if unknowable.- Overrides:
followOffsetsin classDataDefinitionSeg- Returns:
-
browseInner
public java.util.List<PathSegment> browseInner(DataContext ctx)
- Overrides:
browseInnerin classDataDefinitionSeg
-
-