Interface DataContext
-
- All Known Implementing Classes:
AbstractPort
,AbstractTypesCtx
,Assembly
,Assembly.DynamicData
,Assembly.MemberList
,AssyMgr
,AttributeRO
,BridgeInConx
,BridgeOutConx
,CipAttribute
,CipAttribute.Proxy
,CipClass
,CipClassMirror
,CipDevice
,CipDeviceMirror
,CipInstance
,CipObject
,CipObjectMirror
,CipStruct
,CipTreeCtx
,ConnectableAttr
,ConxClass
,ConxInstance
,ConxMgrMgr
,CxManager
,CxManager.ConxBitmapAttr
,EncapPort
,EnetInstance
,EnetInstance.MacIDAttr
,EthernetMgr
,Identity
,IdentityMgr
,IndirectAttr
,IndirectAttrRO
,IOConx
,LgxChange
,LgxChangeMgr
,LgxDevice
,LgxProbeContext
,LgxProgram
,LgxTag
,LgxTagMgr
,LgxTemplate
,LgxTplMgr
,LocalBusPort
,LocalBusPort.ChassisEKeyAttr
,LocalConx
,MsgRouter
,MsgRouterMgr
,MsgTargetConx
,OmronProbeContext
,Parameter
,ParamMgr
,PortMgr
,PortMgr.PortListAttr
,StructDefCtx
,TcpConx
,TcpIp
,TcpIpInstance
,TcpIpPort
public interface DataContext
A Data Context is a view into a collection of addressable objects, each containing an instance of BaseDataType. When constructing or interacting with one of these addressable objects, the data context's "current" path should be the path of the object itself. Any references within the object should first be interpreted by the context as concatenated with the object path. If not valid, the parent data context valid path is obtained or the bare reference is evaluated.The Data Context is also the entity that would hold predefined named data types for the application, initialized by implementations of this interface in any desired fashion.
-
-
Field Summary
Fields Modifier and Type Field Description static DataContext
emptyContext
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.Integer
fromEnum(java.lang.String v)
default BaseDataType<?>
getCtxData(java.util.List<PathSegment> reference)
Look up reference data for use in indirection of various kinds, including array dimensions and array member/bit numbers.BaseDataType<?>
getCtxDataImpl(java.util.List<PathSegment> reference)
Look up reference data within this current context for use in indirection of various kinds, as described for getCtxData(), which uses this implementation and handles delegation to outer contexts.default BaseDataType<?>
getCtxDataOrNull(java.util.List<PathSegment> reference)
AnonStructSeg
getNamedDef(java.lang.String typeName)
Look up a named type for use expanding a stub definition or to apply to a different context.DataContext
getParentDataCtx()
Get the next outer DataContext from the current context.java.lang.String
getTypeByCRC(int crc)
Look up a named type by CRC for use directly by a StructureDefSeg or indirectly by an AnonTypeSeg.StructDef
getTypeByName(java.lang.String typeName)
Look up a named type for use constructing nested elements of a structure.default java.util.List<StructDef>
getTypes()
Enumerate all known (named) types in the context.java.util.ArrayList<StructDef>
getTypesImpl()
default CipBOOL
makeHosted(PathSegment parentSeg, BoolHost parent, int bitnum)
default CipBOOL
makeUnhosted()
default java.lang.String
toEnum(int v)
-
-
-
Field Detail
-
emptyContext
static final DataContext emptyContext
-
-
Method Detail
-
getParentDataCtx
DataContext getParentDataCtx()
Get the next outer DataContext from the current context.- Returns:
- The containing DataContext, or null if the current context is the root context.
-
getNamedDef
AnonStructSeg getNamedDef(java.lang.String typeName)
Look up a named type for use expanding a stub definition or to apply to a different context.
-
getTypeByName
StructDef getTypeByName(java.lang.String typeName)
Look up a named type for use constructing nested elements of a structure.- Parameters:
typeName
- The type name to look up in the predefined names.- Returns:
- The type suitable for use with CipStruct and/or StructMember.
-
getTypesImpl
java.util.ArrayList<StructDef> getTypesImpl()
-
getTypes
default java.util.List<StructDef> getTypes()
Enumerate all known (named) types in the context.- Returns:
-
getTypeByCRC
java.lang.String getTypeByCRC(int crc)
Look up a named type by CRC for use directly by a StructureDefSeg or indirectly by an AnonTypeSeg.- Parameters:
crc
-- Returns:
- The type suitable for use with CipStruct and/or StructMember.
-
getCtxDataImpl
BaseDataType<?> getCtxDataImpl(java.util.List<PathSegment> reference)
Look up reference data within this current context for use in indirection of various kinds, as described for getCtxData(), which uses this implementation and handles delegation to outer contexts.- Parameters:
reference
- The path to a data item.- Returns:
- A data object
-
getCtxData
default BaseDataType<?> getCtxData(java.util.List<PathSegment> reference)
Look up reference data for use in indirection of various kinds, including array dimensions and array member/bit numbers. These latter should yield an integer elementary type that implements the .intValue() method.Implementations are expected to delegate to a parent DataContext if the current context cannot resolve the reference.
- Parameters:
reference
- The path to a data item.- Returns:
- A data object
-
getCtxDataOrNull
default BaseDataType<?> getCtxDataOrNull(java.util.List<PathSegment> reference)
-
toEnum
default java.lang.String toEnum(int v)
-
fromEnum
default java.lang.Integer fromEnum(java.lang.String v)
-
makeHosted
default CipBOOL makeHosted(PathSegment parentSeg, BoolHost parent, int bitnum)
-
makeUnhosted
default CipBOOL makeUnhosted()
-
-