Class CFacade
- java.lang.Object
-
- org.cakelab.blender.nio.CFacade
-
- Direct Known Subclasses:
AnimData
,AnimOverride
,ARegion
,ARegion_Runtime
,ArmatureGpencilModifierData
,ArmatureModifierData
,ArrayGpencilModifierData
,ArrayModifierData
,AssetLibraryReference
,AssetMetaData
,AssetTag
,AudioData
,AviCodecData
,bAction
,bActionChannel
,bActionConstraint
,bActionGroup
,bActionModifier
,bActionStrip
,bAddon
,BakeData
,bAnimVizSettings
,bArmature
,bArmatureConstraint
,Base
,bCameraSolverConstraint
,bChildOfConstraint
,bClampToConstraint
,bConstraint
,bConstraintChannel
,bConstraintTarget
,bDampTrackConstraint
,bDeformGroup
,bDistLimitConstraint
,bDopeSheet
,BevelModifierData
,BezTriple
,bFaceMap
,bFollowPathConstraint
,bFollowTrackConstraint
,bGPdata
,bGPdata_Runtime
,bGPDcontrolpoint
,bGPDcurve
,bGPDcurve_point
,bGPDframe
,bGPDframe_Runtime
,bGPDlayer
,bGPDlayer_Mask
,bGPDlayer_Runtime
,bGPDpalette
,bGPDpalettecolor
,bGPDspoint
,bGPDspoint_Runtime
,bGPDstroke
,bGPDstroke_Runtime
,bGPDtriangle
,bGPgrid
,bIKParam
,bItasc
,bKinematicConstraint
,BlenderObject
,bLocateLikeConstraint
,bLockTrackConstraint
,bLocLimitConstraint
,BlurShaderFxData
,bMinMaxConstraint
,bMotionPath
,bMotionPathVert
,bNode
,bNodeInstanceKey
,bNodeLink
,bNodeSocket
,bNodeSocketValueBoolean
,bNodeSocketValueCollection
,bNodeSocketValueFloat
,bNodeSocketValueImage
,bNodeSocketValueInt
,bNodeSocketValueMaterial
,bNodeSocketValueObject
,bNodeSocketValueRGBA
,bNodeSocketValueString
,bNodeSocketValueTexture
,bNodeSocketValueVector
,bNodeStack
,bNodeTree
,bNodeTreePath
,bObjectSolverConstraint
,BoidData
,BoidParticle
,BoidRule
,BoidRuleAverageSpeed
,BoidRuleAvoidCollision
,BoidRuleFight
,BoidRuleFollowLeader
,BoidRuleGoalAvoid
,BoidSettings
,BoidState
,Bone
,BooleanModifierData
,BoundBox
,bPathCompare
,bPivotConstraint
,BPoint
,bPose
,bPoseChannel
,bPoseChannel_Runtime
,bPythonConstraint
,BrightContrastModifierData
,bRigidBodyJointConstraint
,bRotateLikeConstraint
,bRotLimitConstraint
,Brush
,BrushClone
,BrushCurvesSculptSettings
,BrushGpencilSettings
,bSameVolumeConstraint
,bScreen
,bShrinkwrapConstraint
,bSizeLikeConstraint
,bSizeLimitConstraint
,bSound
,bSplineIKConstraint
,bStretchToConstraint
,bTheme
,bToolRef
,bTrackToConstraint
,bTransformCacheConstraint
,bTransformConstraint
,bTransLikeConstraint
,BuildEff
,BuildGpencilModifierData
,BuildModifierData
,bUserAssetLibrary
,bUserMenu
,bUserMenuItem
,bUserMenuItem_Menu
,bUserMenuItem_Op
,bUserMenuItem_Prop
,bUUID
,CacheFile
,CacheFileLayer
,CacheObjectPath
,Camera
,Camera_Runtime
,CameraBGImage
,CameraDOFSettings
,CameraStereoSettings
,CastModifierData
,CBData
,ChannelDriver
,CharInfo
,ChildParticle
,ClothCollSettings
,ClothModifierData
,ClothSimSettings
,Collection
,CollectionChild
,CollectionObject
,CollisionModifierData
,ColorBalanceModifierData
,ColorBand
,ColorCorrectionData
,ColorGpencilModifierData
,ColorizeShaderFxData
,ColorManagedColorspaceSettings
,ColorManagedDisplaySettings
,ColorManagedViewSettings
,ColorMapping
,ColorMixVars
,ConsoleLine
,CorrectiveSmoothDeltaCache
,CorrectiveSmoothModifierData
,CPointer
,CryptomatteEntry
,CryptomatteLayer
,Curve
,CurveMap
,CurveMapping
,CurveMapPoint
,CurveModifierData
,CurvePaintSettings
,CurveProfile
,CurveProfilePoint
,Curves
,CurvesGeometry
,CurvesModifierData
,CurvesSculpt
,CustomData
,CustomData_MeshMasks
,CustomDataExternal
,CustomDataLayer
,DashGpencilModifierData
,DashGpencilModifierSegment
,DataTransferModifierData
,DecimateModifierData
,DisplaceModifierData
,DisplaySafeAreas
,DrawDataList
,DriverTarget
,DriverVar
,DualQuat
,DynamicPaintBrushSettings
,DynamicPaintCanvasSettings
,DynamicPaintModifierData
,DynamicPaintSurface
,EdgeSplitModifierData
,Editing
,EditingRuntime
,Effect
,EffectorWeights
,EnvelopeGpencilModifierData
,ExplodeModifierData
,FCM_EnvelopeData
,FCurve
,FFMpegCodecData
,FileAssetSelectParams
,FileFolderHistory
,FileGlobal
,FileSelectParams
,FlipShaderFxData
,FluidDomainSettings
,FluidEffectorSettings
,FluidFlowSettings
,FluidModifierData
,FluidsimModifierData
,FluidsimSettings
,FluidVertexVelocity
,FMod_Cycles
,FMod_Envelope
,FMod_FunctionGenerator
,FMod_Generator
,FMod_Limits
,FMod_Noise
,FMod_Python
,FMod_Stepped
,FModifier
,FPoint
,FreestyleConfig
,FreestyleEdge
,FreestyleFace
,FreestyleLineSet
,FreestyleLineStyle
,FreestyleModuleConfig
,GaussianBlurVars
,GlowShaderFxData
,GlowVars
,GP_Interpolate_Settings
,GP_Sculpt_Guide
,GP_Sculpt_Settings
,GpencilModifierData
,GpPaint
,GpSculptPaint
,GPUDOFSettings
,GpVertexPaint
,GpWeightPaint
,GridPaintMask
,HairKey
,Histogram
,HookGpencilModifierData
,HookModifierData
,HueCorrectModifierData
,ID
,ID_Runtime
,ID_Runtime_Remap
,IdAdtTemplate
,IDOverrideLibrary
,IDOverrideLibraryProperty
,IDOverrideLibraryPropertyOperation
,IDProperty
,IDPropertyData
,IDPropertyUIData
,IDPropertyUIDataFloat
,IDPropertyUIDataID
,IDPropertyUIDataInt
,IDPropertyUIDataString
,Image
,Image_Runtime
,ImageAnim
,ImageFormatData
,ImagePackedFile
,ImagePaintSettings
,ImageTile
,ImageTile_Runtime
,ImageTile_RuntimeTextureSlot
,ImageUser
,ImageView
,Ipo
,IpoCurve
,IpoDriver
,Key
,KeyBlock
,KeyingSet
,KS_Path
,Lamp
,LaplacianDeformModifierData
,LaplacianSmoothModifierData
,Lattice
,LatticeGpencilModifierData
,LatticeModifierData
,LayerCollection
,LengthGpencilModifierData
,Library
,LibraryWeakReference
,LightCache
,LightCacheTexture
,LightGridCache
,LightgroupMembership
,LightProbe
,LightProbeCache
,LineartGpencilModifierData
,LineStyleAlphaModifier_AlongStroke
,LineStyleAlphaModifier_CreaseAngle
,LineStyleAlphaModifier_Curvature_3D
,LineStyleAlphaModifier_DistanceFromCamera
,LineStyleAlphaModifier_DistanceFromObject
,LineStyleAlphaModifier_Material
,LineStyleAlphaModifier_Noise
,LineStyleAlphaModifier_Tangent
,LineStyleColorModifier_AlongStroke
,LineStyleColorModifier_CreaseAngle
,LineStyleColorModifier_Curvature_3D
,LineStyleColorModifier_DistanceFromCamera
,LineStyleColorModifier_DistanceFromObject
,LineStyleColorModifier_Material
,LineStyleColorModifier_Noise
,LineStyleColorModifier_Tangent
,LineStyleGeometryModifier_2DOffset
,LineStyleGeometryModifier_2DTransform
,LineStyleGeometryModifier_BackboneStretcher
,LineStyleGeometryModifier_BezierCurve
,LineStyleGeometryModifier_Blueprint
,LineStyleGeometryModifier_GuidingLines
,LineStyleGeometryModifier_PerlinNoise1D
,LineStyleGeometryModifier_PerlinNoise2D
,LineStyleGeometryModifier_Polygonalization
,LineStyleGeometryModifier_Sampling
,LineStyleGeometryModifier_Simplification
,LineStyleGeometryModifier_SinusDisplacement
,LineStyleGeometryModifier_SpatialNoise
,LineStyleGeometryModifier_TipRemover
,LineStyleModifier
,LineStyleThicknessModifier_AlongStroke
,LineStyleThicknessModifier_Calligraphy
,LineStyleThicknessModifier_CreaseAngle
,LineStyleThicknessModifier_Curvature_3D
,LineStyleThicknessModifier_DistanceFromCamera
,LineStyleThicknessModifier_DistanceFromObject
,LineStyleThicknessModifier_Material
,LineStyleThicknessModifier_Noise
,LineStyleThicknessModifier_Tangent
,Link
,LinkData
,ListBase
,MappingInfoModifierData
,Mask
,MaskLayer
,MaskLayerShape
,MaskModifierData
,MaskParent
,MaskSpaceInfo
,MaskSpline
,MaskSplinePoint
,MaskSplinePointUW
,Material
,MaterialGPencilStyle
,MaterialLineArt
,MBoolProperty
,MCol
,MDefCell
,MDefInfluence
,MDeformVert
,MDeformWeight
,MDisps
,MEdge
,Mesh
,Mesh_Runtime
,MeshCacheModifierData
,MeshDeformModifierData
,MeshSeqCacheModifierData
,MeshStatVis
,MeshToVolumeModifierData
,MetaBall
,MetaElem
,MetaStack
,MFace
,MFloatProperty
,MInt8Property
,MIntProperty
,MirrorGpencilModifierData
,MirrorModifierData
,MLoop
,MLoopCol
,MLoopTri
,MLoopTri_Store
,MLoopUV
,ModifierData
,MovieClip
,MovieClip_Runtime
,MovieClip_RuntimeGPUTexture
,MovieClipProxy
,MovieClipScopes
,MovieClipUser
,MovieReconstructedCamera
,MovieTracking
,MovieTrackingCamera
,MovieTrackingDopesheet
,MovieTrackingDopesheetChannel
,MovieTrackingDopesheetCoverageSegment
,MovieTrackingMarker
,MovieTrackingObject
,MovieTrackingPlaneMarker
,MovieTrackingPlaneTrack
,MovieTrackingReconstruction
,MovieTrackingSettings
,MovieTrackingStabilization
,MovieTrackingStats
,MovieTrackingTrack
,MPoly
,MPropCol
,MRecast
,MSelect
,MStringProperty
,MTex
,MTFace
,MultiplyGpencilModifierData
,MultiresModifierData
,MVert
,MVertSkin
,NlaStrip
,NlaTrack
,NodeAccumulateField
,NodeAntiAliasingData
,NodeBilateralBlurData
,NodeBlurData
,NodeBokehImage
,NodeBoxMask
,NodeChroma
,NodeColorBalance
,NodeColorCorrection
,NodeColorspill
,NodeConvertColorSpace
,NodeCryptomatte
,NodeCryptomatte_Runtime
,NodeDBlurData
,NodeDefocus
,NodeDenoise
,NodeDilateErode
,NodeEllipseMask
,NodeFrame
,NodeFunctionCompare
,NodeGeometryAttributeCapture
,NodeGeometryCollectionInfo
,NodeGeometryCurveFill
,NodeGeometryCurveFillet
,NodeGeometryCurvePrimitiveArc
,NodeGeometryCurvePrimitiveBezierSegment
,NodeGeometryCurvePrimitiveCircle
,NodeGeometryCurvePrimitiveLine
,NodeGeometryCurvePrimitiveQuad
,NodeGeometryCurveResample
,NodeGeometryCurveSample
,NodeGeometryCurveSelectHandles
,NodeGeometryCurveSetHandles
,NodeGeometryCurveSplineType
,NodeGeometryCurveToPoints
,NodeGeometryCurveTrim
,NodeGeometryDeleteGeometry
,NodeGeometryDuplicateElements
,NodeGeometryExtrudeMesh
,NodeGeometryImageTexture
,NodeGeometryInputNamedAttribute
,NodeGeometryMergeByDistance
,NodeGeometryMeshCircle
,NodeGeometryMeshCone
,NodeGeometryMeshCylinder
,NodeGeometryMeshLine
,NodeGeometryMeshToPoints
,NodeGeometryObjectInfo
,NodeGeometryPointsToVolume
,NodeGeometryProximity
,NodeGeometryRaycast
,NodeGeometrySeparateGeometry
,NodeGeometrySetCurveHandlePositions
,NodeGeometryStoreNamedAttribute
,NodeGeometryStringToCurves
,NodeGeometrySubdivisionSurface
,NodeGeometryTransferAttribute
,NodeGeometryViewer
,NodeGeometryVolumeToMesh
,NodeGlare
,NodeHueSat
,NodeImageAnim
,NodeImageFile
,NodeImageLayer
,NodeImageMultiFile
,NodeImageMultiFileSocket
,NodeInputBool
,NodeInputColor
,NodeInputInt
,NodeInputString
,NodeInputVector
,NodeKeyingData
,NodeKeyingScreenData
,NodeLensDist
,NodeMapRange
,NodeMask
,NodePlaneTrackDeformData
,NodeRandomValue
,NodeScriptDict
,NodeSetAlpha
,NodeShaderAttribute
,NodeShaderNormalMap
,NodeShaderOutputAOV
,NodeShaderPrincipled
,NodeShaderScript
,NodeShaderTangent
,NodeShaderTexIES
,NodeShaderTexPointDensity
,NodeShaderUVMap
,NodeShaderVectTransform
,NodeShaderVertexColor
,NodesModifierData
,NodesModifierSettings
,NodeSunBeams
,NodeSwitch
,NodeTexBase
,NodeTexBrick
,NodeTexChecker
,NodeTexEnvironment
,NodeTexGradient
,NodeTexImage
,NodeTexMagic
,NodeTexMusgrave
,NodeTexNoise
,NodeTexSky
,NodeTexVoronoi
,NodeTexWave
,NodeTonemap
,NodeTrackPosData
,NodeTranslateData
,NodeTwoFloats
,NodeTwoXYs
,NodeVertexCol
,NoiseGpencilModifierData
,NormalEditModifierData
,Nurb
,ObHook
,Object_Runtime
,ObjectLineArt
,OceanModifierData
,OffsetGpencilModifierData
,OpacityGpencilModifierData
,PackedFile
,Paint
,Paint_Runtime
,PaintCurve
,PaintCurvePoint
,PaintModeSettings
,PaintToolSlot
,Palette
,PaletteColor
,Panel
,Panel_Runtime
,PanelCategoryStack
,PartDeflect
,PartEff
,ParticleBrushData
,ParticleData
,ParticleDupliWeight
,ParticleEditSettings
,ParticleInstanceModifierData
,ParticleKey
,ParticleSettings
,ParticleSpring
,ParticleSystem
,ParticleSystemModifierData
,ParticleTarget
,PhysicsSettings
,PixelShaderFxData
,PointCache
,PointCloud
,PointDensity
,PreviewImage
,PTCacheExtra
,PTCacheMem
,rctf
,rcti
,RegionView3D
,RemeshModifierData
,RenderData
,RenderProfile
,RenderSlot
,ReportList
,RigidBodyCon
,RigidBodyOb
,RigidBodyWorld
,RigidBodyWorld_Shared
,RimShaderFxData
,SBVertex
,Scene
,SceneCollection
,SceneDisplay
,SceneEEVEE
,SceneGpencil
,SceneRenderLayer
,SceneRenderView
,Scopes
,ScrArea
,ScrArea_Runtime
,ScrAreaMap
,ScrEdge
,ScrewModifierData
,ScrGlobalAreaData
,Script
,ScrVert
,Sculpt
,SDefBind
,SDefVert
,SeqTimelineChannel
,Sequence
,SequenceModifierData
,SequencerMaskModifierData
,SequencerPreviewOverlay
,SequencerScopes
,SequencerTimelineOverlay
,SequencerTonemapModifierData
,SequencerToolSettings
,SequenceRuntime
,SessionUUID
,ShaderFxData
,ShaderFxData_Runtime
,ShadowShaderFxData
,ShapeKeyModifierData
,ShrinkwrapGpencilModifierData
,ShrinkwrapModifierData
,SimpleDeformModifierData
,SimplifyGpencilModifierData
,Simulation
,SkinModifierData
,SmokeModifierData
,SmoothGpencilModifierData
,SmoothModifierData
,SoftBody
,SoftBody_Shared
,SoftbodyModifierData
,SolidColorVars
,SolidifyModifierData
,SolidLight
,SpaceAction
,SpaceAction_Runtime
,SpaceButs
,SpaceClip
,SpaceConsole
,SpaceFile
,SpaceGraph_Runtime
,SpaceImage
,SpaceImageOverlay
,SpaceInfo
,SpaceIpo
,SpaceLink
,SpaceNla
,SpaceNode
,SpaceNodeOverlay
,SpaceOops
,SpaceScript
,SpaceSeq
,SpaceSeqRuntime
,SpaceSpreadsheet
,SpaceStatusBar
,SpaceText
,SpaceText_Runtime
,SpaceTopBar
,SpaceUserPref
,Speaker
,SpeedControlVars
,SPHFluidSettings
,SpreadsheetColumn
,SpreadsheetColumnID
,SpreadsheetContext
,SpreadsheetContextModifier
,SpreadsheetContextNode
,SpreadsheetContextObject
,SpreadsheetRowFilter
,Stereo3dFormat
,Strip
,StripAnim
,StripColorBalance
,StripCrop
,StripElem
,StripProxy
,StripTransform
,SubdivGpencilModifierData
,SubsurfModifierData
,SurfaceDeformModifierData
,SurfaceModifierData
,SwirlShaderFxData
,Tex
,TexMapping
,TexNodeOutput
,TexPaintSlot
,Text
,TextBox
,TextLine
,TextureGpencilModifierData
,TextVars
,TFace
,ThemeCollectionColor
,ThemeSpace
,ThemeStripColor
,ThemeUI
,ThemeWireColor
,ThickGpencilModifierData
,TimeGpencilModifierData
,TimeMarker
,TintGpencilModifierData
,ToolSettings
,tPaletteColorHSV
,TransformOrientation
,TransformOrientationSlot
,TransformVars
,TreeStore
,TreeStoreElem
,TriangulateModifierData
,uiFontStyle
,uiList
,uiPanelColors
,uiPreview
,uiStyle
,uiWidgetColors
,uiWidgetStateColors
,UnifiedPaintSettings
,UnitSettings
,UserDef
,UserDef_Experimental
,UserDef_FileSpaceData
,UserDef_Runtime
,UserDef_SpaceData
,UVProjectModifierData
,UvSculpt
,UVWarpModifierData
,vec2f
,vec2s
,vec3f
,VFont
,View2D
,View3D
,View3D_Runtime
,View3DCursor
,View3DOverlay
,View3DShading
,ViewLayer
,ViewLayerAOV
,ViewLayerEEVEE
,ViewLayerEngineData
,ViewLayerLightgroup
,Volume
,Volume_Runtime
,VolumeDisplaceModifierData
,VolumeDisplay
,VolumeRender
,VolumeToMeshModifierData
,VPaint
,WalkNavigation
,WarpModifierData
,WaveEff
,WaveModifierData
,WaveShaderFxData
,WeightAngleGpencilModifierData
,WeightedNormalModifierData
,WeightProxGpencilModifierData
,WeightVGEditModifierData
,WeightVGMixModifierData
,WeightVGProximityModifierData
,WeldModifierData
,WhiteBalanceModifierData
,WipeVars
,WireframeModifierData
,wmKeyConfig
,wmKeyConfigPref
,wmKeyMap
,wmKeyMapDiffItem
,wmKeyMapItem
,wmOperator
,wmOwnerID
,wmWindow
,wmWindowManager
,wmXrData
,WorkSpace
,WorkSpaceDataRelation
,WorkSpaceInstanceHook
,WorkSpaceLayout
,World
,XrActionMap
,XrActionMapBinding
,XrActionMapItem
,XrComponentPath
,XrSessionSettings
,XrUserPath
public abstract class CFacade extends java.lang.Object
CFacade
is the base class of all complex types (structs).A facade derived from this class, provides a type safe interface to access (get/set) data in native memory (associated block). This class holds the reference on the associated memory region in a block of a blender file and provides methods to access it as well as helper methods to deal with type casts etc..
Memory Life Cycle
Since a facade is just a view on data, its life cycle is not synchronised with the life cycle of the associated data. That means, if the facade is garbage collected, the associated data in the block will still remain in the file. To understand how to remove the data from the file refer to
BlenderFile
andBlockTable
.Facades on Instances of Structs
Derived classes of CFacade which represent actual facades on struct instances in a blender file, provide getter and setter methods to access member variables of the struct in the associated block, but do not contain the member variables itself.
Every CFacade which represents a struct, contains descriptors for each of its member variables. Member variable descriptors are used to identify member variables for example in
__io__addressof(long[])
and they are used to provide javadoc documentation for the member variable. Member variable descriptors always start with the prefix__DNA__FIELD__
followed by the name of the member variable.- Author:
- homac
-
-
Field Summary
Fields Modifier and Type Field Description protected long
__io__address
Address of the data for this instance in an existing block.protected int
__io__arch_index
The architecure index is used internally to determine the position of a struct member variable from its descriptor, in respect to the encoding of the underlying block.protected Block
__io__block
Block, which contains the data of the instance.protected BlockTable
__io__blockTable
Block table which contains the block with the data of the associated instance.protected int
__io__pointersize
This is the address width used by the encoding of the underlying data.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CFacade(long address, Block block, BlockTable blockTable)
Common constructor for a facade on an existing instance of a DNA struct, a pointer or an array.protected
CFacade(CFacade other, long targetAddress)
Copy constructor, which assigns the instantiated facade to a another address.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CPointer<java.lang.Object>
__io__addressof(long[] fieldDescriptor)
This method creates a void pointer on the field identified by 'fieldDescriptor' of the struct represented by the facade (see static fields __DNA__FIELD__<fieldname> in the facades).static <T extends CFacade>
CPointer<T>__io__addressof(T object)
This method creates a pointer on the given instance (object).protected boolean
__io__equals(CFacade facade, long address)
Tests whether the facade references the given address in the same file as the given facade.protected void
__io__generic__copy(CFacade source)
This method does a highlevel copy of the given source to this object.protected static void
__io__generic__copy(CFacade target, CFacade source)
Does a high-level copy (meber by member) from source to target.static boolean
__io__instanceof(CFacade object, java.lang.Class<?> clazz)
Tests whether the given object is an instance or some subclass of class clazz.protected static void
__io__native__copy(Block targetBlock, long targetAddress, CFacade source)
This method performs a low level copy of the given object to the given target address in the target block.static CFacade
__io__newInstance(java.lang.Class<? extends CFacade> type, long address, Block block, BlockTable blockTable)
Creates a new facade instance of the given type.protected boolean
__io__same__encoding(CFacade facadeA, CFacade facadeB)
Tests whether the underlying data blocks of both facades use the same encoding (byte order and address length).long
__io__sizeof(java.lang.Class<?> ctype)
This method returns the size of the C type which corresponds to the given Java type according to the type mapping of Java Blend.static long
__io__sizeof(java.lang.Class<?> ctype, int addressWidth)
This method returns the size of the C type which corresponds to the given Java type according to the type mapping of Java Blend.static boolean
__io__subclassof(java.lang.Class<?> type, java.lang.Class<?> superType)
Tests whether the given type is a subclass of superType.boolean
equals(java.lang.Object obj)
int
hashCode()
-
-
-
Field Detail
-
__io__address
protected long __io__address
Address of the data for this instance in an existing block.
-
__io__blockTable
protected BlockTable __io__blockTable
Block table which contains the block with the data of the associated instance.
-
__io__block
protected Block __io__block
Block, which contains the data of the instance.
-
__io__arch_index
protected int __io__arch_index
The architecure index is used internally to determine the position of a struct member variable from its descriptor, in respect to the encoding of the underlying block.
-
__io__pointersize
protected int __io__pointersize
This is the address width used by the encoding of the underlying data.
-
-
Constructor Detail
-
CFacade
protected CFacade(long address, Block block, BlockTable blockTable)
Common constructor for a facade on an existing instance of a DNA struct, a pointer or an array.Preconditions:
- There must exist a block in the blockTable which is assigned to the given address
- Parameters:
address
- Start address of the instance.block
- The block which contains the address.blockTable
- Block table, which contains the block.
-
CFacade
protected CFacade(CFacade other, long targetAddress)
Copy constructor, which assigns the instantiated facade to a another address. Useful when iterating over multiple instances of the same struct type in a block.Preconditions:
targetAddress has to be in the block which is currently assigned to the 'other' facade.- Parameters:
other
- Instance to be copied.targetAddress
- Start address of the instance.
-
-
Method Detail
-
__io__sizeof
public long __io__sizeof(java.lang.Class<?> ctype)
This method returns the size of the C type which corresponds to the given Java type according to the type mapping of Java Blend. The method uses the architecture specifications (i.e. pointer size) associated with the block of the instance, this method was called on.- Parameters:
ctype
- The type which size is requested. Any kind of type representing a C data type, such as any of the sub-classes of CFacade, a CArrayFacade, CPointer or any of the primitive types (long, int, char ...).- Returns:
- sizeof(ctype)
-
__io__sizeof
public static long __io__sizeof(java.lang.Class<?> ctype, int addressWidth)
This method returns the size of the C type which corresponds to the given Java type according to the type mapping of Java Blend.- Parameters:
ctype
- Any kind of type representing a C data type, such as any of the sub-classes of CFacade, a CArrayFacade, CPointer or any of the primitive types (long, int, char ...).addressWidth
- Size of a pointer in bytes, based on architecture specifications (i.e. 4/8 bytes)- Returns:
- sizeof(ctype)
-
__io__addressof
public static <T extends CFacade> CPointer<T> __io__addressof(T object)
This method creates a pointer on the given instance (object).- Parameters:
object
- The instance whose pointer is requested.- Returns:
- pointer on the given instance
-
__io__addressof
public CPointer<java.lang.Object> __io__addressof(long[] fieldDescriptor)
This method creates a void pointer on the field identified by 'fieldDescriptor' of the struct represented by the facade (see static fields __DNA__FIELD__<fieldname> in the facades).The returned pointer has to be casted (by means of
CPointer.cast(Class)
and similar methods) in order to use pointer arithmetics on it. We had the choice here to either carry all type information for every field over to the runtime model (and waste a lot of performance) or deal with the risk of having void pointers. Since it is very rare that pointers on fields are needed, we decided to go with this approach.This method is highly dangerous because we do not check, whether the field descriptor actually belongs to the facade and it is directly interpreted as offset to the structs base address.
- Parameters:
fieldDescriptor
- The __DNA__FIELD__<fieldname> descriptor of the field, who's address will be determined.- Returns:
- Pointer on requested field.
-
__io__subclassof
public static boolean __io__subclassof(java.lang.Class<?> type, java.lang.Class<?> superType)
Tests whether the given type is a subclass of superType.- Parameters:
type
- type to be tested.superType
- expected base class of the given type.- Returns:
- true if true.
-
__io__instanceof
public static boolean __io__instanceof(CFacade object, java.lang.Class<?> clazz)
Tests whether the given object is an instance or some subclass of class clazz.
-
__io__newInstance
public static CFacade __io__newInstance(java.lang.Class<? extends CFacade> type, long address, Block block, BlockTable blockTable) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.SecurityException
Creates a new facade instance of the given type.- Parameters:
type
- The type of facade to instantiate.address
- The associated address for the instantiated facade.block
- The block, which contains the address.blockTable
- the global block map of the associated file.- Returns:
- new facade instance of the given type
- Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.SecurityException
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
__io__equals
protected boolean __io__equals(CFacade facade, long address)
Tests whether the facade references the given address in the same file as the given facade.- Parameters:
facade
-address
-- Returns:
- address (virtual) of the object, wrapped by the given facade.
-
__io__native__copy
protected static void __io__native__copy(Block targetBlock, long targetAddress, CFacade source) throws java.io.IOException
This method performs a low level copy of the given object to the given target address in the target block. This requires, that the target
- Parameters:
targetBlock
- Block, which will receive the written data.targetAddress
- Target address where the data will be written to. This address has to be in range of the given target block.source
- facade with the data to be copied to the given address.- Throws:
java.io.IOException
-
__io__generic__copy
protected void __io__generic__copy(CFacade source) throws java.io.IOException
This method does a highlevel copy of the given source to this object.The method is used in case a lowlevel copy (see
__io__native__copy(Block, long, CFacade)
) is not possible due to different encodings of the underlying blocks (see__io__same__encoding(CFacade, CFacade)
.Mandatory Preconditions
- This object and the source object are of exactly the same type.
- The source is not a CPointer.
The method is overridden by CArrayFacade.
- Parameters:
source
- An object derived from CFacade or CArrayFacade, but not CPointer.- Throws:
java.io.IOException
-
__io__generic__copy
protected static void __io__generic__copy(CFacade target, CFacade source) throws java.io.IOException
Does a high-level copy (meber by member) from source to target. Same astarget.__io__generic__copy(source)
.- Parameters:
target
- Facade, which gets its data overriden with the values of source.source
- Facade, which data gets copied to target.- Throws:
java.io.IOException
- See Also:
__io__generic__copy(CFacade)
-
-