hoppy-generator-0.8.0: C++ FFI generator - Code generator
Safe HaskellNone
LanguageHaskell2010

Foreign.Hoppy.Generator.Spec.Computed

Description

Module for computed data for an interface.

Synopsis

Documentation

data ComputedInterfaceData Source #

Holds "computed data" for an interface. This is data that is calculated by Hoppy, beyond what is directly specified in the interface.

Constructors

ComputedInterfaceData 

Fields

data EvaluatedEnumData Source #

Information about the enum that has been completed beyond what the interface definition provides, possibly by building actual C++ code.

Constructors

EvaluatedEnumData 

Fields

type EvaluatedEnumValueMap = Map [String] Integer Source #

Contains the numeric values for each of the entries in a C++ enum.

getEvaluatedEnumData :: HasCallStack => ComputedInterfaceData -> ExtName -> EvaluatedEnumData Source #

Returns the map containing the calculated values for all entries in the enum with the given ExtName. This requires hooks to have been run.

Numeric types

numType :: NumericTypeInfo -> Type Source #

The numeric data type described by the record.

numBytes :: NumericTypeInfo -> Int Source #

The number of bytes in a value of the type.

numMinBound :: NumericTypeInfo -> Integer Source #

The lowest (most negative) value representable by the type.

numMaxBound :: NumericTypeInfo -> Integer Source #

The highest (most positive) value representable by the type.

findNumericTypeInfo :: Type -> Maybe NumericTypeInfo Source #

Searches the list of known numeric types usable for enum values, and returns the record for the given type.

pickNumericType :: Int -> Integer -> Integer -> Maybe NumericTypeInfo Source #

Selects the preferred numeric type for holding numeric values in the given range.