
org.dianahep.root4j.classes.TArrayC Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of root4j Show documentation
Show all versions of root4j Show documentation
Derived from FreeHEP ROOT IO (http://java.freehep.org/freehep-rootio); modernized and GUI dropped.
package org.dianahep.root4j.classes;
import org.dianahep.root4j.core.GenericRootClass;
import org.dianahep.root4j.core.RootType;
import org.dianahep.root4j.core.StreamerInfo;
import org.apache.bcel.generic.ConstantPoolGen;
import org.apache.bcel.generic.InstructionConstants;
import org.apache.bcel.generic.InstructionFactory;
import org.apache.bcel.generic.InstructionList;
import org.apache.bcel.generic.NEWARRAY;
import org.apache.bcel.generic.Type;
/**
* @author Tony Johnson ([email protected])
* @version $Id: TArrayC.java 8584 2006-08-10 23:06:37Z duns $
*/
public class TArrayC extends GenericRootClass
{
final static Type[] arrayArgType = new Type[] { RootType.CHARARRAY };
public TArrayC(String name, StreamerInfo info)
{
super(name, info);
}
protected String getConvertMethod()
{
return "getArray";
}
protected Type getJavaTypeForMethod()
{
return RootType.CHARARRAY;
}
protected void generateStreamer(ConstantPoolGen cp, InstructionList il, InstructionFactory factory, String className, boolean hasHeader)
{
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionConstants.ALOAD_1);
il.append(InstructionConstants.DUP2);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readInt", Type.INT, Type.NO_ARGS, INVOKEINTERFACE));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createPutField(className, "fN", Type.INT));
il.append(new NEWARRAY(Type.CHAR));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readFixedArray", Type.VOID, arrayArgType, INVOKEINTERFACE));
il.append(factory.createPutField(className, "fArray", RootType.CHARARRAY));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy