packages feed

casadi-bindings-core-2.4.1.0: Casadi/Core/Classes/MapAccum.hs

{-# OPTIONS_GHC -Wall #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# Language ForeignFunctionInterface #-}
{-# Language FlexibleInstances #-}
{-# Language MultiParamTypeClasses #-}

module Casadi.Core.Classes.MapAccum
       (
         MapAccum,
         MapAccumClass(..),
         mapAccum__0,
         mapAccum__1,
         mapAccum__2,
         mapAccum__3,
       ) where


import Prelude hiding ( Functor )

import Data.Vector ( Vector )
import qualified Data.Map as M
import Foreign.C.Types
import Foreign.Marshal ( new, free )
import Foreign.Storable ( peek )
import Foreign.Ptr ( Ptr, nullPtr )
import Foreign.ForeignPtr ( newForeignPtr )
import System.IO.Unsafe ( unsafePerformIO ) -- for show instances

import Casadi.Internal.FormatException ( formatException )
import Casadi.Internal.MarshalTypes ( StdVec, StdString, StdMap, StdPair ) -- StdPair StdOstream'
import Casadi.Internal.Marshal ( Marshal(..), withMarshal )
import Casadi.Internal.WrapReturn ( WrapReturn(..) )
import Casadi.Core.Data
import Casadi.Core.Enums
-- direct wrapper
foreign import ccall unsafe "casadi__MapAccum__CONSTRUCTOR__0" c_casadi__MapAccum__CONSTRUCTOR__0
  :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr Function' -> CInt -> Ptr (StdVec CInt) -> Ptr (StdVec CInt) -> IO (Ptr MapAccum')
casadi__MapAccum__CONSTRUCTOR__0
  :: String -> Function -> Int -> Vector Bool -> Vector Int -> IO MapAccum
casadi__MapAccum__CONSTRUCTOR__0 x0 x1 x2 x3 x4 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  withMarshal x2 $ \x2' ->
  withMarshal x3 $ \x3' ->
  withMarshal x4 $ \x4' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__MapAccum__CONSTRUCTOR__0 errStrPtrP x0' x1' x2' x3' x4'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
mapAccum__0 :: String -> Function -> Int -> Vector Bool -> Vector Int -> IO MapAccum
mapAccum__0 = casadi__MapAccum__CONSTRUCTOR__0


-- direct wrapper
foreign import ccall unsafe "casadi__MapAccum__CONSTRUCTOR__1" c_casadi__MapAccum__CONSTRUCTOR__1
  :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr Function' -> CInt -> Ptr (StdVec CInt) -> Ptr (StdVec CInt) -> CInt -> IO (Ptr MapAccum')
casadi__MapAccum__CONSTRUCTOR__1
  :: String -> Function -> Int -> Vector Bool -> Vector Int -> Bool -> IO MapAccum
casadi__MapAccum__CONSTRUCTOR__1 x0 x1 x2 x3 x4 x5 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  withMarshal x2 $ \x2' ->
  withMarshal x3 $ \x3' ->
  withMarshal x4 $ \x4' ->
  withMarshal x5 $ \x5' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__MapAccum__CONSTRUCTOR__1 errStrPtrP x0' x1' x2' x3' x4' x5'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
mapAccum__1 :: String -> Function -> Int -> Vector Bool -> Vector Int -> Bool -> IO MapAccum
mapAccum__1 = casadi__MapAccum__CONSTRUCTOR__1


-- direct wrapper
foreign import ccall unsafe "casadi__MapAccum__CONSTRUCTOR__2" c_casadi__MapAccum__CONSTRUCTOR__2
  :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr Function' -> CInt -> Ptr (StdVec CInt) -> Ptr (StdVec CInt) -> CInt -> Ptr (StdMap StdString (Ptr GenericType')) -> IO (Ptr MapAccum')
casadi__MapAccum__CONSTRUCTOR__2
  :: String -> Function -> Int -> Vector Bool -> Vector Int -> Bool -> M.Map String GenericType -> IO MapAccum
casadi__MapAccum__CONSTRUCTOR__2 x0 x1 x2 x3 x4 x5 x6 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  withMarshal x2 $ \x2' ->
  withMarshal x3 $ \x3' ->
  withMarshal x4 $ \x4' ->
  withMarshal x5 $ \x5' ->
  withMarshal x6 $ \x6' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__MapAccum__CONSTRUCTOR__2 errStrPtrP x0' x1' x2' x3' x4' x5' x6'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
mapAccum__2 :: String -> Function -> Int -> Vector Bool -> Vector Int -> Bool -> M.Map String GenericType -> IO MapAccum
mapAccum__2 = casadi__MapAccum__CONSTRUCTOR__2


-- direct wrapper
foreign import ccall unsafe "casadi__MapAccum__CONSTRUCTOR__3" c_casadi__MapAccum__CONSTRUCTOR__3
  :: Ptr (Ptr StdString) -> IO (Ptr MapAccum')
casadi__MapAccum__CONSTRUCTOR__3
  :: IO MapAccum
casadi__MapAccum__CONSTRUCTOR__3  =

  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__MapAccum__CONSTRUCTOR__3 errStrPtrP 
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
mapAccum__3 :: IO MapAccum
mapAccum__3 = casadi__MapAccum__CONSTRUCTOR__3