{-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# Language ForeignFunctionInterface #-} {-# Language FlexibleInstances #-} {-# Language MultiParamTypeClasses #-} module Casadi.Core.Classes.ExternalFunction ( ExternalFunction, ExternalFunctionClass(..), externalFunction__0, externalFunction__1, externalFunction__2, externalFunction__3, externalFunction__4, externalFunction__5, externalFunction__6, ) 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__ExternalFunction__CONSTRUCTOR__0" c_casadi__ExternalFunction__CONSTRUCTOR__0 :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr Compiler' -> IO (Ptr ExternalFunction') casadi__ExternalFunction__CONSTRUCTOR__0 :: String -> Compiler -> IO ExternalFunction casadi__ExternalFunction__CONSTRUCTOR__0 x0 x1 = withMarshal x0 $ \x0' -> withMarshal x1 $ \x1' -> do errStrPtrP <- new nullPtr ret <- c_casadi__ExternalFunction__CONSTRUCTOR__0 errStrPtrP x0' x1' errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper externalFunction__0 :: String -> Compiler -> IO ExternalFunction externalFunction__0 = casadi__ExternalFunction__CONSTRUCTOR__0 -- direct wrapper foreign import ccall unsafe "casadi__ExternalFunction__CONSTRUCTOR__1" c_casadi__ExternalFunction__CONSTRUCTOR__1 :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr Compiler' -> Ptr (StdMap StdString (Ptr GenericType')) -> IO (Ptr ExternalFunction') casadi__ExternalFunction__CONSTRUCTOR__1 :: String -> Compiler -> M.Map String GenericType -> IO ExternalFunction casadi__ExternalFunction__CONSTRUCTOR__1 x0 x1 x2 = withMarshal x0 $ \x0' -> withMarshal x1 $ \x1' -> withMarshal x2 $ \x2' -> do errStrPtrP <- new nullPtr ret <- c_casadi__ExternalFunction__CONSTRUCTOR__1 errStrPtrP x0' x1' x2' errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper externalFunction__1 :: String -> Compiler -> M.Map String GenericType -> IO ExternalFunction externalFunction__1 = casadi__ExternalFunction__CONSTRUCTOR__1 -- direct wrapper foreign import ccall unsafe "casadi__ExternalFunction__CONSTRUCTOR__2" c_casadi__ExternalFunction__CONSTRUCTOR__2 :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr StdString -> IO (Ptr ExternalFunction') casadi__ExternalFunction__CONSTRUCTOR__2 :: String -> String -> IO ExternalFunction casadi__ExternalFunction__CONSTRUCTOR__2 x0 x1 = withMarshal x0 $ \x0' -> withMarshal x1 $ \x1' -> do errStrPtrP <- new nullPtr ret <- c_casadi__ExternalFunction__CONSTRUCTOR__2 errStrPtrP x0' x1' errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper externalFunction__2 :: String -> String -> IO ExternalFunction externalFunction__2 = casadi__ExternalFunction__CONSTRUCTOR__2 -- direct wrapper foreign import ccall unsafe "casadi__ExternalFunction__CONSTRUCTOR__3" c_casadi__ExternalFunction__CONSTRUCTOR__3 :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr StdString -> Ptr (StdMap StdString (Ptr GenericType')) -> IO (Ptr ExternalFunction') casadi__ExternalFunction__CONSTRUCTOR__3 :: String -> String -> M.Map String GenericType -> IO ExternalFunction casadi__ExternalFunction__CONSTRUCTOR__3 x0 x1 x2 = withMarshal x0 $ \x0' -> withMarshal x1 $ \x1' -> withMarshal x2 $ \x2' -> do errStrPtrP <- new nullPtr ret <- c_casadi__ExternalFunction__CONSTRUCTOR__3 errStrPtrP x0' x1' x2' errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper externalFunction__3 :: String -> String -> M.Map String GenericType -> IO ExternalFunction externalFunction__3 = casadi__ExternalFunction__CONSTRUCTOR__3 -- direct wrapper foreign import ccall unsafe "casadi__ExternalFunction__CONSTRUCTOR__4" c_casadi__ExternalFunction__CONSTRUCTOR__4 :: Ptr (Ptr StdString) -> Ptr StdString -> IO (Ptr ExternalFunction') casadi__ExternalFunction__CONSTRUCTOR__4 :: String -> IO ExternalFunction casadi__ExternalFunction__CONSTRUCTOR__4 x0 = withMarshal x0 $ \x0' -> do errStrPtrP <- new nullPtr ret <- c_casadi__ExternalFunction__CONSTRUCTOR__4 errStrPtrP x0' errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper externalFunction__4 :: String -> IO ExternalFunction externalFunction__4 = casadi__ExternalFunction__CONSTRUCTOR__4 -- direct wrapper foreign import ccall unsafe "casadi__ExternalFunction__CONSTRUCTOR__5" c_casadi__ExternalFunction__CONSTRUCTOR__5 :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr (StdMap StdString (Ptr GenericType')) -> IO (Ptr ExternalFunction') casadi__ExternalFunction__CONSTRUCTOR__5 :: String -> M.Map String GenericType -> IO ExternalFunction casadi__ExternalFunction__CONSTRUCTOR__5 x0 x1 = withMarshal x0 $ \x0' -> withMarshal x1 $ \x1' -> do errStrPtrP <- new nullPtr ret <- c_casadi__ExternalFunction__CONSTRUCTOR__5 errStrPtrP x0' x1' errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper externalFunction__5 :: String -> M.Map String GenericType -> IO ExternalFunction externalFunction__5 = casadi__ExternalFunction__CONSTRUCTOR__5 -- direct wrapper foreign import ccall unsafe "casadi__ExternalFunction__CONSTRUCTOR__6" c_casadi__ExternalFunction__CONSTRUCTOR__6 :: Ptr (Ptr StdString) -> IO (Ptr ExternalFunction') casadi__ExternalFunction__CONSTRUCTOR__6 :: IO ExternalFunction casadi__ExternalFunction__CONSTRUCTOR__6 = do errStrPtrP <- new nullPtr ret <- c_casadi__ExternalFunction__CONSTRUCTOR__6 errStrPtrP errStrPtr <- peek errStrPtrP free errStrPtrP if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException) -- classy wrapper externalFunction__6 :: IO ExternalFunction externalFunction__6 = casadi__ExternalFunction__CONSTRUCTOR__6