Files
mercury/java/runtime/TypeLayout.java
Peter Wang b573e83761 Mark Java RTTI classes as implementing java.io.Serializable to
Branches: main

Mark Java RTTI classes as implementing java.io.Serializable to
enable serialization of existentially typed values.

java/runtime/DuExistInfo.java:
java/runtime/DuExistLocn.java:
java/runtime/DuFunctorDesc.java:
java/runtime/DuPtagLayout.java:
java/runtime/EnumFunctorDesc.java:
java/runtime/ForeignEnumFunctorDesc.java:
java/runtime/MethodPtr.java:
java/runtime/NotagFunctorDesc.java:
java/runtime/PseudoTypeInfo.java:
java/runtime/ReservedAddrFunctorDesc.java:
java/runtime/Sectag_Locn.java:
java/runtime/TypeClassConstraint.java:
java/runtime/TypeClassDeclStruct.java:
java/runtime/TypeClassId.java:
java/runtime/TypeClassMethod.java:
java/runtime/TypeCtorInfo_Struct.java:
java/runtime/TypeCtorRep.java:
java/runtime/TypeFunctors.java:
java/runtime/TypeInfo_Struct.java:
java/runtime/TypeLayout.java:
        As above.

        TypeCtorInfo_Struct.unify() cannot rely on the uniqueness of
        TypeCtorInfo_Struct instances, as deserialisation will create new
        copies.
2009-09-07 03:10:02 +00:00

53 lines
1.4 KiB
Java

//
// Copyright (C) 2001-2003 The University of Melbourne.
// This file may only be copied under the terms of the GNU Library General
// Public License - see the file COPYING.LIB in the Mercury distribution.
//
package jmercury.runtime;
public class TypeLayout implements java.io.Serializable {
// This should hold a value of one of the types
// accessible by the access functions that follow.
public java.lang.Object layout_init;
//
// In runtime/mercury_type_info.h:
// typedef MR_DuPtagLayout *MR_DuTypeLayout;
// so here we just use DuPtagLayout[]
//
public DuPtagLayout[] layout_du() {
return (DuPtagLayout[]) layout_init;
}
//
// In runtime/mercury_type_info.h:
// typedef MR_EnumFunctorDesc **EnumTypeLayout;
// so here we just use EnumFunctorDesc[][]
//
public EnumFunctorDesc[] layout_enum() {
return (EnumFunctorDesc[]) layout_init;
}
//
// In runtime/mercury_type_info.h:
// typedef MR_NotagFunctorDesc *MR_NotagTypeLayout;
// so here we just us NotagFunctorDesc[]
//
public NotagFunctorDesc[] layout_notag() {
return (NotagFunctorDesc[]) layout_init;
}
//
// In runtime/mercury_type_info.h:
// typedef MR_PseudoTypeInfo MR_EquivType;
// so here we just use MR_PseudoTypeInfo
//
public PseudoTypeInfo layout_equiv() {
return (PseudoTypeInfo) layout_init;
}
public TypeLayout(java.lang.Object init) {
layout_init = init;
}
}