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 class
StructDefSeg.Parser
Parse 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 protected
StructDefSeg(byte segtype)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
alignment(DataContext ctx)
Alignment is normally the natural size of a primitive element.java.util.List<PathSegment>
browseInner(DataContext ctx)
DecoratedDefSeg
follow(PathSegment seg, DataContext ctx)
Step into this type definition by the given selector, returning the inner type definition.protected StructMember
followMember(PathSegment seg, DataContext ctx)
DataDefinitionSeg.DataDefinitionFragment
followOffsets(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.Integer
getCRC()
abstract StructDef
getDef(DataContext ctx)
protected int
getSizeImpl(DataContext ctx)
Return the number of bytes occupied by a single instance of the given data type.abstract java.lang.String
getTypeName()
int
maxSize(DataContext ctx)
Some data types need to offer a range of sizes for the encoded form of their data.int
minSize(DataContext ctx)
Some data types need to offer a range of sizes for the encoded form of their data.abstract void
setCRC(int CRC)
abstract void
setTypeName(java.lang.String typeName)
java.lang.String
simpleString()
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:DataDefinitionSeg
Return 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:
getSizeImpl
in classDataDefinitionSeg
- Returns:
- Number of bytes.
-
minSize
public int minSize(DataContext ctx)
Description copied from class:DataDefinitionSeg
Some data types need to offer a range of sizes for the encoded form of their data. The common case is fixed.- Overrides:
minSize
in classDataDefinitionSeg
- Returns:
-
maxSize
public int maxSize(DataContext ctx)
Description copied from class:DataDefinitionSeg
Some data types need to offer a range of sizes for the encoded form of their data. The common case is fixed.- Overrides:
maxSize
in classDataDefinitionSeg
- Returns:
-
alignment
public int alignment(DataContext ctx)
Description copied from class:DataDefinitionSeg
Alignment is normally the natural size of a primitive element. Structured types and variable length types must override this method.- Overrides:
alignment
in classDataDefinitionSeg
- Returns:
-
simpleString
public java.lang.String simpleString()
Description copied from class:PathSegment
Supply 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:
simpleString
in classPathSegment
- Returns:
-
followMember
protected StructMember followMember(PathSegment seg, DataContext ctx)
-
follow
public DecoratedDefSeg follow(PathSegment seg, DataContext ctx)
Description copied from class:DataDefinitionSeg
Step into this type definition by the given selector, returning the inner type definition. Look up inner types with the given context.- Overrides:
follow
in classDataDefinitionSeg
- Returns:
-
followOffsets
public DataDefinitionSeg.DataDefinitionFragment followOffsets(java.lang.Integer outerByteOffset, PathSegment seg, DataContext ctx)
Description copied from class:DataDefinitionSeg
Step 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:
followOffsets
in classDataDefinitionSeg
- Returns:
-
browseInner
public java.util.List<PathSegment> browseInner(DataContext ctx)
- Overrides:
browseInner
in classDataDefinitionSeg
-
-