Safe Haskell | None |
---|---|
Language | Haskell2010 |
Concrete C++ types. It is possible to represent invalid C++ types with these functions, but we try to catch these and fail cleanly as much as possible.
- voidT :: Type
- boolT :: Type
- charT :: Type
- ucharT :: Type
- shortT :: Type
- ushortT :: Type
- intT :: Type
- uintT :: Type
- longT :: Type
- ulongT :: Type
- llongT :: Type
- ullongT :: Type
- floatT :: Type
- doubleT :: Type
- int8T :: Type
- int16T :: Type
- int32T :: Type
- int64T :: Type
- word8T :: Type
- word16T :: Type
- word32T :: Type
- word64T :: Type
- ptrdiffT :: Type
- sizeT :: Type
- ssizeT :: Type
- enumT :: CppEnum -> Type
- bitspaceT :: Bitspace -> Type
- ptrT :: Type -> Type
- refT :: Type -> Type
- fnT :: [Type] -> Type -> Type
- callbackT :: Callback -> Type
- objT :: Class -> Type
- objToHeapT :: Class -> Type
- toGcT :: Type -> Type
- constT :: Type -> Type
Primitive types
Complex types
objToHeapT :: Class -> Type Source #
A special case of objT
that is only allowed when passing objects from
C++ to a foreign language. Rather than looking at the object's
ClassConversion
, the object will be copied to the heap, and a pointer to
the heap object will be passed. The object must be copy-constructable.
The foreign language owns the pointer, even for callback arguments.
toGcT :: Type -> Type Source #
This type transfers ownership of the object to the foreign language's garbage collector, and results in a managed pointer in the foreign language. This may only be used in one of the forms below, when passing data from C++ to a foreign language (i.e. in a C++ function return type or in a callback argument). In the first case, the temporary object is copied to the heap, and the result is a managed pointer to the heap object instead of the temporary.