public class BinOutPrep
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
BinOutPrep.TypeBinPosition |
private static class |
BinOutPrep.TypeNeedInBinOut
Position and type of a usage of type in a field.
|
Modifier and Type | Field and Description |
---|---|
private Class_Jc |
binClass |
private Field_Jc |
binField |
private ObjectArray_Jc |
binFieldArray |
private ObjectArray_Jc |
binOutClassArray
Access to binary class Array data for fileBin.
|
private byte[] |
binOutClassArrayData
Binary data for fileBin.
|
private byte[] |
binOutData
Binary data for fileBin.
|
private ExtReflection_Insp_h.ExtReflection_Insp |
binOutHead
Access to binary head data for fileBin.
|
private byte[] |
binOutHeadData
Binary data for fileBin.
|
private RawDataAccess |
binOutRefl
Access to binary data for fileBin.
|
private ObjectArray_Jc |
binOutSuperArray |
private SuperclassIfc_idxMtblJc_ByteDataAccess |
binSuperClass |
private java.io.OutputStream |
fileBin
If setOutBin is called, this writer is present, else it is null.
|
private java.util.Map<java.lang.String,java.lang.Integer> |
missingClasses |
private int |
nrofClasses |
private int |
nrofFieldsInClass
Counts the number of fields in 1 class.
|
private int |
nrofRelocEntries |
private java.util.Map<java.lang.String,BinOutPrep.TypeBinPosition> |
posClassesInBuffer |
private java.lang.String |
sFileBin |
private java.lang.String |
sFileList |
private java.util.List<BinOutPrep.TypeNeedInBinOut> |
typeBinNeed |
static java.lang.String |
version
Version, history and license.
|
Constructor and Description |
---|
BinOutPrep(java.lang.String sFileBin,
java.lang.String sFileList,
boolean fileBinBigEndian,
boolean hexOutput,
int sign)
Constructor to create a binary reflection file.
|
Modifier and Type | Method and Description |
---|---|
int |
addClass(java.lang.String sCppClassName,
java.lang.String sCppClassNameShow)
Adds a ClassJc-entry in the bin Data.
|
void |
addField(java.lang.String sAttributeNameShow,
int typeAddress,
java.lang.String sType,
int mModifier,
int nrofArrayElements)
Adds a field to the
binFieldArray via ByteDataAccessBase . |
void |
addFieldHead()
Adds space for the fields to
binOutRefl as child binFieldArray and clears the child. |
int |
addSuperclass(java.lang.String sName)
Adds the bin data for a ObjectArrayJc of SuperclassIfc_idxMtblJc_ByteDataAccess with the given super field.
|
void |
close() |
void |
closeAddClass() |
void |
postProcessBinOut() |
(package private) void |
setAttributRef(int nrofAttributes)
Sets the reference from the class to its fields.
|
void |
setClassBasedOnObjectJc() |
(package private) void |
setClassSuperclass(int pos) |
private void |
setRelocEntry(int posReloc)
Sets a position in binFile as relocate position.
|
(package private) void |
stop() |
void |
writeAsCfile(java.io.File out) |
public static final java.lang.String version
Field_Jc.EModifier#kEmbedded_Modifier_reflectJc
to the addSuperclass(String)
using SuperclassIfc_idxMtblJc_ByteDataAccess.set_Field(String)
BinOutShow
.
SuperclassIfc_idxMtblJc_ByteDataAccess
.
missingClasses
for report.
Header2Reflection
, binary output
private java.io.OutputStream fileBin
private final java.lang.String sFileBin
private final java.lang.String sFileList
private final byte[] binOutData
private final byte[] binOutHeadData
private final byte[] binOutClassArrayData
private final RawDataAccess binOutRefl
private final ExtReflection_Insp_h.ExtReflection_Insp binOutHead
private final ObjectArray_Jc binOutClassArray
private final Class_Jc binClass
private final ObjectArray_Jc binOutSuperArray
private final SuperclassIfc_idxMtblJc_ByteDataAccess binSuperClass
private final ObjectArray_Jc binFieldArray
private final Field_Jc binField
private int nrofRelocEntries
private int nrofClasses
private int nrofFieldsInClass
addClass(String, String)
.
Used for the index in position.private final java.util.Map<java.lang.String,BinOutPrep.TypeBinPosition> posClassesInBuffer
private final java.util.Map<java.lang.String,java.lang.Integer> missingClasses
private final java.util.List<BinOutPrep.TypeNeedInBinOut> typeBinNeed
public BinOutPrep(java.lang.String sFileBin, java.lang.String sFileList, boolean fileBinBigEndian, boolean hexOutput, int sign) throws java.io.FileNotFoundException
sFileBin
- The path to the binfile to createsFileList
- if not null then the content of the binfile will be reported there.fileBinBigEndian
- hexOutput
- sign
- java.io.FileNotFoundException
private void setRelocEntry(int posReloc) throws java.lang.IllegalArgumentException
posReloc
- Position in binFile.java.lang.IllegalArgumentException
public int addSuperclass(java.lang.String sName) throws java.lang.IllegalArgumentException
sName
- Type name of the super classjava.lang.IllegalArgumentException
public int addClass(java.lang.String sCppClassName, java.lang.String sCppClassNameShow) throws java.lang.IllegalArgumentException
binClass
with the appropriate operations.java.lang.IllegalArgumentException
void setClassSuperclass(int pos)
public void setClassBasedOnObjectJc()
public void addFieldHead() throws java.lang.IllegalArgumentException
binOutRefl
as child binFieldArray
and clears the child.
It is separated from addClass(String, String)
because not any class has fields.
Invoke only if fields are found, before the first field will be written.java.lang.IllegalArgumentException
public void addField(java.lang.String sAttributeNameShow, int typeAddress, java.lang.String sType, int mModifier, int nrofArrayElements) throws java.lang.IllegalArgumentException
binFieldArray
via ByteDataAccessBase
.
The binFieldArray
is a ObjectArray_Jc
instance for ByteDataAccess.
It presents the Fields in Reflection in binary presentation.sAttributeNameShow
- typeAddress
- either -1 for yet unknown or the enum ScalarTypes_ClassJc (see emC/Object_emC.h) for standard (primitive) types.
Note: all other than primitive types are gotten via typeBinNeed
.
Note: In the old Header2Reflection
the situation seems to be unchanged but not documented. Test if necessary.sType
- The identifier of the type. Without _t on forward declaration.mModifier
- nrofArrayElements
- java.lang.IllegalArgumentException
void setAttributRef(int nrofAttributes) throws java.lang.IllegalArgumentException
nrofAttributes
- The number of the fields written.java.lang.IllegalArgumentException
public void closeAddClass()
public void postProcessBinOut() throws java.io.IOException, java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalArgumentException
public void writeAsCfile(java.io.File out)
public void close() throws java.io.IOException
java.io.IOException
void stop()