/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.1.1
 *
 * Do not make changes to this file unless you know what you are doing - modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.nanotec.nanolib;

public class OdTypesHelper {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected OdTypesHelper(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(OdTypesHelper obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected static long swigRelease(OdTypesHelper obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        throw new UnsupportedOperationException("C++ destructor does not have public access");
      }
      swigCPtr = 0;
    }
  }

  public static ObjectCode uintToObjectCode(long objectCode) {
    return ObjectCode.swigToEnum(NanolibJNI.OdTypesHelper_uintToObjectCode(objectCode));
  }

  public static boolean isNumericDataType(ObjectEntryDataType dataType) {
    return NanolibJNI.OdTypesHelper_isNumericDataType(dataType.swigValue());
  }

  public static boolean isDefstructIndex(int typeNum) {
    return NanolibJNI.OdTypesHelper_isDefstructIndex(typeNum);
  }

  public static boolean isDeftypeIndex(int typeNum) {
    return NanolibJNI.OdTypesHelper_isDeftypeIndex(typeNum);
  }

  public static boolean isComplexDataType(ObjectEntryDataType dataType) {
    return NanolibJNI.OdTypesHelper_isComplexDataType(dataType.swigValue());
  }

  public static ObjectEntryDataType uintToObjectEntryDataType(int objectDataType) {
    return ObjectEntryDataType.swigToEnum(NanolibJNI.OdTypesHelper_uintToObjectEntryDataType(objectDataType));
  }

  public static String objectEntryDataTypeToString(ObjectEntryDataType odDataType) {
    return NanolibJNI.OdTypesHelper_objectEntryDataTypeToString(odDataType.swigValue());
  }

  public static ObjectEntryDataType stringToObjectEntryDatatype(String dataTypeString) {
    return ObjectEntryDataType.swigToEnum(NanolibJNI.OdTypesHelper_stringToObjectEntryDatatype(dataTypeString));
  }

  public static long objectEntryDataTypeBitLength(ObjectEntryDataType dataType) {
    return NanolibJNI.OdTypesHelper_objectEntryDataTypeBitLength(dataType.swigValue());
  }

}
