Class FFITypeFactoryhelper


  • public class FFITypeFactoryhelper
    extends Object
    • Constructor Detail

      • FFITypeFactoryhelper

        public FFITypeFactoryhelper()
    • Method Detail

      • javaType2CppType

        public static String javaType2CppType​(Class<?> clz)
      • newStringTypedArray

        public static StringTypedArray newStringTypedArray()
        The created typed array should be set address with baseTypedArray. One cannot add more data to this object
        Returns:
      • getVertexLongFactory

        public static Vertex.Factory getVertexLongFactory()
      • getVertexIntegerFactory

        public static Vertex.Factory getVertexIntegerFactory()
      • getFFIVectorFactory

        public static com.alibaba.fastffi.FFIVector.Factory getFFIVectorFactory​(String foreignTypeName)
        get the ffiVectorFactor which can produce std::vector, here foreignType can be nested
        Parameters:
        foreignTypeName - foreign name (cpp name, full-qualified)
        Returns:
        Factory instance.
      • newVertexLong

        public static Vertex<Long> newVertexLong()
      • newVertex

        public static <T> Vertex<T> newVertex​(Class<? extends T> vidClass)
      • newDoublePrimitiveMsg

        public static PrimitiveMessage<Double> newDoublePrimitiveMsg()
        This is the same as DoubleMsg.factory.create();
        Returns:
        created instance
      • newPrimitiveMsg

        public static <T> PrimitiveMessage<T> newPrimitiveMsg​(Class<T> clz)
        Create the template msg instance.
        Type Parameters:
        T - element type
        Parameters:
        clz - element class instance.
        Returns:
        created instance.
      • newVertexRangeLong

        public static VertexRange<Long> newVertexRangeLong()
      • newGSVertexArray

        public static <T> GSVertexArray<T> newGSVertexArray​(Class<T> clz)
      • newComplicateFFIVector

        public static <T> com.alibaba.fastffi.FFIVector newComplicateFFIVector​(Class<T> clz,
                                                                               Class<?>... types)
        In case user want to create a nested std::vector instance. the foreign name translation relies on ffi method.
        Type Parameters:
        T - outer class T.
        Parameters:
        clz - outer class's Class object.
        types - inner classes class objects.
        Returns:
        created FFIVector
      • createEmptyType

        public static EmptyType createEmptyType()
      • makeParameterize

        public static String makeParameterize​(String base,
                                              String... fields)
      • getTypeParams

        public static String[] getTypeParams​(Class<?> clz,
                                             int expectedNum)
      • newLongMsg

        public static LongMsg newLongMsg()
      • newLongMsg

        public static LongMsg newLongMsg​(long value)
      • newDoubleMsg

        public static DoubleMsg newDoubleMsg()
      • newDoubleMsg

        public static DoubleMsg newDoubleMsg​(double value)
      • getForeignName

        public static String getForeignName​(com.alibaba.fastffi.FFIPointer ffiPointer)
        For Any ffi-generated class, we can get the typealias via annotation
        Parameters:
        ffiPointer - Java class generated by ffi.
        Returns:
        foreignName