From ca717fb17653151326dd4f7111079ef70807faf8 Mon Sep 17 00:00:00 2001 From: afisher1 Date: Mon, 23 Dec 2024 13:27:08 -0800 Subject: [PATCH 1/2] cheader2json implementation and 3.6 bindings generation. --- .vscode/launch.json | 20 + helicsMex.cpp | 3039 ++++++++++------- .../+helics/HELICS_INVALID_DOUBLE.m | 3 + matlabBindings/+helics/HelicsCoreTypes.m | 2 + matlabBindings/+helics/helicsAppDestroy.m | 6 + matlabBindings/+helics/helicsAppEnabled.m | 5 + matlabBindings/+helics/helicsAppFinalize.m | 7 + matlabBindings/+helics/helicsAppFree.m | 6 + matlabBindings/+helics/helicsAppGetFederate.m | 10 + matlabBindings/+helics/helicsAppInitialize.m | 8 + matlabBindings/+helics/helicsAppIsActive.m | 7 + matlabBindings/+helics/helicsAppLoadFile.m | 13 + matlabBindings/+helics/helicsAppRun.m | 8 + matlabBindings/+helics/helicsAppRunTo.m | 9 + matlabBindings/+helics/helicsCreateApp.m | 15 + matlabBindings/+helics/helicsCreateBroker.m | 1 + ...elicsCreateCombinationFederateFromConfig.m | 2 +- matlabBindings/+helics/helicsCreateCore.m | 3 +- .../helicsDataBufferFillFromRawString.m | 3 +- .../+helics/helicsEndpointSendString.m | 9 + .../+helics/helicsEndpointSendStringAt.m | 13 + .../+helics/helicsEndpointSendStringTo.m | 12 + .../+helics/helicsEndpointSendStringToAt.m | 14 + .../+helics/helicsFilterGetPropertyDouble.m | 9 + .../+helics/helicsFilterGetPropertyString.m | 10 + poetry.lock | 118 +- pyproject.toml | 3 +- src/bindingGenerators/__init__.py | 2 - src/bindingGenerators/clangParser.py | 189 - .../matlabBindingGenerator.py | 1218 ++++--- src/main.py | 4 +- 31 files changed, 2912 insertions(+), 1856 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 matlabBindings/+helics/HELICS_INVALID_DOUBLE.m create mode 100644 matlabBindings/+helics/helicsAppDestroy.m create mode 100644 matlabBindings/+helics/helicsAppEnabled.m create mode 100644 matlabBindings/+helics/helicsAppFinalize.m create mode 100644 matlabBindings/+helics/helicsAppFree.m create mode 100644 matlabBindings/+helics/helicsAppGetFederate.m create mode 100644 matlabBindings/+helics/helicsAppInitialize.m create mode 100644 matlabBindings/+helics/helicsAppIsActive.m create mode 100644 matlabBindings/+helics/helicsAppLoadFile.m create mode 100644 matlabBindings/+helics/helicsAppRun.m create mode 100644 matlabBindings/+helics/helicsAppRunTo.m create mode 100644 matlabBindings/+helics/helicsCreateApp.m create mode 100644 matlabBindings/+helics/helicsEndpointSendString.m create mode 100644 matlabBindings/+helics/helicsEndpointSendStringAt.m create mode 100644 matlabBindings/+helics/helicsEndpointSendStringTo.m create mode 100644 matlabBindings/+helics/helicsEndpointSendStringToAt.m create mode 100644 matlabBindings/+helics/helicsFilterGetPropertyDouble.m create mode 100644 matlabBindings/+helics/helicsFilterGetPropertyString.m delete mode 100644 src/bindingGenerators/clangParser.py diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..f71ec6a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python Debugger: Current File with Arguments", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "args": [ + "/home/vale/git/matHELICS", + "/home/vale/git/HELICS/install/include/helics/helics.h" + ], + "justMyCode": false + } + ] +} \ No newline at end of file diff --git a/helicsMex.cpp b/helicsMex.cpp index 26b276c..0bdfc48 100644 --- a/helicsMex.cpp +++ b/helicsMex.cpp @@ -51,436 +51,464 @@ static void throwHelicsMatlabError(HelicsError *err) { } static const std::unordered_map wrapperFunctionMap{ - {"helicsCreateDataBuffer",65}, - {"helicsDataBufferIsValid",66}, - {"helicsWrapDataInBuffer",67}, - {"helicsDataBufferFree",68}, - {"helicsDataBufferSize",69}, - {"helicsDataBufferCapacity",70}, - {"helicsDataBufferData",71}, - {"helicsDataBufferReserve",72}, - {"helicsDataBufferClone",73}, - {"helicsDataBufferFillFromInteger",74}, - {"helicsDataBufferFillFromDouble",75}, - {"helicsDataBufferFillFromString",76}, - {"helicsDataBufferFillFromRawString",77}, - {"helicsDataBufferFillFromBoolean",78}, - {"helicsDataBufferFillFromChar",79}, - {"helicsDataBufferFillFromTime",80}, - {"helicsDataBufferFillFromComplex",81}, - {"helicsDataBufferFillFromVector",83}, - {"helicsDataBufferFillFromNamedPoint",84}, - {"helicsDataBufferFillFromComplexVector",85}, - {"helicsDataBufferType",86}, - {"helicsDataBufferToInteger",87}, - {"helicsDataBufferToDouble",88}, - {"helicsDataBufferToBoolean",89}, - {"helicsDataBufferToChar",90}, - {"helicsDataBufferStringSize",91}, - {"helicsDataBufferToString",92}, - {"helicsDataBufferToRawString",93}, - {"helicsDataBufferToTime",94}, - {"helicsDataBufferToComplexObject",95}, - {"helicsDataBufferToComplex",96}, - {"helicsDataBufferVectorSize",97}, - {"helicsDataBufferToVector",98}, - {"helicsDataBufferToComplexVector",99}, - {"helicsDataBufferToNamedPoint",100}, - {"helicsDataBufferConvertToType",101}, - {"helicsGetVersion",102}, - {"helicsGetBuildFlags",103}, - {"helicsGetCompilerVersion",104}, - {"helicsGetSystemInfo",105}, - {"helicsLoadSignalHandler",108}, - {"helicsLoadThreadedSignalHandler",109}, - {"helicsClearSignalHandler",110}, - {"helicsLoadSignalHandlerCallback",111}, - {"helicsLoadSignalHandlerCallbackNoExit",112}, - {"helicsAbort",113}, - {"helicsIsCoreTypeAvailable",114}, - {"helicsCreateCore",115}, - {"helicsCreateCoreFromArgs",116}, - {"helicsCoreClone",117}, - {"helicsCoreIsValid",118}, - {"helicsCreateBroker",119}, - {"helicsCreateBrokerFromArgs",120}, - {"helicsBrokerClone",121}, - {"helicsBrokerIsValid",122}, - {"helicsBrokerIsConnected",123}, - {"helicsBrokerDataLink",124}, - {"helicsBrokerAddSourceFilterToEndpoint",125}, - {"helicsBrokerAddDestinationFilterToEndpoint",126}, - {"helicsBrokerMakeConnections",127}, - {"helicsCoreWaitForDisconnect",128}, - {"helicsBrokerWaitForDisconnect",129}, - {"helicsCoreIsConnected",130}, - {"helicsCoreDataLink",131}, - {"helicsCoreAddSourceFilterToEndpoint",132}, - {"helicsCoreAddDestinationFilterToEndpoint",133}, - {"helicsCoreMakeConnections",134}, - {"helicsBrokerGetIdentifier",135}, - {"helicsCoreGetIdentifier",136}, - {"helicsBrokerGetAddress",137}, - {"helicsCoreGetAddress",138}, - {"helicsCoreSetReadyToInit",139}, - {"helicsCoreConnect",140}, - {"helicsCoreDisconnect",141}, - {"helicsGetFederateByName",142}, - {"helicsBrokerDisconnect",143}, - {"helicsFederateDestroy",144}, - {"helicsBrokerDestroy",145}, - {"helicsCoreDestroy",146}, - {"helicsCoreFree",147}, - {"helicsBrokerFree",148}, - {"helicsCreateValueFederate",149}, - {"helicsCreateValueFederateFromConfig",150}, - {"helicsCreateMessageFederate",151}, - {"helicsCreateMessageFederateFromConfig",152}, - {"helicsCreateCombinationFederate",153}, - {"helicsCreateCombinationFederateFromConfig",154}, - {"helicsCreateCallbackFederate",155}, - {"helicsCreateCallbackFederateFromConfig",156}, - {"helicsFederateClone",157}, - {"helicsFederateProtect",158}, - {"helicsFederateUnProtect",159}, - {"helicsFederateIsProtected",160}, - {"helicsCreateFederateInfo",161}, - {"helicsFederateInfoClone",162}, - {"helicsFederateInfoLoadFromArgs",163}, - {"helicsFederateInfoLoadFromString",164}, - {"helicsFederateInfoFree",165}, - {"helicsFederateIsValid",166}, - {"helicsFederateInfoSetCoreName",167}, - {"helicsFederateInfoSetCoreInitString",168}, - {"helicsFederateInfoSetBrokerInitString",169}, - {"helicsFederateInfoSetCoreType",170}, - {"helicsFederateInfoSetCoreTypeFromString",171}, - {"helicsFederateInfoSetBroker",172}, - {"helicsFederateInfoSetBrokerKey",173}, - {"helicsFederateInfoSetBrokerPort",174}, - {"helicsFederateInfoSetLocalPort",175}, - {"helicsGetPropertyIndex",176}, - {"helicsGetFlagIndex",177}, - {"helicsGetOptionIndex",178}, - {"helicsGetOptionValue",179}, - {"helicsGetDataType",180}, - {"helicsFederateInfoSetFlagOption",181}, - {"helicsFederateInfoSetSeparator",182}, - {"helicsFederateInfoSetTimeProperty",183}, - {"helicsFederateInfoSetIntegerProperty",184}, - {"helicsFederateRegisterInterfaces",185}, - {"helicsFederateGlobalError",186}, - {"helicsFederateLocalError",187}, - {"helicsFederateFinalize",188}, - {"helicsFederateFinalizeAsync",189}, - {"helicsFederateFinalizeComplete",190}, - {"helicsFederateDisconnect",191}, - {"helicsFederateDisconnectAsync",192}, - {"helicsFederateDisconnectComplete",193}, - {"helicsFederateFree",194}, - {"helicsCloseLibrary",195}, - {"helicsFederateEnterInitializingMode",196}, - {"helicsFederateEnterInitializingModeAsync",197}, - {"helicsFederateEnterInitializingModeComplete",198}, - {"helicsFederateEnterInitializingModeIterative",199}, - {"helicsFederateEnterInitializingModeIterativeAsync",200}, - {"helicsFederateEnterInitializingModeIterativeComplete",201}, - {"helicsFederateIsAsyncOperationCompleted",202}, - {"helicsFederateEnterExecutingMode",203}, - {"helicsFederateEnterExecutingModeAsync",204}, - {"helicsFederateEnterExecutingModeComplete",205}, - {"helicsFederateEnterExecutingModeIterative",206}, - {"helicsFederateEnterExecutingModeIterativeAsync",207}, - {"helicsFederateEnterExecutingModeIterativeComplete",208}, - {"helicsFederateGetState",209}, - {"helicsFederateGetCore",210}, - {"helicsFederateRequestTime",211}, - {"helicsFederateRequestTimeAdvance",212}, - {"helicsFederateRequestNextStep",213}, - {"helicsFederateRequestTimeIterative",214}, - {"helicsFederateRequestTimeAsync",215}, - {"helicsFederateRequestTimeComplete",216}, - {"helicsFederateRequestTimeIterativeAsync",217}, - {"helicsFederateRequestTimeIterativeComplete",218}, - {"helicsFederateProcessCommunications",219}, - {"helicsFederateGetName",220}, - {"helicsFederateSetTimeProperty",221}, - {"helicsFederateSetFlagOption",222}, - {"helicsFederateSetSeparator",223}, - {"helicsFederateSetIntegerProperty",224}, - {"helicsFederateGetTimeProperty",225}, - {"helicsFederateGetFlagOption",226}, - {"helicsFederateGetIntegerProperty",227}, - {"helicsFederateGetCurrentTime",228}, - {"helicsFederateAddAlias",229}, - {"helicsFederateSetGlobal",230}, - {"helicsFederateSetTag",231}, - {"helicsFederateGetTag",232}, - {"helicsFederateAddDependency",233}, - {"helicsFederateSetLogFile",234}, - {"helicsFederateLogErrorMessage",235}, - {"helicsFederateLogWarningMessage",236}, - {"helicsFederateLogInfoMessage",237}, - {"helicsFederateLogDebugMessage",238}, - {"helicsFederateLogLevelMessage",239}, - {"helicsFederateSendCommand",240}, - {"helicsFederateGetCommand",241}, - {"helicsFederateGetCommandSource",242}, - {"helicsFederateWaitCommand",243}, - {"helicsCoreSetGlobal",244}, - {"helicsBrokerSetGlobal",245}, - {"helicsCoreAddAlias",246}, - {"helicsBrokerAddAlias",247}, - {"helicsCoreSendCommand",248}, - {"helicsCoreSendOrderedCommand",249}, - {"helicsBrokerSendCommand",250}, - {"helicsBrokerSendOrderedCommand",251}, - {"helicsCoreSetLogFile",252}, - {"helicsBrokerSetLogFile",253}, - {"helicsBrokerSetTimeBarrier",254}, - {"helicsBrokerClearTimeBarrier",255}, - {"helicsBrokerGlobalError",256}, - {"helicsCoreGlobalError",257}, - {"helicsCreateQuery",258}, - {"helicsQueryExecute",259}, - {"helicsQueryCoreExecute",260}, - {"helicsQueryBrokerExecute",261}, - {"helicsQueryExecuteAsync",262}, - {"helicsQueryExecuteComplete",263}, - {"helicsQueryIsCompleted",264}, - {"helicsQuerySetTarget",265}, - {"helicsQuerySetQueryString",266}, - {"helicsQuerySetOrdering",267}, - {"helicsQueryFree",268}, - {"helicsCleanupLibrary",269}, - {"helicsFederateRegisterSubscription",270}, - {"helicsFederateRegisterPublication",271}, - {"helicsFederateRegisterTypePublication",272}, - {"helicsFederateRegisterGlobalPublication",273}, - {"helicsFederateRegisterGlobalTypePublication",274}, - {"helicsFederateRegisterInput",275}, - {"helicsFederateRegisterTypeInput",276}, - {"helicsFederateRegisterGlobalInput",277}, - {"helicsFederateRegisterGlobalTypeInput",278}, - {"helicsFederateGetPublication",279}, - {"helicsFederateGetPublicationByIndex",280}, - {"helicsFederateGetInput",281}, - {"helicsFederateGetInputByIndex",282}, - {"helicsFederateGetSubscription",283}, - {"helicsFederateGetInputByTarget",284}, - {"helicsFederateClearUpdates",285}, - {"helicsFederateRegisterFromPublicationJSON",286}, - {"helicsFederatePublishJSON",287}, - {"helicsPublicationIsValid",288}, - {"helicsPublicationPublishBytes",289}, - {"helicsPublicationPublishString",290}, - {"helicsPublicationPublishInteger",291}, - {"helicsPublicationPublishBoolean",292}, - {"helicsPublicationPublishDouble",293}, - {"helicsPublicationPublishTime",294}, - {"helicsPublicationPublishChar",295}, - {"helicsPublicationPublishComplex",296}, - {"helicsPublicationPublishVector",297}, - {"helicsPublicationPublishComplexVector",298}, - {"helicsPublicationPublishNamedPoint",299}, - {"helicsPublicationPublishDataBuffer",300}, - {"helicsPublicationAddTarget",301}, - {"helicsInputIsValid",302}, - {"helicsInputAddTarget",303}, - {"helicsInputGetByteCount",304}, - {"helicsInputGetBytes",305}, - {"helicsInputGetDataBuffer",306}, - {"helicsInputGetStringSize",307}, - {"helicsInputGetString",308}, - {"helicsInputGetInteger",309}, - {"helicsInputGetBoolean",310}, - {"helicsInputGetDouble",311}, - {"helicsInputGetTime",312}, - {"helicsInputGetChar",313}, - {"helicsInputGetComplexObject",314}, - {"helicsInputGetComplex",315}, - {"helicsInputGetVectorSize",316}, - {"helicsInputGetVector",317}, - {"helicsInputGetComplexVector",318}, - {"helicsInputGetNamedPoint",319}, - {"helicsInputSetDefaultBytes",320}, - {"helicsInputSetDefaultString",321}, - {"helicsInputSetDefaultInteger",322}, - {"helicsInputSetDefaultBoolean",323}, - {"helicsInputSetDefaultTime",324}, - {"helicsInputSetDefaultChar",325}, - {"helicsInputSetDefaultDouble",326}, - {"helicsInputSetDefaultComplex",327}, - {"helicsInputSetDefaultVector",328}, - {"helicsInputSetDefaultComplexVector",329}, - {"helicsInputSetDefaultNamedPoint",330}, - {"helicsInputGetType",331}, - {"helicsInputGetPublicationType",332}, - {"helicsInputGetPublicationDataType",333}, - {"helicsPublicationGetType",334}, - {"helicsInputGetName",335}, - {"helicsSubscriptionGetTarget",336}, - {"helicsInputGetTarget",337}, - {"helicsPublicationGetName",338}, - {"helicsInputGetUnits",339}, - {"helicsInputGetInjectionUnits",340}, - {"helicsInputGetExtractionUnits",341}, - {"helicsPublicationGetUnits",342}, - {"helicsInputGetInfo",343}, - {"helicsInputSetInfo",344}, - {"helicsInputGetTag",345}, - {"helicsInputSetTag",346}, - {"helicsPublicationGetInfo",347}, - {"helicsPublicationSetInfo",348}, - {"helicsPublicationGetTag",349}, - {"helicsPublicationSetTag",350}, - {"helicsInputGetOption",351}, - {"helicsInputSetOption",352}, - {"helicsPublicationGetOption",353}, - {"helicsPublicationSetOption",354}, - {"helicsPublicationSetMinimumChange",355}, - {"helicsInputSetMinimumChange",356}, - {"helicsInputIsUpdated",357}, - {"helicsInputLastUpdateTime",358}, - {"helicsInputClearUpdate",359}, - {"helicsFederateGetPublicationCount",360}, - {"helicsFederateGetInputCount",361}, - {"helicsFederateRegisterEndpoint",362}, - {"helicsFederateRegisterGlobalEndpoint",363}, - {"helicsFederateRegisterTargetedEndpoint",364}, - {"helicsFederateRegisterGlobalTargetedEndpoint",365}, - {"helicsFederateGetEndpoint",366}, - {"helicsFederateGetEndpointByIndex",367}, - {"helicsEndpointIsValid",368}, - {"helicsEndpointSetDefaultDestination",369}, - {"helicsEndpointGetDefaultDestination",370}, - {"helicsEndpointSendBytes",371}, - {"helicsEndpointSendBytesTo",372}, - {"helicsEndpointSendBytesToAt",373}, - {"helicsEndpointSendBytesAt",374}, - {"helicsEndpointSendMessage",375}, - {"helicsEndpointSendMessageZeroCopy",376}, - {"helicsEndpointSubscribe",377}, - {"helicsFederateHasMessage",378}, - {"helicsEndpointHasMessage",379}, - {"helicsFederatePendingMessageCount",380}, - {"helicsEndpointPendingMessageCount",381}, - {"helicsEndpointGetMessage",382}, - {"helicsEndpointCreateMessage",383}, - {"helicsEndpointClearMessages",384}, - {"helicsFederateGetMessage",385}, - {"helicsFederateCreateMessage",386}, - {"helicsFederateClearMessages",387}, - {"helicsEndpointGetType",388}, - {"helicsEndpointGetName",389}, - {"helicsFederateGetEndpointCount",390}, - {"helicsEndpointGetInfo",391}, - {"helicsEndpointSetInfo",392}, - {"helicsEndpointGetTag",393}, - {"helicsEndpointSetTag",394}, - {"helicsEndpointSetOption",395}, - {"helicsEndpointGetOption",396}, - {"helicsEndpointAddSourceTarget",397}, - {"helicsEndpointAddDestinationTarget",398}, - {"helicsEndpointRemoveTarget",399}, - {"helicsEndpointAddSourceFilter",400}, - {"helicsEndpointAddDestinationFilter",401}, - {"helicsMessageGetSource",402}, - {"helicsMessageGetDestination",403}, - {"helicsMessageGetOriginalSource",404}, - {"helicsMessageGetOriginalDestination",405}, - {"helicsMessageGetTime",406}, - {"helicsMessageGetString",407}, - {"helicsMessageGetMessageID",408}, - {"helicsMessageGetFlagOption",409}, - {"helicsMessageGetByteCount",410}, - {"helicsMessageGetBytes",411}, - {"helicsMessageGetBytesPointer",412}, - {"helicsMessageDataBuffer",413}, - {"helicsMessageIsValid",414}, - {"helicsMessageSetSource",415}, - {"helicsMessageSetDestination",416}, - {"helicsMessageSetOriginalSource",417}, - {"helicsMessageSetOriginalDestination",418}, - {"helicsMessageSetTime",419}, - {"helicsMessageResize",420}, - {"helicsMessageReserve",421}, - {"helicsMessageSetMessageID",422}, - {"helicsMessageClearFlags",423}, - {"helicsMessageSetFlagOption",424}, - {"helicsMessageSetString",425}, - {"helicsMessageSetData",426}, - {"helicsMessageSetDataBuffer",427}, - {"helicsMessageAppendData",428}, - {"helicsMessageCopy",429}, - {"helicsMessageClone",430}, - {"helicsMessageFree",431}, - {"helicsMessageClear",432}, - {"helicsFederateRegisterFilter",433}, - {"helicsFederateRegisterGlobalFilter",434}, - {"helicsFederateRegisterCloningFilter",435}, - {"helicsFederateRegisterGlobalCloningFilter",436}, - {"helicsCoreRegisterFilter",437}, - {"helicsCoreRegisterCloningFilter",438}, - {"helicsFederateGetFilterCount",439}, - {"helicsFederateGetFilter",440}, - {"helicsFederateGetFilterByIndex",441}, - {"helicsFilterIsValid",442}, - {"helicsFilterGetName",443}, - {"helicsFilterSet",444}, - {"helicsFilterSetString",445}, - {"helicsFilterAddDestinationTarget",446}, - {"helicsFilterAddSourceTarget",447}, - {"helicsFilterAddDeliveryEndpoint",448}, - {"helicsFilterRemoveTarget",449}, - {"helicsFilterRemoveDeliveryEndpoint",450}, - {"helicsFilterGetInfo",451}, - {"helicsFilterSetInfo",452}, - {"helicsFilterGetTag",453}, - {"helicsFilterSetTag",454}, - {"helicsFilterSetOption",455}, - {"helicsFilterGetOption",456}, - {"helicsFederateRegisterTranslator",457}, - {"helicsFederateRegisterGlobalTranslator",458}, - {"helicsCoreRegisterTranslator",459}, - {"helicsFederateGetTranslatorCount",460}, - {"helicsFederateGetTranslator",461}, - {"helicsFederateGetTranslatorByIndex",462}, - {"helicsTranslatorIsValid",463}, - {"helicsTranslatorGetName",464}, - {"helicsTranslatorSet",465}, - {"helicsTranslatorSetString",466}, - {"helicsTranslatorAddInputTarget",467}, - {"helicsTranslatorAddPublicationTarget",468}, - {"helicsTranslatorAddSourceEndpoint",469}, - {"helicsTranslatorAddDestinationEndpoint",470}, - {"helicsTranslatorRemoveTarget",471}, - {"helicsTranslatorGetInfo",472}, - {"helicsTranslatorSetInfo",473}, - {"helicsTranslatorGetTag",474}, - {"helicsTranslatorSetTag",475}, - {"helicsTranslatorSetOption",476}, - {"helicsTranslatorGetOption",477}, - {"helicsBrokerSetLoggingCallback",478}, - {"helicsCoreSetLoggingCallback",479}, - {"helicsFederateSetLoggingCallback",480}, - {"helicsFilterSetCustomCallback",481}, - {"helicsTranslatorSetCustomCallback",482}, - {"helicsFederateSetQueryCallback",483}, - {"helicsFederateSetTimeRequestEntryCallback",484}, - {"helicsFederateSetTimeUpdateCallback",485}, - {"helicsFederateSetStateChangeCallback",486}, - {"helicsFederateSetTimeRequestReturnCallback",487}, - {"helicsFederateInitializingEntryCallback",488}, - {"helicsFederateExecutingEntryCallback",489}, - {"helicsFederateCosimulationTerminationCallback",490}, - {"helicsFederateErrorHandlerCallback",491}, - {"helicsCallbackFederateNextTimeCallback",492}, - {"helicsCallbackFederateNextTimeIterativeCallback",493}, - {"helicsCallbackFederateInitializeCallback",494}, - {"helicsQueryBufferFill",495} + {"HELICS_INVALID_DOUBLE",4}, + {"helicsCreateDataBuffer",67}, + {"helicsDataBufferIsValid",68}, + {"helicsWrapDataInBuffer",69}, + {"helicsDataBufferFree",70}, + {"helicsDataBufferSize",71}, + {"helicsDataBufferCapacity",72}, + {"helicsDataBufferData",73}, + {"helicsDataBufferReserve",74}, + {"helicsDataBufferClone",75}, + {"helicsDataBufferFillFromInteger",76}, + {"helicsDataBufferFillFromDouble",77}, + {"helicsDataBufferFillFromString",78}, + {"helicsDataBufferFillFromRawString",79}, + {"helicsDataBufferFillFromBoolean",80}, + {"helicsDataBufferFillFromChar",81}, + {"helicsDataBufferFillFromTime",82}, + {"helicsDataBufferFillFromComplex",83}, + {"helicsDataBufferFillFromVector",85}, + {"helicsDataBufferFillFromNamedPoint",86}, + {"helicsDataBufferFillFromComplexVector",87}, + {"helicsDataBufferType",88}, + {"helicsDataBufferToInteger",89}, + {"helicsDataBufferToDouble",90}, + {"helicsDataBufferToBoolean",91}, + {"helicsDataBufferToChar",92}, + {"helicsDataBufferStringSize",93}, + {"helicsDataBufferToString",94}, + {"helicsDataBufferToRawString",95}, + {"helicsDataBufferToTime",96}, + {"helicsDataBufferToComplexObject",97}, + {"helicsDataBufferToComplex",98}, + {"helicsDataBufferVectorSize",99}, + {"helicsDataBufferToVector",100}, + {"helicsDataBufferToComplexVector",101}, + {"helicsDataBufferToNamedPoint",102}, + {"helicsDataBufferConvertToType",103}, + {"helicsGetVersion",104}, + {"helicsGetBuildFlags",105}, + {"helicsGetCompilerVersion",106}, + {"helicsGetSystemInfo",107}, + {"helicsLoadSignalHandler",110}, + {"helicsLoadThreadedSignalHandler",111}, + {"helicsClearSignalHandler",112}, + {"helicsLoadSignalHandlerCallback",113}, + {"helicsLoadSignalHandlerCallbackNoExit",114}, + {"helicsAbort",115}, + {"helicsIsCoreTypeAvailable",116}, + {"helicsCreateCore",117}, + {"helicsCreateCoreFromArgs",118}, + {"helicsCoreClone",119}, + {"helicsCoreIsValid",120}, + {"helicsCreateBroker",121}, + {"helicsCreateBrokerFromArgs",122}, + {"helicsBrokerClone",123}, + {"helicsBrokerIsValid",124}, + {"helicsBrokerIsConnected",125}, + {"helicsBrokerDataLink",126}, + {"helicsBrokerAddSourceFilterToEndpoint",127}, + {"helicsBrokerAddDestinationFilterToEndpoint",128}, + {"helicsBrokerMakeConnections",129}, + {"helicsCoreWaitForDisconnect",130}, + {"helicsBrokerWaitForDisconnect",131}, + {"helicsCoreIsConnected",132}, + {"helicsCoreDataLink",133}, + {"helicsCoreAddSourceFilterToEndpoint",134}, + {"helicsCoreAddDestinationFilterToEndpoint",135}, + {"helicsCoreMakeConnections",136}, + {"helicsBrokerGetIdentifier",137}, + {"helicsCoreGetIdentifier",138}, + {"helicsBrokerGetAddress",139}, + {"helicsCoreGetAddress",140}, + {"helicsCoreSetReadyToInit",141}, + {"helicsCoreConnect",142}, + {"helicsCoreDisconnect",143}, + {"helicsGetFederateByName",144}, + {"helicsBrokerDisconnect",145}, + {"helicsFederateDestroy",146}, + {"helicsBrokerDestroy",147}, + {"helicsCoreDestroy",148}, + {"helicsCoreFree",149}, + {"helicsBrokerFree",150}, + {"helicsCreateValueFederate",151}, + {"helicsCreateValueFederateFromConfig",152}, + {"helicsCreateMessageFederate",153}, + {"helicsCreateMessageFederateFromConfig",154}, + {"helicsCreateCombinationFederate",155}, + {"helicsCreateCombinationFederateFromConfig",156}, + {"helicsCreateCallbackFederate",157}, + {"helicsCreateCallbackFederateFromConfig",158}, + {"helicsFederateClone",159}, + {"helicsFederateProtect",160}, + {"helicsFederateUnProtect",161}, + {"helicsFederateIsProtected",162}, + {"helicsCreateFederateInfo",163}, + {"helicsFederateInfoClone",164}, + {"helicsFederateInfoLoadFromArgs",165}, + {"helicsFederateInfoLoadFromString",166}, + {"helicsFederateInfoFree",167}, + {"helicsFederateIsValid",168}, + {"helicsFederateInfoSetCoreName",169}, + {"helicsFederateInfoSetCoreInitString",170}, + {"helicsFederateInfoSetBrokerInitString",171}, + {"helicsFederateInfoSetCoreType",172}, + {"helicsFederateInfoSetCoreTypeFromString",173}, + {"helicsFederateInfoSetBroker",174}, + {"helicsFederateInfoSetBrokerKey",175}, + {"helicsFederateInfoSetBrokerPort",176}, + {"helicsFederateInfoSetLocalPort",177}, + {"helicsGetPropertyIndex",178}, + {"helicsGetFlagIndex",179}, + {"helicsGetOptionIndex",180}, + {"helicsGetOptionValue",181}, + {"helicsGetDataType",182}, + {"helicsFederateInfoSetFlagOption",183}, + {"helicsFederateInfoSetSeparator",184}, + {"helicsFederateInfoSetTimeProperty",185}, + {"helicsFederateInfoSetIntegerProperty",186}, + {"helicsFederateRegisterInterfaces",187}, + {"helicsFederateGlobalError",188}, + {"helicsFederateLocalError",189}, + {"helicsFederateFinalize",190}, + {"helicsFederateFinalizeAsync",191}, + {"helicsFederateFinalizeComplete",192}, + {"helicsFederateDisconnect",193}, + {"helicsFederateDisconnectAsync",194}, + {"helicsFederateDisconnectComplete",195}, + {"helicsFederateFree",196}, + {"helicsCloseLibrary",197}, + {"helicsFederateEnterInitializingMode",198}, + {"helicsFederateEnterInitializingModeAsync",199}, + {"helicsFederateEnterInitializingModeComplete",200}, + {"helicsFederateEnterInitializingModeIterative",201}, + {"helicsFederateEnterInitializingModeIterativeAsync",202}, + {"helicsFederateEnterInitializingModeIterativeComplete",203}, + {"helicsFederateIsAsyncOperationCompleted",204}, + {"helicsFederateEnterExecutingMode",205}, + {"helicsFederateEnterExecutingModeAsync",206}, + {"helicsFederateEnterExecutingModeComplete",207}, + {"helicsFederateEnterExecutingModeIterative",208}, + {"helicsFederateEnterExecutingModeIterativeAsync",209}, + {"helicsFederateEnterExecutingModeIterativeComplete",210}, + {"helicsFederateGetState",211}, + {"helicsFederateGetCore",212}, + {"helicsFederateRequestTime",213}, + {"helicsFederateRequestTimeAdvance",214}, + {"helicsFederateRequestNextStep",215}, + {"helicsFederateRequestTimeIterative",216}, + {"helicsFederateRequestTimeAsync",217}, + {"helicsFederateRequestTimeComplete",218}, + {"helicsFederateRequestTimeIterativeAsync",219}, + {"helicsFederateRequestTimeIterativeComplete",220}, + {"helicsFederateProcessCommunications",221}, + {"helicsFederateGetName",222}, + {"helicsFederateSetTimeProperty",223}, + {"helicsFederateSetFlagOption",224}, + {"helicsFederateSetSeparator",225}, + {"helicsFederateSetIntegerProperty",226}, + {"helicsFederateGetTimeProperty",227}, + {"helicsFederateGetFlagOption",228}, + {"helicsFederateGetIntegerProperty",229}, + {"helicsFederateGetCurrentTime",230}, + {"helicsFederateAddAlias",231}, + {"helicsFederateSetGlobal",232}, + {"helicsFederateSetTag",233}, + {"helicsFederateGetTag",234}, + {"helicsFederateAddDependency",235}, + {"helicsFederateSetLogFile",236}, + {"helicsFederateLogErrorMessage",237}, + {"helicsFederateLogWarningMessage",238}, + {"helicsFederateLogInfoMessage",239}, + {"helicsFederateLogDebugMessage",240}, + {"helicsFederateLogLevelMessage",241}, + {"helicsFederateSendCommand",242}, + {"helicsFederateGetCommand",243}, + {"helicsFederateGetCommandSource",244}, + {"helicsFederateWaitCommand",245}, + {"helicsCoreSetGlobal",246}, + {"helicsBrokerSetGlobal",247}, + {"helicsCoreAddAlias",248}, + {"helicsBrokerAddAlias",249}, + {"helicsCoreSendCommand",250}, + {"helicsCoreSendOrderedCommand",251}, + {"helicsBrokerSendCommand",252}, + {"helicsBrokerSendOrderedCommand",253}, + {"helicsCoreSetLogFile",254}, + {"helicsBrokerSetLogFile",255}, + {"helicsBrokerSetTimeBarrier",256}, + {"helicsBrokerClearTimeBarrier",257}, + {"helicsBrokerGlobalError",258}, + {"helicsCoreGlobalError",259}, + {"helicsCreateQuery",260}, + {"helicsQueryExecute",261}, + {"helicsQueryCoreExecute",262}, + {"helicsQueryBrokerExecute",263}, + {"helicsQueryExecuteAsync",264}, + {"helicsQueryExecuteComplete",265}, + {"helicsQueryIsCompleted",266}, + {"helicsQuerySetTarget",267}, + {"helicsQuerySetQueryString",268}, + {"helicsQuerySetOrdering",269}, + {"helicsQueryFree",270}, + {"helicsCleanupLibrary",271}, + {"helicsAppEnabled",272}, + {"helicsCreateApp",273}, + {"helicsAppGetFederate",274}, + {"helicsAppLoadFile",275}, + {"helicsAppInitialize",276}, + {"helicsAppRun",277}, + {"helicsAppRunTo",278}, + {"helicsAppFinalize",279}, + {"helicsAppFree",280}, + {"helicsAppDestroy",281}, + {"helicsAppIsActive",282}, + {"helicsFederateRegisterSubscription",283}, + {"helicsFederateRegisterPublication",284}, + {"helicsFederateRegisterTypePublication",285}, + {"helicsFederateRegisterGlobalPublication",286}, + {"helicsFederateRegisterGlobalTypePublication",287}, + {"helicsFederateRegisterInput",288}, + {"helicsFederateRegisterTypeInput",289}, + {"helicsFederateRegisterGlobalInput",290}, + {"helicsFederateRegisterGlobalTypeInput",291}, + {"helicsFederateGetPublication",292}, + {"helicsFederateGetPublicationByIndex",293}, + {"helicsFederateGetInput",294}, + {"helicsFederateGetInputByIndex",295}, + {"helicsFederateGetSubscription",296}, + {"helicsFederateGetInputByTarget",297}, + {"helicsFederateClearUpdates",298}, + {"helicsFederateRegisterFromPublicationJSON",299}, + {"helicsFederatePublishJSON",300}, + {"helicsPublicationIsValid",301}, + {"helicsPublicationPublishBytes",302}, + {"helicsPublicationPublishString",303}, + {"helicsPublicationPublishInteger",304}, + {"helicsPublicationPublishBoolean",305}, + {"helicsPublicationPublishDouble",306}, + {"helicsPublicationPublishTime",307}, + {"helicsPublicationPublishChar",308}, + {"helicsPublicationPublishComplex",309}, + {"helicsPublicationPublishVector",310}, + {"helicsPublicationPublishComplexVector",311}, + {"helicsPublicationPublishNamedPoint",312}, + {"helicsPublicationPublishDataBuffer",313}, + {"helicsPublicationAddTarget",314}, + {"helicsInputIsValid",315}, + {"helicsInputAddTarget",316}, + {"helicsInputGetByteCount",317}, + {"helicsInputGetBytes",318}, + {"helicsInputGetDataBuffer",319}, + {"helicsInputGetStringSize",320}, + {"helicsInputGetString",321}, + {"helicsInputGetInteger",322}, + {"helicsInputGetBoolean",323}, + {"helicsInputGetDouble",324}, + {"helicsInputGetTime",325}, + {"helicsInputGetChar",326}, + {"helicsInputGetComplexObject",327}, + {"helicsInputGetComplex",328}, + {"helicsInputGetVectorSize",329}, + {"helicsInputGetVector",330}, + {"helicsInputGetComplexVector",331}, + {"helicsInputGetNamedPoint",332}, + {"helicsInputSetDefaultBytes",333}, + {"helicsInputSetDefaultString",334}, + {"helicsInputSetDefaultInteger",335}, + {"helicsInputSetDefaultBoolean",336}, + {"helicsInputSetDefaultTime",337}, + {"helicsInputSetDefaultChar",338}, + {"helicsInputSetDefaultDouble",339}, + {"helicsInputSetDefaultComplex",340}, + {"helicsInputSetDefaultVector",341}, + {"helicsInputSetDefaultComplexVector",342}, + {"helicsInputSetDefaultNamedPoint",343}, + {"helicsInputGetType",344}, + {"helicsInputGetPublicationType",345}, + {"helicsInputGetPublicationDataType",346}, + {"helicsPublicationGetType",347}, + {"helicsInputGetName",348}, + {"helicsSubscriptionGetTarget",349}, + {"helicsInputGetTarget",350}, + {"helicsPublicationGetName",351}, + {"helicsInputGetUnits",352}, + {"helicsInputGetInjectionUnits",353}, + {"helicsInputGetExtractionUnits",354}, + {"helicsPublicationGetUnits",355}, + {"helicsInputGetInfo",356}, + {"helicsInputSetInfo",357}, + {"helicsInputGetTag",358}, + {"helicsInputSetTag",359}, + {"helicsPublicationGetInfo",360}, + {"helicsPublicationSetInfo",361}, + {"helicsPublicationGetTag",362}, + {"helicsPublicationSetTag",363}, + {"helicsInputGetOption",364}, + {"helicsInputSetOption",365}, + {"helicsPublicationGetOption",366}, + {"helicsPublicationSetOption",367}, + {"helicsPublicationSetMinimumChange",368}, + {"helicsInputSetMinimumChange",369}, + {"helicsInputIsUpdated",370}, + {"helicsInputLastUpdateTime",371}, + {"helicsInputClearUpdate",372}, + {"helicsFederateGetPublicationCount",373}, + {"helicsFederateGetInputCount",374}, + {"helicsFederateRegisterEndpoint",375}, + {"helicsFederateRegisterGlobalEndpoint",376}, + {"helicsFederateRegisterTargetedEndpoint",377}, + {"helicsFederateRegisterGlobalTargetedEndpoint",378}, + {"helicsFederateGetEndpoint",379}, + {"helicsFederateGetEndpointByIndex",380}, + {"helicsEndpointIsValid",381}, + {"helicsEndpointSetDefaultDestination",382}, + {"helicsEndpointGetDefaultDestination",383}, + {"helicsEndpointSendString",384}, + {"helicsEndpointSendStringTo",385}, + {"helicsEndpointSendStringToAt",386}, + {"helicsEndpointSendStringAt",387}, + {"helicsEndpointSendBytes",388}, + {"helicsEndpointSendBytesTo",389}, + {"helicsEndpointSendBytesToAt",390}, + {"helicsEndpointSendBytesAt",391}, + {"helicsEndpointSendMessage",392}, + {"helicsEndpointSendMessageZeroCopy",393}, + {"helicsEndpointSubscribe",394}, + {"helicsFederateHasMessage",395}, + {"helicsEndpointHasMessage",396}, + {"helicsFederatePendingMessageCount",397}, + {"helicsEndpointPendingMessageCount",398}, + {"helicsEndpointGetMessage",399}, + {"helicsEndpointCreateMessage",400}, + {"helicsEndpointClearMessages",401}, + {"helicsFederateGetMessage",402}, + {"helicsFederateCreateMessage",403}, + {"helicsFederateClearMessages",404}, + {"helicsEndpointGetType",405}, + {"helicsEndpointGetName",406}, + {"helicsFederateGetEndpointCount",407}, + {"helicsEndpointGetInfo",408}, + {"helicsEndpointSetInfo",409}, + {"helicsEndpointGetTag",410}, + {"helicsEndpointSetTag",411}, + {"helicsEndpointSetOption",412}, + {"helicsEndpointGetOption",413}, + {"helicsEndpointAddSourceTarget",414}, + {"helicsEndpointAddDestinationTarget",415}, + {"helicsEndpointRemoveTarget",416}, + {"helicsEndpointAddSourceFilter",417}, + {"helicsEndpointAddDestinationFilter",418}, + {"helicsMessageGetSource",419}, + {"helicsMessageGetDestination",420}, + {"helicsMessageGetOriginalSource",421}, + {"helicsMessageGetOriginalDestination",422}, + {"helicsMessageGetTime",423}, + {"helicsMessageGetString",424}, + {"helicsMessageGetMessageID",425}, + {"helicsMessageGetFlagOption",426}, + {"helicsMessageGetByteCount",427}, + {"helicsMessageGetBytes",428}, + {"helicsMessageGetBytesPointer",429}, + {"helicsMessageDataBuffer",430}, + {"helicsMessageIsValid",431}, + {"helicsMessageSetSource",432}, + {"helicsMessageSetDestination",433}, + {"helicsMessageSetOriginalSource",434}, + {"helicsMessageSetOriginalDestination",435}, + {"helicsMessageSetTime",436}, + {"helicsMessageResize",437}, + {"helicsMessageReserve",438}, + {"helicsMessageSetMessageID",439}, + {"helicsMessageClearFlags",440}, + {"helicsMessageSetFlagOption",441}, + {"helicsMessageSetString",442}, + {"helicsMessageSetData",443}, + {"helicsMessageSetDataBuffer",444}, + {"helicsMessageAppendData",445}, + {"helicsMessageCopy",446}, + {"helicsMessageClone",447}, + {"helicsMessageFree",448}, + {"helicsMessageClear",449}, + {"helicsFederateRegisterFilter",450}, + {"helicsFederateRegisterGlobalFilter",451}, + {"helicsFederateRegisterCloningFilter",452}, + {"helicsFederateRegisterGlobalCloningFilter",453}, + {"helicsCoreRegisterFilter",454}, + {"helicsCoreRegisterCloningFilter",455}, + {"helicsFederateGetFilterCount",456}, + {"helicsFederateGetFilter",457}, + {"helicsFederateGetFilterByIndex",458}, + {"helicsFilterIsValid",459}, + {"helicsFilterGetName",460}, + {"helicsFilterSet",461}, + {"helicsFilterSetString",462}, + {"helicsFilterGetPropertyDouble",463}, + {"helicsFilterGetPropertyString",464}, + {"helicsFilterAddDestinationTarget",465}, + {"helicsFilterAddSourceTarget",466}, + {"helicsFilterAddDeliveryEndpoint",467}, + {"helicsFilterRemoveTarget",468}, + {"helicsFilterRemoveDeliveryEndpoint",469}, + {"helicsFilterGetInfo",470}, + {"helicsFilterSetInfo",471}, + {"helicsFilterGetTag",472}, + {"helicsFilterSetTag",473}, + {"helicsFilterSetOption",474}, + {"helicsFilterGetOption",475}, + {"helicsFederateRegisterTranslator",476}, + {"helicsFederateRegisterGlobalTranslator",477}, + {"helicsCoreRegisterTranslator",478}, + {"helicsFederateGetTranslatorCount",479}, + {"helicsFederateGetTranslator",480}, + {"helicsFederateGetTranslatorByIndex",481}, + {"helicsTranslatorIsValid",482}, + {"helicsTranslatorGetName",483}, + {"helicsTranslatorSet",484}, + {"helicsTranslatorSetString",485}, + {"helicsTranslatorAddInputTarget",486}, + {"helicsTranslatorAddPublicationTarget",487}, + {"helicsTranslatorAddSourceEndpoint",488}, + {"helicsTranslatorAddDestinationEndpoint",489}, + {"helicsTranslatorRemoveTarget",490}, + {"helicsTranslatorGetInfo",491}, + {"helicsTranslatorSetInfo",492}, + {"helicsTranslatorGetTag",493}, + {"helicsTranslatorSetTag",494}, + {"helicsTranslatorSetOption",495}, + {"helicsTranslatorGetOption",496}, + {"helicsBrokerSetLoggingCallback",497}, + {"helicsCoreSetLoggingCallback",498}, + {"helicsFederateSetLoggingCallback",499}, + {"helicsFilterSetCustomCallback",500}, + {"helicsTranslatorSetCustomCallback",501}, + {"helicsFederateSetQueryCallback",502}, + {"helicsFederateSetTimeRequestEntryCallback",503}, + {"helicsFederateSetTimeUpdateCallback",504}, + {"helicsFederateSetStateChangeCallback",505}, + {"helicsFederateSetTimeRequestReturnCallback",506}, + {"helicsFederateInitializingEntryCallback",507}, + {"helicsFederateExecutingEntryCallback",508}, + {"helicsFederateCosimulationTerminationCallback",509}, + {"helicsFederateErrorHandlerCallback",510}, + {"helicsCallbackFederateNextTimeCallback",511}, + {"helicsCallbackFederateNextTimeIterativeCallback",512}, + {"helicsCallbackFederateInitializeCallback",513}, + {"helicsQueryBufferFill",514} }; +void _wrap_HELICS_INVALID_DOUBLE(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 0){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:HELICS_INVALID_DOUBLE:rhs","This function doesn't take arguments."); + } + mxArray *_out = mxCreateNumericMatrix(1,1,mxINT64_CLASS,mxREAL); + *((int64_t*)mxGetData(_out)) = (int64_t)HELICS_INVALID_DOUBLE; + resv[0] = _out; +} + void _wrap_helicsCreateDataBuffer(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ if(argc != 1){ mexUnlock(); @@ -7911,47 +7939,83 @@ void _wrap_helicsCleanupLibrary(int resc, mxArray *resv[], int argc, const mxArr } -void _wrap_helicsFederateRegisterSubscription(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ - if(argc != 3){ +void _wrap_helicsAppEnabled(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 0){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterSubscription:rhs","This function requires 3 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsAppEnabled:rhs","This function requires 0 arguments."); } - if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + HelicsBool result = helicsAppEnabled(); + + mxArray *_out = mxCreateLogicalMatrix(1, 1); + mxLogical *rv = mxGetLogicals(_out); + if(result == HELICS_TRUE){ + rv[0] = true; + }else{ + rv[0] = false; + } + + if(_out){ + --resc; + *resv++ = _out; + } +} + + +void _wrap_helicsCreateApp(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 4){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterSubscription:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsCreateApp:rhs","This function requires 4 arguments."); } - HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); + if(!mxIsChar(argv[0])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsCreateApp:TypeError","Argument 1 must be a string."); + } + char *appName = nullptr; + size_t appNameLength = 0; + int appNameStatus = 0; + if(argc > 0){ + appNameLength = mxGetN(argv[0]) + 1; + appName = static_cast(malloc(appNameLength)); + appNameStatus = mxGetString(argv[0], appName, appNameLength); + + } if(!mxIsChar(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterSubscription:TypeError","Argument 2 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsCreateApp:TypeError","Argument 2 must be a string."); } - char *key = nullptr; - size_t keyLength = 0; - int keyStatus = 0; + char *appType = nullptr; + size_t appTypeLength = 0; + int appTypeStatus = 0; if(argc > 1){ - keyLength = mxGetN(argv[1]) + 1; - key = static_cast(malloc(keyLength)); - keyStatus = mxGetString(argv[1], key, keyLength); + appTypeLength = mxGetN(argv[1]) + 1; + appType = static_cast(malloc(appTypeLength)); + appTypeStatus = mxGetString(argv[1], appType, appTypeLength); } if(!mxIsChar(argv[2])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterSubscription:TypeError","Argument 3 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsCreateApp:TypeError","Argument 3 must be a string."); } - char *units = nullptr; - size_t unitsLength = 0; - int unitsStatus = 0; + char *configFile = nullptr; + size_t configFileLength = 0; + int configFileStatus = 0; if(argc > 2){ - unitsLength = mxGetN(argv[2]) + 1; - units = static_cast(malloc(unitsLength)); - unitsStatus = mxGetString(argv[2], units, unitsLength); + configFileLength = mxGetN(argv[2]) + 1; + configFile = static_cast(malloc(configFileLength)); + configFileStatus = mxGetString(argv[2], configFile, configFileLength); } + if(mxGetClassID(argv[3]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsCreateApp:TypeError","Argument 4 must be of type uint64."); + } + HelicsFederateInfo fedInfo = *(static_cast(mxGetData(argv[3]))); + HelicsError err = helicsErrorInitialize(); - HelicsInput result = helicsFederateRegisterSubscription(fed, static_cast(key), static_cast(units), &err); + HelicsApp result = helicsCreateApp(static_cast(appName), static_cast(appType), static_cast(configFile), fedInfo, &err); mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); mxUint64 *rv = mxGetUint64s(_out); @@ -7962,9 +8026,11 @@ void _wrap_helicsFederateRegisterSubscription(int resc, mxArray *resv[], int arg *resv++ = _out; } - free(key); + free(appName); - free(units); + free(appType); + + free(configFile); if(err.error_code != HELICS_OK){ throwHelicsMatlabError(&err); @@ -7972,67 +8038,74 @@ void _wrap_helicsFederateRegisterSubscription(int resc, mxArray *resv[], int arg } -void _wrap_helicsFederateRegisterPublication(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ - if(argc != 4){ +void _wrap_helicsAppGetFederate(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 1){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterPublication:rhs","This function requires 4 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsAppGetFederate:rhs","This function requires 1 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterPublication:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsAppGetFederate:TypeError","Argument 1 must be of type uint64."); } - HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); + HelicsApp app = *(static_cast(mxGetData(argv[0]))); - if(!mxIsChar(argv[1])){ - mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterPublication:TypeError","Argument 2 must be a string."); + HelicsError err = helicsErrorInitialize(); + + HelicsFederate result = helicsAppGetFederate(app, &err); + + mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); + mxUint64 *rv = mxGetUint64s(_out); + rv[0] = reinterpret_cast(result); + + if(_out){ + --resc; + *resv++ = _out; } - char *key = nullptr; - size_t keyLength = 0; - int keyStatus = 0; - if(argc > 1){ - keyLength = mxGetN(argv[1]) + 1; - key = static_cast(malloc(keyLength)); - keyStatus = mxGetString(argv[1], key, keyLength); + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); } - if(!mxIsNumeric(argv[2])){ +} + + +void _wrap_helicsAppLoadFile(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 2){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterPublication:TypeError","Argument 3 must be of type int32."); + mexErrMsgIdAndTxt("MATLAB:helicsAppLoadFile:rhs","This function requires 2 arguments."); } - int typeInt = static_cast(mxGetScalar(argv[2])); - HelicsDataTypes type = static_cast(typeInt); - if(!mxIsChar(argv[3])){ + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterPublication:TypeError","Argument 4 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsAppLoadFile:TypeError","Argument 1 must be of type uint64."); } - char *units = nullptr; - size_t unitsLength = 0; - int unitsStatus = 0; - if(argc > 3){ - unitsLength = mxGetN(argv[3]) + 1; - units = static_cast(malloc(unitsLength)); - unitsStatus = mxGetString(argv[3], units, unitsLength); + HelicsApp app = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsAppLoadFile:TypeError","Argument 2 must be a string."); + } + char *configFile = nullptr; + size_t configFileLength = 0; + int configFileStatus = 0; + if(argc > 1){ + configFileLength = mxGetN(argv[1]) + 1; + configFile = static_cast(malloc(configFileLength)); + configFileStatus = mxGetString(argv[1], configFile, configFileLength); } HelicsError err = helicsErrorInitialize(); - HelicsPublication result = helicsFederateRegisterPublication(fed, static_cast(key), type, static_cast(units), &err); + helicsAppLoadFile(app, static_cast(configFile), &err); - mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); - mxUint64 *rv = mxGetUint64s(_out); - rv[0] = reinterpret_cast(result); + mxArray *_out = nullptr; if(_out){ --resc; *resv++ = _out; } - free(key); - - free(units); + free(configFile); if(err.error_code != HELICS_OK){ throwHelicsMatlabError(&err); @@ -8040,169 +8113,222 @@ void _wrap_helicsFederateRegisterPublication(int resc, mxArray *resv[], int argc } -void _wrap_helicsFederateRegisterTypePublication(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ - if(argc != 4){ +void _wrap_helicsAppInitialize(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 1){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypePublication:rhs","This function requires 4 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsAppInitialize:rhs","This function requires 1 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypePublication:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsAppInitialize:TypeError","Argument 1 must be of type uint64."); } - HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); + HelicsApp app = *(static_cast(mxGetData(argv[0]))); - if(!mxIsChar(argv[1])){ - mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypePublication:TypeError","Argument 2 must be a string."); + HelicsError err = helicsErrorInitialize(); + + helicsAppInitialize(app, &err); + + mxArray *_out = nullptr; + + if(_out){ + --resc; + *resv++ = _out; } - char *key = nullptr; - size_t keyLength = 0; - int keyStatus = 0; - if(argc > 1){ - keyLength = mxGetN(argv[1]) + 1; - key = static_cast(malloc(keyLength)); - keyStatus = mxGetString(argv[1], key, keyLength); + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); } - if(!mxIsChar(argv[2])){ +} + + +void _wrap_helicsAppRun(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 1){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypePublication:TypeError","Argument 3 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsAppRun:rhs","This function requires 1 arguments."); } - char *type = nullptr; - size_t typeLength = 0; - int typeStatus = 0; - if(argc > 2){ - typeLength = mxGetN(argv[2]) + 1; - type = static_cast(malloc(typeLength)); - typeStatus = mxGetString(argv[2], type, typeLength); - } - if(!mxIsChar(argv[3])){ + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypePublication:TypeError","Argument 4 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsAppRun:TypeError","Argument 1 must be of type uint64."); } - char *units = nullptr; - size_t unitsLength = 0; - int unitsStatus = 0; - if(argc > 3){ - unitsLength = mxGetN(argv[3]) + 1; - units = static_cast(malloc(unitsLength)); - unitsStatus = mxGetString(argv[3], units, unitsLength); + HelicsApp app = *(static_cast(mxGetData(argv[0]))); - } HelicsError err = helicsErrorInitialize(); - HelicsPublication result = helicsFederateRegisterTypePublication(fed, static_cast(key), static_cast(type), static_cast(units), &err); + helicsAppRun(app, &err); - mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); - mxUint64 *rv = mxGetUint64s(_out); - rv[0] = reinterpret_cast(result); + mxArray *_out = nullptr; if(_out){ --resc; *resv++ = _out; } - free(key); - - free(type); - - free(units); - if(err.error_code != HELICS_OK){ throwHelicsMatlabError(&err); } } -void _wrap_helicsFederateRegisterGlobalPublication(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ - if(argc != 4){ +void _wrap_helicsAppRunTo(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 2){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalPublication:rhs","This function requires 4 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsAppRunTo:rhs","This function requires 2 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalPublication:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsAppRunTo:TypeError","Argument 1 must be of type uint64."); } - HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); + HelicsApp app = *(static_cast(mxGetData(argv[0]))); - if(!mxIsChar(argv[1])){ + if(!mxIsNumeric(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalPublication:TypeError","Argument 2 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsAppRunTo:TypeError","Argument 2 must be of type double."); } - char *key = nullptr; - size_t keyLength = 0; - int keyStatus = 0; - if(argc > 1){ - keyLength = mxGetN(argv[1]) + 1; - key = static_cast(malloc(keyLength)); - keyStatus = mxGetString(argv[1], key, keyLength); + HelicsTime stopTime = (HelicsTime)(mxGetScalar(argv[1])); + + HelicsError err = helicsErrorInitialize(); + + helicsAppRunTo(app, stopTime, &err); + + mxArray *_out = nullptr; + if(_out){ + --resc; + *resv++ = _out; } - if(!mxIsNumeric(argv[2])){ - mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalPublication:TypeError","Argument 3 must be of type int32."); + + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); } - int typeInt = static_cast(mxGetScalar(argv[2])); - HelicsDataTypes type = static_cast(typeInt); +} - if(!mxIsChar(argv[3])){ + +void _wrap_helicsAppFinalize(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 1){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalPublication:TypeError","Argument 4 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsAppFinalize:rhs","This function requires 1 arguments."); } - char *units = nullptr; - size_t unitsLength = 0; - int unitsStatus = 0; - if(argc > 3){ - unitsLength = mxGetN(argv[3]) + 1; - units = static_cast(malloc(unitsLength)); - unitsStatus = mxGetString(argv[3], units, unitsLength); + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsAppFinalize:TypeError","Argument 1 must be of type uint64."); } + HelicsApp app = *(static_cast(mxGetData(argv[0]))); + HelicsError err = helicsErrorInitialize(); - HelicsPublication result = helicsFederateRegisterGlobalPublication(fed, static_cast(key), type, static_cast(units), &err); + helicsAppFinalize(app, &err); - mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); - mxUint64 *rv = mxGetUint64s(_out); - rv[0] = reinterpret_cast(result); + mxArray *_out = nullptr; if(_out){ --resc; *resv++ = _out; } - free(key); - - free(units); - if(err.error_code != HELICS_OK){ throwHelicsMatlabError(&err); } } -void _wrap_helicsFederateRegisterGlobalTypePublication(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ - if(argc != 4){ +void _wrap_helicsAppFree(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 1){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypePublication:rhs","This function requires 4 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsAppFree:rhs","This function requires 1 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypePublication:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsAppFree:TypeError","Argument 1 must be of type uint64."); } - HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); + HelicsApp app = *(static_cast(mxGetData(argv[0]))); - if(!mxIsChar(argv[1])){ - mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypePublication:TypeError","Argument 2 must be a string."); - } - char *key = nullptr; - size_t keyLength = 0; - int keyStatus = 0; + helicsAppFree(app); + + mxArray *_out = nullptr; + + if(_out){ + --resc; + *resv++ = _out; + } +} + + +void _wrap_helicsAppDestroy(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 1){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsAppDestroy:rhs","This function requires 1 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsAppDestroy:TypeError","Argument 1 must be of type uint64."); + } + HelicsApp app = *(static_cast(mxGetData(argv[0]))); + + helicsAppDestroy(app); + + mxArray *_out = nullptr; + + if(_out){ + --resc; + *resv++ = _out; + } +} + + +void _wrap_helicsAppIsActive(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 1){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsAppIsActive:rhs","This function requires 1 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsAppIsActive:TypeError","Argument 1 must be of type uint64."); + } + HelicsApp app = *(static_cast(mxGetData(argv[0]))); + + HelicsBool result = helicsAppIsActive(app); + + mxArray *_out = mxCreateLogicalMatrix(1, 1); + mxLogical *rv = mxGetLogicals(_out); + if(result == HELICS_TRUE){ + rv[0] = true; + }else{ + rv[0] = false; + } + + if(_out){ + --resc; + *resv++ = _out; + } +} + + +void _wrap_helicsFederateRegisterSubscription(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 3){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterSubscription:rhs","This function requires 3 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterSubscription:TypeError","Argument 1 must be of type uint64."); + } + HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterSubscription:TypeError","Argument 2 must be a string."); + } + char *key = nullptr; + size_t keyLength = 0; + int keyStatus = 0; if(argc > 1){ keyLength = mxGetN(argv[1]) + 1; key = static_cast(malloc(keyLength)); @@ -8211,33 +8337,20 @@ void _wrap_helicsFederateRegisterGlobalTypePublication(int resc, mxArray *resv[] } if(!mxIsChar(argv[2])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypePublication:TypeError","Argument 3 must be a string."); - } - char *type = nullptr; - size_t typeLength = 0; - int typeStatus = 0; - if(argc > 2){ - typeLength = mxGetN(argv[2]) + 1; - type = static_cast(malloc(typeLength)); - typeStatus = mxGetString(argv[2], type, typeLength); - - } - if(!mxIsChar(argv[3])){ - mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypePublication:TypeError","Argument 4 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterSubscription:TypeError","Argument 3 must be a string."); } char *units = nullptr; size_t unitsLength = 0; int unitsStatus = 0; - if(argc > 3){ - unitsLength = mxGetN(argv[3]) + 1; + if(argc > 2){ + unitsLength = mxGetN(argv[2]) + 1; units = static_cast(malloc(unitsLength)); - unitsStatus = mxGetString(argv[3], units, unitsLength); + unitsStatus = mxGetString(argv[2], units, unitsLength); } HelicsError err = helicsErrorInitialize(); - HelicsPublication result = helicsFederateRegisterGlobalTypePublication(fed, static_cast(key), static_cast(type), static_cast(units), &err); + HelicsInput result = helicsFederateRegisterSubscription(fed, static_cast(key), static_cast(units), &err); mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); mxUint64 *rv = mxGetUint64s(_out); @@ -8250,8 +8363,6 @@ void _wrap_helicsFederateRegisterGlobalTypePublication(int resc, mxArray *resv[] free(key); - free(type); - free(units); if(err.error_code != HELICS_OK){ @@ -8260,21 +8371,21 @@ void _wrap_helicsFederateRegisterGlobalTypePublication(int resc, mxArray *resv[] } -void _wrap_helicsFederateRegisterInput(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ +void _wrap_helicsFederateRegisterPublication(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ if(argc != 4){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterInput:rhs","This function requires 4 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterPublication:rhs","This function requires 4 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterInput:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterPublication:TypeError","Argument 1 must be of type uint64."); } HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); if(!mxIsChar(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterInput:TypeError","Argument 2 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterPublication:TypeError","Argument 2 must be a string."); } char *key = nullptr; size_t keyLength = 0; @@ -8287,14 +8398,14 @@ void _wrap_helicsFederateRegisterInput(int resc, mxArray *resv[], int argc, cons } if(!mxIsNumeric(argv[2])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterInput:TypeError","Argument 3 must be of type int32."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterPublication:TypeError","Argument 3 must be of type int32."); } int typeInt = static_cast(mxGetScalar(argv[2])); HelicsDataTypes type = static_cast(typeInt); if(!mxIsChar(argv[3])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterInput:TypeError","Argument 4 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterPublication:TypeError","Argument 4 must be a string."); } char *units = nullptr; size_t unitsLength = 0; @@ -8307,7 +8418,7 @@ void _wrap_helicsFederateRegisterInput(int resc, mxArray *resv[], int argc, cons } HelicsError err = helicsErrorInitialize(); - HelicsInput result = helicsFederateRegisterInput(fed, static_cast(key), type, static_cast(units), &err); + HelicsPublication result = helicsFederateRegisterPublication(fed, static_cast(key), type, static_cast(units), &err); mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); mxUint64 *rv = mxGetUint64s(_out); @@ -8328,21 +8439,21 @@ void _wrap_helicsFederateRegisterInput(int resc, mxArray *resv[], int argc, cons } -void _wrap_helicsFederateRegisterTypeInput(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ +void _wrap_helicsFederateRegisterTypePublication(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ if(argc != 4){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypeInput:rhs","This function requires 4 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypePublication:rhs","This function requires 4 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypeInput:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypePublication:TypeError","Argument 1 must be of type uint64."); } HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); if(!mxIsChar(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypeInput:TypeError","Argument 2 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypePublication:TypeError","Argument 2 must be a string."); } char *key = nullptr; size_t keyLength = 0; @@ -8355,7 +8466,7 @@ void _wrap_helicsFederateRegisterTypeInput(int resc, mxArray *resv[], int argc, } if(!mxIsChar(argv[2])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypeInput:TypeError","Argument 3 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypePublication:TypeError","Argument 3 must be a string."); } char *type = nullptr; size_t typeLength = 0; @@ -8368,7 +8479,7 @@ void _wrap_helicsFederateRegisterTypeInput(int resc, mxArray *resv[], int argc, } if(!mxIsChar(argv[3])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypeInput:TypeError","Argument 4 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypePublication:TypeError","Argument 4 must be a string."); } char *units = nullptr; size_t unitsLength = 0; @@ -8381,7 +8492,7 @@ void _wrap_helicsFederateRegisterTypeInput(int resc, mxArray *resv[], int argc, } HelicsError err = helicsErrorInitialize(); - HelicsInput result = helicsFederateRegisterTypeInput(fed, static_cast(key), static_cast(type), static_cast(units), &err); + HelicsPublication result = helicsFederateRegisterTypePublication(fed, static_cast(key), static_cast(type), static_cast(units), &err); mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); mxUint64 *rv = mxGetUint64s(_out); @@ -8404,21 +8515,21 @@ void _wrap_helicsFederateRegisterTypeInput(int resc, mxArray *resv[], int argc, } -void _wrap_helicsFederateRegisterGlobalInput(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ +void _wrap_helicsFederateRegisterGlobalPublication(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ if(argc != 4){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalInput:rhs","This function requires 4 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalPublication:rhs","This function requires 4 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalInput:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalPublication:TypeError","Argument 1 must be of type uint64."); } HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); if(!mxIsChar(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalInput:TypeError","Argument 2 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalPublication:TypeError","Argument 2 must be a string."); } char *key = nullptr; size_t keyLength = 0; @@ -8431,14 +8542,14 @@ void _wrap_helicsFederateRegisterGlobalInput(int resc, mxArray *resv[], int argc } if(!mxIsNumeric(argv[2])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalInput:TypeError","Argument 3 must be of type int32."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalPublication:TypeError","Argument 3 must be of type int32."); } int typeInt = static_cast(mxGetScalar(argv[2])); HelicsDataTypes type = static_cast(typeInt); if(!mxIsChar(argv[3])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalInput:TypeError","Argument 4 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalPublication:TypeError","Argument 4 must be a string."); } char *units = nullptr; size_t unitsLength = 0; @@ -8451,7 +8562,7 @@ void _wrap_helicsFederateRegisterGlobalInput(int resc, mxArray *resv[], int argc } HelicsError err = helicsErrorInitialize(); - HelicsPublication result = helicsFederateRegisterGlobalInput(fed, static_cast(key), type, static_cast(units), &err); + HelicsPublication result = helicsFederateRegisterGlobalPublication(fed, static_cast(key), type, static_cast(units), &err); mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); mxUint64 *rv = mxGetUint64s(_out); @@ -8472,21 +8583,21 @@ void _wrap_helicsFederateRegisterGlobalInput(int resc, mxArray *resv[], int argc } -void _wrap_helicsFederateRegisterGlobalTypeInput(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ +void _wrap_helicsFederateRegisterGlobalTypePublication(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ if(argc != 4){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypeInput:rhs","This function requires 4 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypePublication:rhs","This function requires 4 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypeInput:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypePublication:TypeError","Argument 1 must be of type uint64."); } HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); if(!mxIsChar(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypeInput:TypeError","Argument 2 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypePublication:TypeError","Argument 2 must be a string."); } char *key = nullptr; size_t keyLength = 0; @@ -8499,7 +8610,7 @@ void _wrap_helicsFederateRegisterGlobalTypeInput(int resc, mxArray *resv[], int } if(!mxIsChar(argv[2])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypeInput:TypeError","Argument 3 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypePublication:TypeError","Argument 3 must be a string."); } char *type = nullptr; size_t typeLength = 0; @@ -8512,7 +8623,7 @@ void _wrap_helicsFederateRegisterGlobalTypeInput(int resc, mxArray *resv[], int } if(!mxIsChar(argv[3])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypeInput:TypeError","Argument 4 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypePublication:TypeError","Argument 4 must be a string."); } char *units = nullptr; size_t unitsLength = 0; @@ -8525,7 +8636,7 @@ void _wrap_helicsFederateRegisterGlobalTypeInput(int resc, mxArray *resv[], int } HelicsError err = helicsErrorInitialize(); - HelicsPublication result = helicsFederateRegisterGlobalTypeInput(fed, static_cast(key), static_cast(type), static_cast(units), &err); + HelicsPublication result = helicsFederateRegisterGlobalTypePublication(fed, static_cast(key), static_cast(type), static_cast(units), &err); mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); mxUint64 *rv = mxGetUint64s(_out); @@ -8548,21 +8659,21 @@ void _wrap_helicsFederateRegisterGlobalTypeInput(int resc, mxArray *resv[], int } -void _wrap_helicsFederateGetPublication(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ - if(argc != 2){ +void _wrap_helicsFederateRegisterInput(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 4){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublication:rhs","This function requires 2 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterInput:rhs","This function requires 4 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublication:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterInput:TypeError","Argument 1 must be of type uint64."); } HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); if(!mxIsChar(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublication:TypeError","Argument 2 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterInput:TypeError","Argument 2 must be a string."); } char *key = nullptr; size_t keyLength = 0; @@ -8572,10 +8683,30 @@ void _wrap_helicsFederateGetPublication(int resc, mxArray *resv[], int argc, con key = static_cast(malloc(keyLength)); keyStatus = mxGetString(argv[1], key, keyLength); + } + if(!mxIsNumeric(argv[2])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterInput:TypeError","Argument 3 must be of type int32."); + } + int typeInt = static_cast(mxGetScalar(argv[2])); + HelicsDataTypes type = static_cast(typeInt); + + if(!mxIsChar(argv[3])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterInput:TypeError","Argument 4 must be a string."); + } + char *units = nullptr; + size_t unitsLength = 0; + int unitsStatus = 0; + if(argc > 3){ + unitsLength = mxGetN(argv[3]) + 1; + units = static_cast(malloc(unitsLength)); + unitsStatus = mxGetString(argv[3], units, unitsLength); + } HelicsError err = helicsErrorInitialize(); - HelicsPublication result = helicsFederateGetPublication(fed, static_cast(key), &err); + HelicsInput result = helicsFederateRegisterInput(fed, static_cast(key), type, static_cast(units), &err); mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); mxUint64 *rv = mxGetUint64s(_out); @@ -8588,33 +8719,68 @@ void _wrap_helicsFederateGetPublication(int resc, mxArray *resv[], int argc, con free(key); + free(units); + if(err.error_code != HELICS_OK){ throwHelicsMatlabError(&err); } } -void _wrap_helicsFederateGetPublicationByIndex(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ - if(argc != 2){ +void _wrap_helicsFederateRegisterTypeInput(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 4){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublicationByIndex:rhs","This function requires 2 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypeInput:rhs","This function requires 4 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublicationByIndex:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypeInput:TypeError","Argument 1 must be of type uint64."); } HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); - if(!mxIsNumeric(argv[1])){ + if(!mxIsChar(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublicationByIndex:TypeError","Argument 2 must be of type integer."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypeInput:TypeError","Argument 2 must be a string."); } - int index = static_cast(mxGetScalar(argv[1])); + char *key = nullptr; + size_t keyLength = 0; + int keyStatus = 0; + if(argc > 1){ + keyLength = mxGetN(argv[1]) + 1; + key = static_cast(malloc(keyLength)); + keyStatus = mxGetString(argv[1], key, keyLength); + + } + if(!mxIsChar(argv[2])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypeInput:TypeError","Argument 3 must be a string."); + } + char *type = nullptr; + size_t typeLength = 0; + int typeStatus = 0; + if(argc > 2){ + typeLength = mxGetN(argv[2]) + 1; + type = static_cast(malloc(typeLength)); + typeStatus = mxGetString(argv[2], type, typeLength); + + } + if(!mxIsChar(argv[3])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterTypeInput:TypeError","Argument 4 must be a string."); + } + char *units = nullptr; + size_t unitsLength = 0; + int unitsStatus = 0; + if(argc > 3){ + unitsLength = mxGetN(argv[3]) + 1; + units = static_cast(malloc(unitsLength)); + unitsStatus = mxGetString(argv[3], units, unitsLength); + } HelicsError err = helicsErrorInitialize(); - HelicsPublication result = helicsFederateGetPublicationByIndex(fed, index, &err); + HelicsInput result = helicsFederateRegisterTypeInput(fed, static_cast(key), static_cast(type), static_cast(units), &err); mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); mxUint64 *rv = mxGetUint64s(_out); @@ -8625,27 +8791,33 @@ void _wrap_helicsFederateGetPublicationByIndex(int resc, mxArray *resv[], int ar *resv++ = _out; } + free(key); + + free(type); + + free(units); + if(err.error_code != HELICS_OK){ throwHelicsMatlabError(&err); } } -void _wrap_helicsFederateGetInput(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ - if(argc != 2){ +void _wrap_helicsFederateRegisterGlobalInput(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 4){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateGetInput:rhs","This function requires 2 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalInput:rhs","This function requires 4 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateGetInput:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalInput:TypeError","Argument 1 must be of type uint64."); } HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); if(!mxIsChar(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFederateGetInput:TypeError","Argument 2 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalInput:TypeError","Argument 2 must be a string."); } char *key = nullptr; size_t keyLength = 0; @@ -8656,11 +8828,238 @@ void _wrap_helicsFederateGetInput(int resc, mxArray *resv[], int argc, const mxA keyStatus = mxGetString(argv[1], key, keyLength); } - HelicsError err = helicsErrorInitialize(); - - HelicsInput result = helicsFederateGetInput(fed, static_cast(key), &err); - - mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); + if(!mxIsNumeric(argv[2])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalInput:TypeError","Argument 3 must be of type int32."); + } + int typeInt = static_cast(mxGetScalar(argv[2])); + HelicsDataTypes type = static_cast(typeInt); + + if(!mxIsChar(argv[3])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalInput:TypeError","Argument 4 must be a string."); + } + char *units = nullptr; + size_t unitsLength = 0; + int unitsStatus = 0; + if(argc > 3){ + unitsLength = mxGetN(argv[3]) + 1; + units = static_cast(malloc(unitsLength)); + unitsStatus = mxGetString(argv[3], units, unitsLength); + + } + HelicsError err = helicsErrorInitialize(); + + HelicsPublication result = helicsFederateRegisterGlobalInput(fed, static_cast(key), type, static_cast(units), &err); + + mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); + mxUint64 *rv = mxGetUint64s(_out); + rv[0] = reinterpret_cast(result); + + if(_out){ + --resc; + *resv++ = _out; + } + + free(key); + + free(units); + + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); + } +} + + +void _wrap_helicsFederateRegisterGlobalTypeInput(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 4){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypeInput:rhs","This function requires 4 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypeInput:TypeError","Argument 1 must be of type uint64."); + } + HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypeInput:TypeError","Argument 2 must be a string."); + } + char *key = nullptr; + size_t keyLength = 0; + int keyStatus = 0; + if(argc > 1){ + keyLength = mxGetN(argv[1]) + 1; + key = static_cast(malloc(keyLength)); + keyStatus = mxGetString(argv[1], key, keyLength); + + } + if(!mxIsChar(argv[2])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypeInput:TypeError","Argument 3 must be a string."); + } + char *type = nullptr; + size_t typeLength = 0; + int typeStatus = 0; + if(argc > 2){ + typeLength = mxGetN(argv[2]) + 1; + type = static_cast(malloc(typeLength)); + typeStatus = mxGetString(argv[2], type, typeLength); + + } + if(!mxIsChar(argv[3])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateRegisterGlobalTypeInput:TypeError","Argument 4 must be a string."); + } + char *units = nullptr; + size_t unitsLength = 0; + int unitsStatus = 0; + if(argc > 3){ + unitsLength = mxGetN(argv[3]) + 1; + units = static_cast(malloc(unitsLength)); + unitsStatus = mxGetString(argv[3], units, unitsLength); + + } + HelicsError err = helicsErrorInitialize(); + + HelicsPublication result = helicsFederateRegisterGlobalTypeInput(fed, static_cast(key), static_cast(type), static_cast(units), &err); + + mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); + mxUint64 *rv = mxGetUint64s(_out); + rv[0] = reinterpret_cast(result); + + if(_out){ + --resc; + *resv++ = _out; + } + + free(key); + + free(type); + + free(units); + + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); + } +} + + +void _wrap_helicsFederateGetPublication(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 2){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublication:rhs","This function requires 2 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublication:TypeError","Argument 1 must be of type uint64."); + } + HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublication:TypeError","Argument 2 must be a string."); + } + char *key = nullptr; + size_t keyLength = 0; + int keyStatus = 0; + if(argc > 1){ + keyLength = mxGetN(argv[1]) + 1; + key = static_cast(malloc(keyLength)); + keyStatus = mxGetString(argv[1], key, keyLength); + + } + HelicsError err = helicsErrorInitialize(); + + HelicsPublication result = helicsFederateGetPublication(fed, static_cast(key), &err); + + mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); + mxUint64 *rv = mxGetUint64s(_out); + rv[0] = reinterpret_cast(result); + + if(_out){ + --resc; + *resv++ = _out; + } + + free(key); + + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); + } +} + + +void _wrap_helicsFederateGetPublicationByIndex(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 2){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublicationByIndex:rhs","This function requires 2 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublicationByIndex:TypeError","Argument 1 must be of type uint64."); + } + HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsNumeric(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateGetPublicationByIndex:TypeError","Argument 2 must be of type integer."); + } + int index = static_cast(mxGetScalar(argv[1])); + + HelicsError err = helicsErrorInitialize(); + + HelicsPublication result = helicsFederateGetPublicationByIndex(fed, index, &err); + + mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); + mxUint64 *rv = mxGetUint64s(_out); + rv[0] = reinterpret_cast(result); + + if(_out){ + --resc; + *resv++ = _out; + } + + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); + } +} + + +void _wrap_helicsFederateGetInput(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 2){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateGetInput:rhs","This function requires 2 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateGetInput:TypeError","Argument 1 must be of type uint64."); + } + HelicsFederate fed = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFederateGetInput:TypeError","Argument 2 must be a string."); + } + char *key = nullptr; + size_t keyLength = 0; + int keyStatus = 0; + if(argc > 1){ + keyLength = mxGetN(argv[1]) + 1; + key = static_cast(malloc(keyLength)); + keyStatus = mxGetString(argv[1], key, keyLength); + + } + HelicsError err = helicsErrorInitialize(); + + HelicsInput result = helicsFederateGetInput(fed, static_cast(key), &err); + + mxArray *_out = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); mxUint64 *rv = mxGetUint64s(_out); rv[0] = reinterpret_cast(result); @@ -11915,44 +12314,43 @@ void _wrap_helicsEndpointGetDefaultDestination(int resc, mxArray *resv[], int ar } -void _wrap_helicsEndpointSendBytes(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ +void _wrap_helicsEndpointSendString(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ if(argc != 2){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytes:rhs","This function requires 2 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendString:rhs","This function requires 2 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytes:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendString:TypeError","Argument 1 must be of type uint64."); } HelicsEndpoint endpoint = *(static_cast(mxGetData(argv[0]))); if(!mxIsChar(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytes:TypeError","Argument 2 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendString:TypeError","Argument 2 must be a string."); } - char *data = nullptr; - size_t dataLength = 0; - int dataStatus = 0; + char *message = nullptr; + size_t messageLength = 0; + int messageStatus = 0; if(argc > 1){ - dataLength = mxGetN(argv[1]) + 1; - data = static_cast(malloc(dataLength)); - dataStatus = mxGetString(argv[1], data, dataLength); + messageLength = mxGetN(argv[1]) + 1; + message = static_cast(malloc(messageLength)); + messageStatus = mxGetString(argv[1], message, messageLength); } - int inputDataLength = (int)(dataLength - 1); - HelicsError err = helicsErrorInitialize(); - helicsEndpointSendBytes(endpoint, (void *)data, inputDataLength, &err); + helicsEndpointSendString(endpoint, static_cast(message), &err); mxArray *_out = nullptr; + if(_out){ --resc; *resv++ = _out; } - free(data); + free(message); if(err.error_code != HELICS_OK){ throwHelicsMatlabError(&err); @@ -11960,28 +12358,247 @@ void _wrap_helicsEndpointSendBytes(int resc, mxArray *resv[], int argc, const mx } -void _wrap_helicsEndpointSendBytesTo(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ +void _wrap_helicsEndpointSendStringTo(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ if(argc != 3){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytesTo:rhs","This function requires 3 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringTo:rhs","This function requires 3 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytesTo:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringTo:TypeError","Argument 1 must be of type uint64."); } HelicsEndpoint endpoint = *(static_cast(mxGetData(argv[0]))); if(!mxIsChar(argv[1])){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytesTo:TypeError","Argument 2 must be a string."); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringTo:TypeError","Argument 2 must be a string."); } - char *data = nullptr; - size_t dataLength = 0; - int dataStatus = 0; + char *message = nullptr; + size_t messageLength = 0; + int messageStatus = 0; if(argc > 1){ - dataLength = mxGetN(argv[1]) + 1; - data = static_cast(malloc(dataLength)); + messageLength = mxGetN(argv[1]) + 1; + message = static_cast(malloc(messageLength)); + messageStatus = mxGetString(argv[1], message, messageLength); + + } + if(!mxIsChar(argv[2])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringTo:TypeError","Argument 3 must be a string."); + } + char *dst = nullptr; + size_t dstLength = 0; + int dstStatus = 0; + if(argc > 2){ + dstLength = mxGetN(argv[2]) + 1; + dst = static_cast(malloc(dstLength)); + dstStatus = mxGetString(argv[2], dst, dstLength); + + } + HelicsError err = helicsErrorInitialize(); + + helicsEndpointSendStringTo(endpoint, static_cast(message), static_cast(dst), &err); + + mxArray *_out = nullptr; + + if(_out){ + --resc; + *resv++ = _out; + } + + free(message); + + free(dst); + + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); + } +} + + +void _wrap_helicsEndpointSendStringToAt(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 4){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringToAt:rhs","This function requires 4 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringToAt:TypeError","Argument 1 must be of type uint64."); + } + HelicsEndpoint endpoint = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringToAt:TypeError","Argument 2 must be a string."); + } + char *message = nullptr; + size_t messageLength = 0; + int messageStatus = 0; + if(argc > 1){ + messageLength = mxGetN(argv[1]) + 1; + message = static_cast(malloc(messageLength)); + messageStatus = mxGetString(argv[1], message, messageLength); + + } + if(!mxIsChar(argv[2])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringToAt:TypeError","Argument 3 must be a string."); + } + char *dst = nullptr; + size_t dstLength = 0; + int dstStatus = 0; + if(argc > 2){ + dstLength = mxGetN(argv[2]) + 1; + dst = static_cast(malloc(dstLength)); + dstStatus = mxGetString(argv[2], dst, dstLength); + + } + if(!mxIsNumeric(argv[3])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringToAt:TypeError","Argument 4 must be of type double."); + } + HelicsTime time = (HelicsTime)(mxGetScalar(argv[3])); + + HelicsError err = helicsErrorInitialize(); + + helicsEndpointSendStringToAt(endpoint, static_cast(message), static_cast(dst), time, &err); + + mxArray *_out = nullptr; + + if(_out){ + --resc; + *resv++ = _out; + } + + free(message); + + free(dst); + + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); + } +} + + +void _wrap_helicsEndpointSendStringAt(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 3){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringAt:rhs","This function requires 3 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringAt:TypeError","Argument 1 must be of type uint64."); + } + HelicsEndpoint endpoint = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringAt:TypeError","Argument 2 must be a string."); + } + char *message = nullptr; + size_t messageLength = 0; + int messageStatus = 0; + if(argc > 1){ + messageLength = mxGetN(argv[1]) + 1; + message = static_cast(malloc(messageLength)); + messageStatus = mxGetString(argv[1], message, messageLength); + + } + if(!mxIsNumeric(argv[2])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendStringAt:TypeError","Argument 3 must be of type double."); + } + HelicsTime time = (HelicsTime)(mxGetScalar(argv[2])); + + HelicsError err = helicsErrorInitialize(); + + helicsEndpointSendStringAt(endpoint, static_cast(message), time, &err); + + mxArray *_out = nullptr; + + if(_out){ + --resc; + *resv++ = _out; + } + + free(message); + + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); + } +} + + +void _wrap_helicsEndpointSendBytes(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 2){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytes:rhs","This function requires 2 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytes:TypeError","Argument 1 must be of type uint64."); + } + HelicsEndpoint endpoint = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytes:TypeError","Argument 2 must be a string."); + } + char *data = nullptr; + size_t dataLength = 0; + int dataStatus = 0; + if(argc > 1){ + dataLength = mxGetN(argv[1]) + 1; + data = static_cast(malloc(dataLength)); + dataStatus = mxGetString(argv[1], data, dataLength); + + } + int inputDataLength = (int)(dataLength - 1); + + HelicsError err = helicsErrorInitialize(); + + helicsEndpointSendBytes(endpoint, (void *)data, inputDataLength, &err); + + mxArray *_out = nullptr; + if(_out){ + --resc; + *resv++ = _out; + } + + free(data); + + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); + } +} + + +void _wrap_helicsEndpointSendBytesTo(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 3){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytesTo:rhs","This function requires 3 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytesTo:TypeError","Argument 1 must be of type uint64."); + } + HelicsEndpoint endpoint = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsEndpointSendBytesTo:TypeError","Argument 2 must be a string."); + } + char *data = nullptr; + size_t dataLength = 0; + int dataStatus = 0; + if(argc > 1){ + dataLength = mxGetN(argv[1]) + 1; + data = static_cast(malloc(dataLength)); dataStatus = mxGetString(argv[1], data, dataLength); } @@ -14644,89 +15261,169 @@ void _wrap_helicsFilterSetString(int resc, mxArray *resv[], int argc, const mxAr } -void _wrap_helicsFilterAddDestinationTarget(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ - if(argc != 2){ +void _wrap_helicsFilterGetPropertyDouble(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc < 1 || argc > 2){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFilterAddDestinationTarget:rhs","This function requires 2 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsFilterGetPropertyDouble:rhs","This function requires at least 1 arguments and at most 2 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFilterAddDestinationTarget:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsFilterGetPropertyDouble:TypeError","Argument 1 must be of type uint64."); } HelicsFilter filt = *(static_cast(mxGetData(argv[0]))); - if(!mxIsChar(argv[1])){ - mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFilterAddDestinationTarget:TypeError","Argument 2 must be a string."); + if(argc > 1){ + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFilterGetPropertyDouble:TypeError","Argument 2 must be a string."); + } } - char *dst = nullptr; - size_t dstLength = 0; - int dstStatus = 0; + char *prop = nullptr; + size_t propLength = 0; + int propStatus = 0; if(argc > 1){ - dstLength = mxGetN(argv[1]) + 1; - dst = static_cast(malloc(dstLength)); - dstStatus = mxGetString(argv[1], dst, dstLength); + propLength = mxGetN(argv[1]) + 1; + prop = static_cast(malloc(propLength)); + propStatus = mxGetString(argv[1], prop, propLength); } - HelicsError err = helicsErrorInitialize(); - - helicsFilterAddDestinationTarget(filt, static_cast(dst), &err); + double result = helicsFilterGetPropertyDouble(filt, static_cast(prop)); - mxArray *_out = nullptr; + mxArray *_out = mxCreateDoubleScalar(result); if(_out){ --resc; *resv++ = _out; } - free(dst); - - if(err.error_code != HELICS_OK){ - throwHelicsMatlabError(&err); - } + free(prop); } -void _wrap_helicsFilterAddSourceTarget(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ - if(argc != 2){ +void _wrap_helicsFilterGetPropertyString(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc < 1 || argc > 2){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFilterAddSourceTarget:rhs","This function requires 2 arguments."); + mexErrMsgIdAndTxt("MATLAB:helicsFilterGetPropertyString:rhs","This function requires at least 1 arguments and at most 2 arguments."); } if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFilterAddSourceTarget:TypeError","Argument 1 must be of type uint64."); + mexErrMsgIdAndTxt("MATLAB:helicsFilterGetPropertyString:TypeError","Argument 1 must be of type uint64."); } HelicsFilter filt = *(static_cast(mxGetData(argv[0]))); - if(!mxIsChar(argv[1])){ - mexUnlock(); - mexErrMsgIdAndTxt("MATLAB:helicsFilterAddSourceTarget:TypeError","Argument 2 must be a string."); + if(argc > 1){ + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFilterGetPropertyString:TypeError","Argument 2 must be a string."); + } } - char *source = nullptr; - size_t sourceLength = 0; - int sourceStatus = 0; + char *prop = nullptr; + size_t propLength = 0; + int propStatus = 0; if(argc > 1){ - sourceLength = mxGetN(argv[1]) + 1; - source = static_cast(malloc(sourceLength)); - sourceStatus = mxGetString(argv[1], source, sourceLength); + propLength = mxGetN(argv[1]) + 1; + prop = static_cast(malloc(propLength)); + propStatus = mxGetString(argv[1], prop, propLength); } - HelicsError err = helicsErrorInitialize(); + const char *result = helicsFilterGetPropertyString(filt, static_cast(prop)); - helicsFilterAddSourceTarget(filt, static_cast(source), &err); - - mxArray *_out = nullptr; + mxArray *_out = mxCreateString(result); if(_out){ --resc; *resv++ = _out; } - free(source); + free(prop); +} - if(err.error_code != HELICS_OK){ + +void _wrap_helicsFilterAddDestinationTarget(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 2){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFilterAddDestinationTarget:rhs","This function requires 2 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFilterAddDestinationTarget:TypeError","Argument 1 must be of type uint64."); + } + HelicsFilter filt = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFilterAddDestinationTarget:TypeError","Argument 2 must be a string."); + } + char *dst = nullptr; + size_t dstLength = 0; + int dstStatus = 0; + if(argc > 1){ + dstLength = mxGetN(argv[1]) + 1; + dst = static_cast(malloc(dstLength)); + dstStatus = mxGetString(argv[1], dst, dstLength); + + } + HelicsError err = helicsErrorInitialize(); + + helicsFilterAddDestinationTarget(filt, static_cast(dst), &err); + + mxArray *_out = nullptr; + + if(_out){ + --resc; + *resv++ = _out; + } + + free(dst); + + if(err.error_code != HELICS_OK){ + throwHelicsMatlabError(&err); + } +} + + +void _wrap_helicsFilterAddSourceTarget(int resc, mxArray *resv[], int argc, const mxArray *argv[]){ + if(argc != 2){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFilterAddSourceTarget:rhs","This function requires 2 arguments."); + } + + if(mxGetClassID(argv[0]) != mxUINT64_CLASS){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFilterAddSourceTarget:TypeError","Argument 1 must be of type uint64."); + } + HelicsFilter filt = *(static_cast(mxGetData(argv[0]))); + + if(!mxIsChar(argv[1])){ + mexUnlock(); + mexErrMsgIdAndTxt("MATLAB:helicsFilterAddSourceTarget:TypeError","Argument 2 must be a string."); + } + char *source = nullptr; + size_t sourceLength = 0; + int sourceStatus = 0; + if(argc > 1){ + sourceLength = mxGetN(argv[1]) + 1; + source = static_cast(malloc(sourceLength)); + sourceStatus = mxGetString(argv[1], source, sourceLength); + + } + HelicsError err = helicsErrorInitialize(); + + helicsFilterAddSourceTarget(filt, static_cast(source), &err); + + mxArray *_out = nullptr; + + if(_out){ + --resc; + *resv++ = _out; + } + + free(source); + + if(err.error_code != HELICS_OK){ throwHelicsMatlabError(&err); } } @@ -16839,1282 +17536,1336 @@ void mexFunction(int resc, mxArray *resv[], int argc, const mxArray *argv[]) { mexLock(); } switch (functionId) { - case 65: + case 4: + _wrap_HELICS_INVALID_DOUBLE(resc, resv, argc, argv); + break; + case 67: _wrap_helicsCreateDataBuffer(resc, resv, argc, argv); break; - case 66: + case 68: _wrap_helicsDataBufferIsValid(resc, resv, argc, argv); break; - case 67: + case 69: _wrap_helicsWrapDataInBuffer(resc, resv, argc, argv); break; - case 68: + case 70: _wrap_helicsDataBufferFree(resc, resv, argc, argv); break; - case 69: + case 71: _wrap_helicsDataBufferSize(resc, resv, argc, argv); break; - case 70: + case 72: _wrap_helicsDataBufferCapacity(resc, resv, argc, argv); break; - case 71: + case 73: _wrap_helicsDataBufferData(resc, resv, argc, argv); break; - case 72: + case 74: _wrap_helicsDataBufferReserve(resc, resv, argc, argv); break; - case 73: + case 75: _wrap_helicsDataBufferClone(resc, resv, argc, argv); break; - case 74: + case 76: _wrap_helicsDataBufferFillFromInteger(resc, resv, argc, argv); break; - case 75: + case 77: _wrap_helicsDataBufferFillFromDouble(resc, resv, argc, argv); break; - case 76: + case 78: _wrap_helicsDataBufferFillFromString(resc, resv, argc, argv); break; - case 77: + case 79: _wrap_helicsDataBufferFillFromRawString(resc, resv, argc, argv); break; - case 78: + case 80: _wrap_helicsDataBufferFillFromBoolean(resc, resv, argc, argv); break; - case 79: + case 81: _wrap_helicsDataBufferFillFromChar(resc, resv, argc, argv); break; - case 80: + case 82: _wrap_helicsDataBufferFillFromTime(resc, resv, argc, argv); break; - case 81: + case 83: _wrap_helicsDataBufferFillFromComplex(resc, resv, argc, argv); break; - case 83: + case 85: _wrap_helicsDataBufferFillFromVector(resc, resv, argc, argv); break; - case 84: + case 86: _wrap_helicsDataBufferFillFromNamedPoint(resc, resv, argc, argv); break; - case 85: + case 87: _wrap_helicsDataBufferFillFromComplexVector(resc, resv, argc, argv); break; - case 86: + case 88: _wrap_helicsDataBufferType(resc, resv, argc, argv); break; - case 87: + case 89: _wrap_helicsDataBufferToInteger(resc, resv, argc, argv); break; - case 88: + case 90: _wrap_helicsDataBufferToDouble(resc, resv, argc, argv); break; - case 89: + case 91: _wrap_helicsDataBufferToBoolean(resc, resv, argc, argv); break; - case 90: + case 92: _wrap_helicsDataBufferToChar(resc, resv, argc, argv); break; - case 91: + case 93: _wrap_helicsDataBufferStringSize(resc, resv, argc, argv); break; - case 92: + case 94: _wrap_helicsDataBufferToString(resc, resv, argc, argv); break; - case 93: + case 95: _wrap_helicsDataBufferToRawString(resc, resv, argc, argv); break; - case 94: + case 96: _wrap_helicsDataBufferToTime(resc, resv, argc, argv); break; - case 95: + case 97: _wrap_helicsDataBufferToComplexObject(resc, resv, argc, argv); break; - case 96: + case 98: _wrap_helicsDataBufferToComplex(resc, resv, argc, argv); break; - case 97: + case 99: _wrap_helicsDataBufferVectorSize(resc, resv, argc, argv); break; - case 98: + case 100: _wrap_helicsDataBufferToVector(resc, resv, argc, argv); break; - case 99: + case 101: _wrap_helicsDataBufferToComplexVector(resc, resv, argc, argv); break; - case 100: + case 102: _wrap_helicsDataBufferToNamedPoint(resc, resv, argc, argv); break; - case 101: + case 103: _wrap_helicsDataBufferConvertToType(resc, resv, argc, argv); break; - case 102: + case 104: _wrap_helicsGetVersion(resc, resv, argc, argv); break; - case 103: + case 105: _wrap_helicsGetBuildFlags(resc, resv, argc, argv); break; - case 104: + case 106: _wrap_helicsGetCompilerVersion(resc, resv, argc, argv); break; - case 105: + case 107: _wrap_helicsGetSystemInfo(resc, resv, argc, argv); break; - case 108: + case 110: _wrap_helicsLoadSignalHandler(resc, resv, argc, argv); break; - case 109: + case 111: _wrap_helicsLoadThreadedSignalHandler(resc, resv, argc, argv); break; - case 110: + case 112: _wrap_helicsClearSignalHandler(resc, resv, argc, argv); break; - case 113: + case 115: _wrap_helicsAbort(resc, resv, argc, argv); break; - case 114: + case 116: _wrap_helicsIsCoreTypeAvailable(resc, resv, argc, argv); break; - case 115: + case 117: _wrap_helicsCreateCore(resc, resv, argc, argv); break; - case 116: + case 118: _wrap_helicsCreateCoreFromArgs(resc, resv, argc, argv); break; - case 117: + case 119: _wrap_helicsCoreClone(resc, resv, argc, argv); break; - case 118: + case 120: _wrap_helicsCoreIsValid(resc, resv, argc, argv); break; - case 119: + case 121: _wrap_helicsCreateBroker(resc, resv, argc, argv); break; - case 120: + case 122: _wrap_helicsCreateBrokerFromArgs(resc, resv, argc, argv); break; - case 121: + case 123: _wrap_helicsBrokerClone(resc, resv, argc, argv); break; - case 122: + case 124: _wrap_helicsBrokerIsValid(resc, resv, argc, argv); break; - case 123: + case 125: _wrap_helicsBrokerIsConnected(resc, resv, argc, argv); break; - case 124: + case 126: _wrap_helicsBrokerDataLink(resc, resv, argc, argv); break; - case 125: + case 127: _wrap_helicsBrokerAddSourceFilterToEndpoint(resc, resv, argc, argv); break; - case 126: + case 128: _wrap_helicsBrokerAddDestinationFilterToEndpoint(resc, resv, argc, argv); break; - case 127: + case 129: _wrap_helicsBrokerMakeConnections(resc, resv, argc, argv); break; - case 128: + case 130: _wrap_helicsCoreWaitForDisconnect(resc, resv, argc, argv); break; - case 129: + case 131: _wrap_helicsBrokerWaitForDisconnect(resc, resv, argc, argv); break; - case 130: + case 132: _wrap_helicsCoreIsConnected(resc, resv, argc, argv); break; - case 131: + case 133: _wrap_helicsCoreDataLink(resc, resv, argc, argv); break; - case 132: + case 134: _wrap_helicsCoreAddSourceFilterToEndpoint(resc, resv, argc, argv); break; - case 133: + case 135: _wrap_helicsCoreAddDestinationFilterToEndpoint(resc, resv, argc, argv); break; - case 134: + case 136: _wrap_helicsCoreMakeConnections(resc, resv, argc, argv); break; - case 135: + case 137: _wrap_helicsBrokerGetIdentifier(resc, resv, argc, argv); break; - case 136: + case 138: _wrap_helicsCoreGetIdentifier(resc, resv, argc, argv); break; - case 137: + case 139: _wrap_helicsBrokerGetAddress(resc, resv, argc, argv); break; - case 138: + case 140: _wrap_helicsCoreGetAddress(resc, resv, argc, argv); break; - case 139: + case 141: _wrap_helicsCoreSetReadyToInit(resc, resv, argc, argv); break; - case 140: + case 142: _wrap_helicsCoreConnect(resc, resv, argc, argv); break; - case 141: + case 143: _wrap_helicsCoreDisconnect(resc, resv, argc, argv); break; - case 142: + case 144: _wrap_helicsGetFederateByName(resc, resv, argc, argv); break; - case 143: + case 145: _wrap_helicsBrokerDisconnect(resc, resv, argc, argv); break; - case 144: + case 146: _wrap_helicsFederateDestroy(resc, resv, argc, argv); break; - case 145: + case 147: _wrap_helicsBrokerDestroy(resc, resv, argc, argv); break; - case 146: + case 148: _wrap_helicsCoreDestroy(resc, resv, argc, argv); break; - case 147: + case 149: _wrap_helicsCoreFree(resc, resv, argc, argv); break; - case 148: + case 150: _wrap_helicsBrokerFree(resc, resv, argc, argv); break; - case 149: + case 151: _wrap_helicsCreateValueFederate(resc, resv, argc, argv); break; - case 150: + case 152: _wrap_helicsCreateValueFederateFromConfig(resc, resv, argc, argv); break; - case 151: + case 153: _wrap_helicsCreateMessageFederate(resc, resv, argc, argv); break; - case 152: + case 154: _wrap_helicsCreateMessageFederateFromConfig(resc, resv, argc, argv); break; - case 153: + case 155: _wrap_helicsCreateCombinationFederate(resc, resv, argc, argv); break; - case 154: + case 156: _wrap_helicsCreateCombinationFederateFromConfig(resc, resv, argc, argv); break; - case 155: + case 157: _wrap_helicsCreateCallbackFederate(resc, resv, argc, argv); break; - case 156: + case 158: _wrap_helicsCreateCallbackFederateFromConfig(resc, resv, argc, argv); break; - case 157: + case 159: _wrap_helicsFederateClone(resc, resv, argc, argv); break; - case 158: + case 160: _wrap_helicsFederateProtect(resc, resv, argc, argv); break; - case 159: + case 161: _wrap_helicsFederateUnProtect(resc, resv, argc, argv); break; - case 160: + case 162: _wrap_helicsFederateIsProtected(resc, resv, argc, argv); break; - case 161: - _wrap_helicsCreateFederateInfo(resc, resv, argc, argv); - break; - case 162: - _wrap_helicsFederateInfoClone(resc, resv, argc, argv); - break; case 163: - _wrap_helicsFederateInfoLoadFromArgs(resc, resv, argc, argv); + _wrap_helicsCreateFederateInfo(resc, resv, argc, argv); break; case 164: - _wrap_helicsFederateInfoLoadFromString(resc, resv, argc, argv); + _wrap_helicsFederateInfoClone(resc, resv, argc, argv); break; case 165: - _wrap_helicsFederateInfoFree(resc, resv, argc, argv); + _wrap_helicsFederateInfoLoadFromArgs(resc, resv, argc, argv); break; case 166: - _wrap_helicsFederateIsValid(resc, resv, argc, argv); + _wrap_helicsFederateInfoLoadFromString(resc, resv, argc, argv); break; case 167: - _wrap_helicsFederateInfoSetCoreName(resc, resv, argc, argv); + _wrap_helicsFederateInfoFree(resc, resv, argc, argv); break; case 168: - _wrap_helicsFederateInfoSetCoreInitString(resc, resv, argc, argv); + _wrap_helicsFederateIsValid(resc, resv, argc, argv); break; case 169: - _wrap_helicsFederateInfoSetBrokerInitString(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetCoreName(resc, resv, argc, argv); break; case 170: - _wrap_helicsFederateInfoSetCoreType(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetCoreInitString(resc, resv, argc, argv); break; case 171: - _wrap_helicsFederateInfoSetCoreTypeFromString(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetBrokerInitString(resc, resv, argc, argv); break; case 172: - _wrap_helicsFederateInfoSetBroker(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetCoreType(resc, resv, argc, argv); break; case 173: - _wrap_helicsFederateInfoSetBrokerKey(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetCoreTypeFromString(resc, resv, argc, argv); break; case 174: - _wrap_helicsFederateInfoSetBrokerPort(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetBroker(resc, resv, argc, argv); break; case 175: - _wrap_helicsFederateInfoSetLocalPort(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetBrokerKey(resc, resv, argc, argv); break; case 176: - _wrap_helicsGetPropertyIndex(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetBrokerPort(resc, resv, argc, argv); break; case 177: - _wrap_helicsGetFlagIndex(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetLocalPort(resc, resv, argc, argv); break; case 178: - _wrap_helicsGetOptionIndex(resc, resv, argc, argv); + _wrap_helicsGetPropertyIndex(resc, resv, argc, argv); break; case 179: - _wrap_helicsGetOptionValue(resc, resv, argc, argv); + _wrap_helicsGetFlagIndex(resc, resv, argc, argv); break; case 180: - _wrap_helicsGetDataType(resc, resv, argc, argv); + _wrap_helicsGetOptionIndex(resc, resv, argc, argv); break; case 181: - _wrap_helicsFederateInfoSetFlagOption(resc, resv, argc, argv); + _wrap_helicsGetOptionValue(resc, resv, argc, argv); break; case 182: - _wrap_helicsFederateInfoSetSeparator(resc, resv, argc, argv); + _wrap_helicsGetDataType(resc, resv, argc, argv); break; case 183: - _wrap_helicsFederateInfoSetTimeProperty(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetFlagOption(resc, resv, argc, argv); break; case 184: - _wrap_helicsFederateInfoSetIntegerProperty(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetSeparator(resc, resv, argc, argv); break; case 185: - _wrap_helicsFederateRegisterInterfaces(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetTimeProperty(resc, resv, argc, argv); break; case 186: - _wrap_helicsFederateGlobalError(resc, resv, argc, argv); + _wrap_helicsFederateInfoSetIntegerProperty(resc, resv, argc, argv); break; case 187: - _wrap_helicsFederateLocalError(resc, resv, argc, argv); + _wrap_helicsFederateRegisterInterfaces(resc, resv, argc, argv); break; case 188: - _wrap_helicsFederateFinalize(resc, resv, argc, argv); + _wrap_helicsFederateGlobalError(resc, resv, argc, argv); break; case 189: - _wrap_helicsFederateFinalizeAsync(resc, resv, argc, argv); + _wrap_helicsFederateLocalError(resc, resv, argc, argv); break; case 190: - _wrap_helicsFederateFinalizeComplete(resc, resv, argc, argv); + _wrap_helicsFederateFinalize(resc, resv, argc, argv); break; case 191: - _wrap_helicsFederateDisconnect(resc, resv, argc, argv); + _wrap_helicsFederateFinalizeAsync(resc, resv, argc, argv); break; case 192: - _wrap_helicsFederateDisconnectAsync(resc, resv, argc, argv); + _wrap_helicsFederateFinalizeComplete(resc, resv, argc, argv); break; case 193: - _wrap_helicsFederateDisconnectComplete(resc, resv, argc, argv); + _wrap_helicsFederateDisconnect(resc, resv, argc, argv); break; case 194: - _wrap_helicsFederateFree(resc, resv, argc, argv); + _wrap_helicsFederateDisconnectAsync(resc, resv, argc, argv); break; case 195: - _wrap_helicsCloseLibrary(resc, resv, argc, argv); + _wrap_helicsFederateDisconnectComplete(resc, resv, argc, argv); break; case 196: - _wrap_helicsFederateEnterInitializingMode(resc, resv, argc, argv); + _wrap_helicsFederateFree(resc, resv, argc, argv); break; case 197: - _wrap_helicsFederateEnterInitializingModeAsync(resc, resv, argc, argv); + _wrap_helicsCloseLibrary(resc, resv, argc, argv); break; case 198: - _wrap_helicsFederateEnterInitializingModeComplete(resc, resv, argc, argv); + _wrap_helicsFederateEnterInitializingMode(resc, resv, argc, argv); break; case 199: - _wrap_helicsFederateEnterInitializingModeIterative(resc, resv, argc, argv); + _wrap_helicsFederateEnterInitializingModeAsync(resc, resv, argc, argv); break; case 200: - _wrap_helicsFederateEnterInitializingModeIterativeAsync(resc, resv, argc, argv); + _wrap_helicsFederateEnterInitializingModeComplete(resc, resv, argc, argv); break; case 201: - _wrap_helicsFederateEnterInitializingModeIterativeComplete(resc, resv, argc, argv); + _wrap_helicsFederateEnterInitializingModeIterative(resc, resv, argc, argv); break; case 202: - _wrap_helicsFederateIsAsyncOperationCompleted(resc, resv, argc, argv); + _wrap_helicsFederateEnterInitializingModeIterativeAsync(resc, resv, argc, argv); break; case 203: - _wrap_helicsFederateEnterExecutingMode(resc, resv, argc, argv); + _wrap_helicsFederateEnterInitializingModeIterativeComplete(resc, resv, argc, argv); break; case 204: - _wrap_helicsFederateEnterExecutingModeAsync(resc, resv, argc, argv); + _wrap_helicsFederateIsAsyncOperationCompleted(resc, resv, argc, argv); break; case 205: - _wrap_helicsFederateEnterExecutingModeComplete(resc, resv, argc, argv); + _wrap_helicsFederateEnterExecutingMode(resc, resv, argc, argv); break; case 206: - _wrap_helicsFederateEnterExecutingModeIterative(resc, resv, argc, argv); + _wrap_helicsFederateEnterExecutingModeAsync(resc, resv, argc, argv); break; case 207: - _wrap_helicsFederateEnterExecutingModeIterativeAsync(resc, resv, argc, argv); + _wrap_helicsFederateEnterExecutingModeComplete(resc, resv, argc, argv); break; case 208: - _wrap_helicsFederateEnterExecutingModeIterativeComplete(resc, resv, argc, argv); + _wrap_helicsFederateEnterExecutingModeIterative(resc, resv, argc, argv); break; case 209: - _wrap_helicsFederateGetState(resc, resv, argc, argv); + _wrap_helicsFederateEnterExecutingModeIterativeAsync(resc, resv, argc, argv); break; case 210: - _wrap_helicsFederateGetCore(resc, resv, argc, argv); + _wrap_helicsFederateEnterExecutingModeIterativeComplete(resc, resv, argc, argv); break; case 211: - _wrap_helicsFederateRequestTime(resc, resv, argc, argv); + _wrap_helicsFederateGetState(resc, resv, argc, argv); break; case 212: - _wrap_helicsFederateRequestTimeAdvance(resc, resv, argc, argv); + _wrap_helicsFederateGetCore(resc, resv, argc, argv); break; case 213: - _wrap_helicsFederateRequestNextStep(resc, resv, argc, argv); + _wrap_helicsFederateRequestTime(resc, resv, argc, argv); break; case 214: - _wrap_helicsFederateRequestTimeIterative(resc, resv, argc, argv); + _wrap_helicsFederateRequestTimeAdvance(resc, resv, argc, argv); break; case 215: - _wrap_helicsFederateRequestTimeAsync(resc, resv, argc, argv); + _wrap_helicsFederateRequestNextStep(resc, resv, argc, argv); break; case 216: - _wrap_helicsFederateRequestTimeComplete(resc, resv, argc, argv); + _wrap_helicsFederateRequestTimeIterative(resc, resv, argc, argv); break; case 217: - _wrap_helicsFederateRequestTimeIterativeAsync(resc, resv, argc, argv); + _wrap_helicsFederateRequestTimeAsync(resc, resv, argc, argv); break; case 218: - _wrap_helicsFederateRequestTimeIterativeComplete(resc, resv, argc, argv); + _wrap_helicsFederateRequestTimeComplete(resc, resv, argc, argv); break; case 219: - _wrap_helicsFederateProcessCommunications(resc, resv, argc, argv); + _wrap_helicsFederateRequestTimeIterativeAsync(resc, resv, argc, argv); break; case 220: - _wrap_helicsFederateGetName(resc, resv, argc, argv); + _wrap_helicsFederateRequestTimeIterativeComplete(resc, resv, argc, argv); break; case 221: - _wrap_helicsFederateSetTimeProperty(resc, resv, argc, argv); + _wrap_helicsFederateProcessCommunications(resc, resv, argc, argv); break; case 222: - _wrap_helicsFederateSetFlagOption(resc, resv, argc, argv); + _wrap_helicsFederateGetName(resc, resv, argc, argv); break; case 223: - _wrap_helicsFederateSetSeparator(resc, resv, argc, argv); + _wrap_helicsFederateSetTimeProperty(resc, resv, argc, argv); break; case 224: - _wrap_helicsFederateSetIntegerProperty(resc, resv, argc, argv); + _wrap_helicsFederateSetFlagOption(resc, resv, argc, argv); break; case 225: - _wrap_helicsFederateGetTimeProperty(resc, resv, argc, argv); + _wrap_helicsFederateSetSeparator(resc, resv, argc, argv); break; case 226: - _wrap_helicsFederateGetFlagOption(resc, resv, argc, argv); + _wrap_helicsFederateSetIntegerProperty(resc, resv, argc, argv); break; case 227: - _wrap_helicsFederateGetIntegerProperty(resc, resv, argc, argv); + _wrap_helicsFederateGetTimeProperty(resc, resv, argc, argv); break; case 228: - _wrap_helicsFederateGetCurrentTime(resc, resv, argc, argv); + _wrap_helicsFederateGetFlagOption(resc, resv, argc, argv); break; case 229: - _wrap_helicsFederateAddAlias(resc, resv, argc, argv); + _wrap_helicsFederateGetIntegerProperty(resc, resv, argc, argv); break; case 230: - _wrap_helicsFederateSetGlobal(resc, resv, argc, argv); + _wrap_helicsFederateGetCurrentTime(resc, resv, argc, argv); break; case 231: - _wrap_helicsFederateSetTag(resc, resv, argc, argv); + _wrap_helicsFederateAddAlias(resc, resv, argc, argv); break; case 232: - _wrap_helicsFederateGetTag(resc, resv, argc, argv); + _wrap_helicsFederateSetGlobal(resc, resv, argc, argv); break; case 233: - _wrap_helicsFederateAddDependency(resc, resv, argc, argv); + _wrap_helicsFederateSetTag(resc, resv, argc, argv); break; case 234: - _wrap_helicsFederateSetLogFile(resc, resv, argc, argv); + _wrap_helicsFederateGetTag(resc, resv, argc, argv); break; case 235: - _wrap_helicsFederateLogErrorMessage(resc, resv, argc, argv); + _wrap_helicsFederateAddDependency(resc, resv, argc, argv); break; case 236: - _wrap_helicsFederateLogWarningMessage(resc, resv, argc, argv); + _wrap_helicsFederateSetLogFile(resc, resv, argc, argv); break; case 237: - _wrap_helicsFederateLogInfoMessage(resc, resv, argc, argv); + _wrap_helicsFederateLogErrorMessage(resc, resv, argc, argv); break; case 238: - _wrap_helicsFederateLogDebugMessage(resc, resv, argc, argv); + _wrap_helicsFederateLogWarningMessage(resc, resv, argc, argv); break; case 239: - _wrap_helicsFederateLogLevelMessage(resc, resv, argc, argv); + _wrap_helicsFederateLogInfoMessage(resc, resv, argc, argv); break; case 240: - _wrap_helicsFederateSendCommand(resc, resv, argc, argv); + _wrap_helicsFederateLogDebugMessage(resc, resv, argc, argv); break; case 241: - _wrap_helicsFederateGetCommand(resc, resv, argc, argv); + _wrap_helicsFederateLogLevelMessage(resc, resv, argc, argv); break; case 242: - _wrap_helicsFederateGetCommandSource(resc, resv, argc, argv); + _wrap_helicsFederateSendCommand(resc, resv, argc, argv); break; case 243: - _wrap_helicsFederateWaitCommand(resc, resv, argc, argv); + _wrap_helicsFederateGetCommand(resc, resv, argc, argv); break; case 244: - _wrap_helicsCoreSetGlobal(resc, resv, argc, argv); + _wrap_helicsFederateGetCommandSource(resc, resv, argc, argv); break; case 245: - _wrap_helicsBrokerSetGlobal(resc, resv, argc, argv); + _wrap_helicsFederateWaitCommand(resc, resv, argc, argv); break; case 246: - _wrap_helicsCoreAddAlias(resc, resv, argc, argv); + _wrap_helicsCoreSetGlobal(resc, resv, argc, argv); break; case 247: - _wrap_helicsBrokerAddAlias(resc, resv, argc, argv); + _wrap_helicsBrokerSetGlobal(resc, resv, argc, argv); break; case 248: - _wrap_helicsCoreSendCommand(resc, resv, argc, argv); + _wrap_helicsCoreAddAlias(resc, resv, argc, argv); break; case 249: - _wrap_helicsCoreSendOrderedCommand(resc, resv, argc, argv); + _wrap_helicsBrokerAddAlias(resc, resv, argc, argv); break; case 250: - _wrap_helicsBrokerSendCommand(resc, resv, argc, argv); + _wrap_helicsCoreSendCommand(resc, resv, argc, argv); break; case 251: - _wrap_helicsBrokerSendOrderedCommand(resc, resv, argc, argv); + _wrap_helicsCoreSendOrderedCommand(resc, resv, argc, argv); break; case 252: - _wrap_helicsCoreSetLogFile(resc, resv, argc, argv); + _wrap_helicsBrokerSendCommand(resc, resv, argc, argv); break; case 253: - _wrap_helicsBrokerSetLogFile(resc, resv, argc, argv); + _wrap_helicsBrokerSendOrderedCommand(resc, resv, argc, argv); break; case 254: - _wrap_helicsBrokerSetTimeBarrier(resc, resv, argc, argv); + _wrap_helicsCoreSetLogFile(resc, resv, argc, argv); break; case 255: - _wrap_helicsBrokerClearTimeBarrier(resc, resv, argc, argv); + _wrap_helicsBrokerSetLogFile(resc, resv, argc, argv); break; case 256: - _wrap_helicsBrokerGlobalError(resc, resv, argc, argv); + _wrap_helicsBrokerSetTimeBarrier(resc, resv, argc, argv); break; case 257: - _wrap_helicsCoreGlobalError(resc, resv, argc, argv); + _wrap_helicsBrokerClearTimeBarrier(resc, resv, argc, argv); break; case 258: - _wrap_helicsCreateQuery(resc, resv, argc, argv); + _wrap_helicsBrokerGlobalError(resc, resv, argc, argv); break; case 259: - _wrap_helicsQueryExecute(resc, resv, argc, argv); + _wrap_helicsCoreGlobalError(resc, resv, argc, argv); break; case 260: - _wrap_helicsQueryCoreExecute(resc, resv, argc, argv); + _wrap_helicsCreateQuery(resc, resv, argc, argv); break; case 261: - _wrap_helicsQueryBrokerExecute(resc, resv, argc, argv); + _wrap_helicsQueryExecute(resc, resv, argc, argv); break; case 262: - _wrap_helicsQueryExecuteAsync(resc, resv, argc, argv); + _wrap_helicsQueryCoreExecute(resc, resv, argc, argv); break; case 263: - _wrap_helicsQueryExecuteComplete(resc, resv, argc, argv); + _wrap_helicsQueryBrokerExecute(resc, resv, argc, argv); break; case 264: - _wrap_helicsQueryIsCompleted(resc, resv, argc, argv); + _wrap_helicsQueryExecuteAsync(resc, resv, argc, argv); break; case 265: - _wrap_helicsQuerySetTarget(resc, resv, argc, argv); + _wrap_helicsQueryExecuteComplete(resc, resv, argc, argv); break; case 266: - _wrap_helicsQuerySetQueryString(resc, resv, argc, argv); + _wrap_helicsQueryIsCompleted(resc, resv, argc, argv); break; case 267: - _wrap_helicsQuerySetOrdering(resc, resv, argc, argv); + _wrap_helicsQuerySetTarget(resc, resv, argc, argv); break; case 268: - _wrap_helicsQueryFree(resc, resv, argc, argv); + _wrap_helicsQuerySetQueryString(resc, resv, argc, argv); break; case 269: - _wrap_helicsCleanupLibrary(resc, resv, argc, argv); + _wrap_helicsQuerySetOrdering(resc, resv, argc, argv); break; case 270: - _wrap_helicsFederateRegisterSubscription(resc, resv, argc, argv); + _wrap_helicsQueryFree(resc, resv, argc, argv); break; case 271: - _wrap_helicsFederateRegisterPublication(resc, resv, argc, argv); + _wrap_helicsCleanupLibrary(resc, resv, argc, argv); break; case 272: - _wrap_helicsFederateRegisterTypePublication(resc, resv, argc, argv); + _wrap_helicsAppEnabled(resc, resv, argc, argv); break; case 273: - _wrap_helicsFederateRegisterGlobalPublication(resc, resv, argc, argv); + _wrap_helicsCreateApp(resc, resv, argc, argv); break; case 274: - _wrap_helicsFederateRegisterGlobalTypePublication(resc, resv, argc, argv); + _wrap_helicsAppGetFederate(resc, resv, argc, argv); break; case 275: - _wrap_helicsFederateRegisterInput(resc, resv, argc, argv); + _wrap_helicsAppLoadFile(resc, resv, argc, argv); break; case 276: - _wrap_helicsFederateRegisterTypeInput(resc, resv, argc, argv); + _wrap_helicsAppInitialize(resc, resv, argc, argv); break; case 277: - _wrap_helicsFederateRegisterGlobalInput(resc, resv, argc, argv); + _wrap_helicsAppRun(resc, resv, argc, argv); break; case 278: - _wrap_helicsFederateRegisterGlobalTypeInput(resc, resv, argc, argv); + _wrap_helicsAppRunTo(resc, resv, argc, argv); break; case 279: - _wrap_helicsFederateGetPublication(resc, resv, argc, argv); + _wrap_helicsAppFinalize(resc, resv, argc, argv); break; case 280: - _wrap_helicsFederateGetPublicationByIndex(resc, resv, argc, argv); + _wrap_helicsAppFree(resc, resv, argc, argv); break; case 281: - _wrap_helicsFederateGetInput(resc, resv, argc, argv); + _wrap_helicsAppDestroy(resc, resv, argc, argv); break; case 282: - _wrap_helicsFederateGetInputByIndex(resc, resv, argc, argv); + _wrap_helicsAppIsActive(resc, resv, argc, argv); break; case 283: - _wrap_helicsFederateGetSubscription(resc, resv, argc, argv); + _wrap_helicsFederateRegisterSubscription(resc, resv, argc, argv); break; case 284: - _wrap_helicsFederateGetInputByTarget(resc, resv, argc, argv); + _wrap_helicsFederateRegisterPublication(resc, resv, argc, argv); break; case 285: - _wrap_helicsFederateClearUpdates(resc, resv, argc, argv); + _wrap_helicsFederateRegisterTypePublication(resc, resv, argc, argv); break; case 286: - _wrap_helicsFederateRegisterFromPublicationJSON(resc, resv, argc, argv); + _wrap_helicsFederateRegisterGlobalPublication(resc, resv, argc, argv); break; case 287: - _wrap_helicsFederatePublishJSON(resc, resv, argc, argv); + _wrap_helicsFederateRegisterGlobalTypePublication(resc, resv, argc, argv); break; case 288: - _wrap_helicsPublicationIsValid(resc, resv, argc, argv); + _wrap_helicsFederateRegisterInput(resc, resv, argc, argv); break; case 289: - _wrap_helicsPublicationPublishBytes(resc, resv, argc, argv); + _wrap_helicsFederateRegisterTypeInput(resc, resv, argc, argv); break; case 290: - _wrap_helicsPublicationPublishString(resc, resv, argc, argv); + _wrap_helicsFederateRegisterGlobalInput(resc, resv, argc, argv); break; case 291: - _wrap_helicsPublicationPublishInteger(resc, resv, argc, argv); + _wrap_helicsFederateRegisterGlobalTypeInput(resc, resv, argc, argv); break; case 292: - _wrap_helicsPublicationPublishBoolean(resc, resv, argc, argv); + _wrap_helicsFederateGetPublication(resc, resv, argc, argv); break; case 293: - _wrap_helicsPublicationPublishDouble(resc, resv, argc, argv); + _wrap_helicsFederateGetPublicationByIndex(resc, resv, argc, argv); break; case 294: - _wrap_helicsPublicationPublishTime(resc, resv, argc, argv); + _wrap_helicsFederateGetInput(resc, resv, argc, argv); break; case 295: - _wrap_helicsPublicationPublishChar(resc, resv, argc, argv); + _wrap_helicsFederateGetInputByIndex(resc, resv, argc, argv); break; case 296: - _wrap_helicsPublicationPublishComplex(resc, resv, argc, argv); + _wrap_helicsFederateGetSubscription(resc, resv, argc, argv); break; case 297: - _wrap_helicsPublicationPublishVector(resc, resv, argc, argv); + _wrap_helicsFederateGetInputByTarget(resc, resv, argc, argv); break; case 298: - _wrap_helicsPublicationPublishComplexVector(resc, resv, argc, argv); + _wrap_helicsFederateClearUpdates(resc, resv, argc, argv); break; case 299: - _wrap_helicsPublicationPublishNamedPoint(resc, resv, argc, argv); + _wrap_helicsFederateRegisterFromPublicationJSON(resc, resv, argc, argv); break; case 300: - _wrap_helicsPublicationPublishDataBuffer(resc, resv, argc, argv); + _wrap_helicsFederatePublishJSON(resc, resv, argc, argv); break; case 301: - _wrap_helicsPublicationAddTarget(resc, resv, argc, argv); + _wrap_helicsPublicationIsValid(resc, resv, argc, argv); break; case 302: - _wrap_helicsInputIsValid(resc, resv, argc, argv); + _wrap_helicsPublicationPublishBytes(resc, resv, argc, argv); break; case 303: - _wrap_helicsInputAddTarget(resc, resv, argc, argv); + _wrap_helicsPublicationPublishString(resc, resv, argc, argv); break; case 304: - _wrap_helicsInputGetByteCount(resc, resv, argc, argv); + _wrap_helicsPublicationPublishInteger(resc, resv, argc, argv); break; case 305: - _wrap_helicsInputGetBytes(resc, resv, argc, argv); + _wrap_helicsPublicationPublishBoolean(resc, resv, argc, argv); break; case 306: - _wrap_helicsInputGetDataBuffer(resc, resv, argc, argv); + _wrap_helicsPublicationPublishDouble(resc, resv, argc, argv); break; case 307: - _wrap_helicsInputGetStringSize(resc, resv, argc, argv); + _wrap_helicsPublicationPublishTime(resc, resv, argc, argv); break; case 308: - _wrap_helicsInputGetString(resc, resv, argc, argv); + _wrap_helicsPublicationPublishChar(resc, resv, argc, argv); break; case 309: - _wrap_helicsInputGetInteger(resc, resv, argc, argv); + _wrap_helicsPublicationPublishComplex(resc, resv, argc, argv); break; case 310: - _wrap_helicsInputGetBoolean(resc, resv, argc, argv); + _wrap_helicsPublicationPublishVector(resc, resv, argc, argv); break; case 311: - _wrap_helicsInputGetDouble(resc, resv, argc, argv); + _wrap_helicsPublicationPublishComplexVector(resc, resv, argc, argv); break; case 312: - _wrap_helicsInputGetTime(resc, resv, argc, argv); + _wrap_helicsPublicationPublishNamedPoint(resc, resv, argc, argv); break; case 313: - _wrap_helicsInputGetChar(resc, resv, argc, argv); + _wrap_helicsPublicationPublishDataBuffer(resc, resv, argc, argv); break; case 314: - _wrap_helicsInputGetComplexObject(resc, resv, argc, argv); + _wrap_helicsPublicationAddTarget(resc, resv, argc, argv); break; case 315: - _wrap_helicsInputGetComplex(resc, resv, argc, argv); + _wrap_helicsInputIsValid(resc, resv, argc, argv); break; case 316: - _wrap_helicsInputGetVectorSize(resc, resv, argc, argv); + _wrap_helicsInputAddTarget(resc, resv, argc, argv); break; case 317: - _wrap_helicsInputGetVector(resc, resv, argc, argv); + _wrap_helicsInputGetByteCount(resc, resv, argc, argv); break; case 318: - _wrap_helicsInputGetComplexVector(resc, resv, argc, argv); + _wrap_helicsInputGetBytes(resc, resv, argc, argv); break; case 319: - _wrap_helicsInputGetNamedPoint(resc, resv, argc, argv); + _wrap_helicsInputGetDataBuffer(resc, resv, argc, argv); break; case 320: - _wrap_helicsInputSetDefaultBytes(resc, resv, argc, argv); + _wrap_helicsInputGetStringSize(resc, resv, argc, argv); break; case 321: - _wrap_helicsInputSetDefaultString(resc, resv, argc, argv); + _wrap_helicsInputGetString(resc, resv, argc, argv); break; case 322: - _wrap_helicsInputSetDefaultInteger(resc, resv, argc, argv); + _wrap_helicsInputGetInteger(resc, resv, argc, argv); break; case 323: - _wrap_helicsInputSetDefaultBoolean(resc, resv, argc, argv); + _wrap_helicsInputGetBoolean(resc, resv, argc, argv); break; case 324: - _wrap_helicsInputSetDefaultTime(resc, resv, argc, argv); + _wrap_helicsInputGetDouble(resc, resv, argc, argv); break; case 325: - _wrap_helicsInputSetDefaultChar(resc, resv, argc, argv); + _wrap_helicsInputGetTime(resc, resv, argc, argv); break; case 326: - _wrap_helicsInputSetDefaultDouble(resc, resv, argc, argv); + _wrap_helicsInputGetChar(resc, resv, argc, argv); break; case 327: - _wrap_helicsInputSetDefaultComplex(resc, resv, argc, argv); + _wrap_helicsInputGetComplexObject(resc, resv, argc, argv); break; case 328: - _wrap_helicsInputSetDefaultVector(resc, resv, argc, argv); + _wrap_helicsInputGetComplex(resc, resv, argc, argv); break; case 329: - _wrap_helicsInputSetDefaultComplexVector(resc, resv, argc, argv); + _wrap_helicsInputGetVectorSize(resc, resv, argc, argv); break; case 330: - _wrap_helicsInputSetDefaultNamedPoint(resc, resv, argc, argv); + _wrap_helicsInputGetVector(resc, resv, argc, argv); break; case 331: - _wrap_helicsInputGetType(resc, resv, argc, argv); + _wrap_helicsInputGetComplexVector(resc, resv, argc, argv); break; case 332: - _wrap_helicsInputGetPublicationType(resc, resv, argc, argv); + _wrap_helicsInputGetNamedPoint(resc, resv, argc, argv); break; case 333: - _wrap_helicsInputGetPublicationDataType(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultBytes(resc, resv, argc, argv); break; case 334: - _wrap_helicsPublicationGetType(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultString(resc, resv, argc, argv); break; case 335: - _wrap_helicsInputGetName(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultInteger(resc, resv, argc, argv); break; case 336: - _wrap_helicsSubscriptionGetTarget(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultBoolean(resc, resv, argc, argv); break; case 337: - _wrap_helicsInputGetTarget(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultTime(resc, resv, argc, argv); break; case 338: - _wrap_helicsPublicationGetName(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultChar(resc, resv, argc, argv); break; case 339: - _wrap_helicsInputGetUnits(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultDouble(resc, resv, argc, argv); break; case 340: - _wrap_helicsInputGetInjectionUnits(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultComplex(resc, resv, argc, argv); break; case 341: - _wrap_helicsInputGetExtractionUnits(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultVector(resc, resv, argc, argv); break; case 342: - _wrap_helicsPublicationGetUnits(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultComplexVector(resc, resv, argc, argv); break; case 343: - _wrap_helicsInputGetInfo(resc, resv, argc, argv); + _wrap_helicsInputSetDefaultNamedPoint(resc, resv, argc, argv); break; case 344: - _wrap_helicsInputSetInfo(resc, resv, argc, argv); + _wrap_helicsInputGetType(resc, resv, argc, argv); break; case 345: - _wrap_helicsInputGetTag(resc, resv, argc, argv); + _wrap_helicsInputGetPublicationType(resc, resv, argc, argv); break; case 346: - _wrap_helicsInputSetTag(resc, resv, argc, argv); + _wrap_helicsInputGetPublicationDataType(resc, resv, argc, argv); break; case 347: - _wrap_helicsPublicationGetInfo(resc, resv, argc, argv); + _wrap_helicsPublicationGetType(resc, resv, argc, argv); break; case 348: - _wrap_helicsPublicationSetInfo(resc, resv, argc, argv); + _wrap_helicsInputGetName(resc, resv, argc, argv); break; case 349: - _wrap_helicsPublicationGetTag(resc, resv, argc, argv); + _wrap_helicsSubscriptionGetTarget(resc, resv, argc, argv); break; case 350: - _wrap_helicsPublicationSetTag(resc, resv, argc, argv); + _wrap_helicsInputGetTarget(resc, resv, argc, argv); break; case 351: - _wrap_helicsInputGetOption(resc, resv, argc, argv); + _wrap_helicsPublicationGetName(resc, resv, argc, argv); break; case 352: - _wrap_helicsInputSetOption(resc, resv, argc, argv); + _wrap_helicsInputGetUnits(resc, resv, argc, argv); break; case 353: - _wrap_helicsPublicationGetOption(resc, resv, argc, argv); + _wrap_helicsInputGetInjectionUnits(resc, resv, argc, argv); break; case 354: - _wrap_helicsPublicationSetOption(resc, resv, argc, argv); + _wrap_helicsInputGetExtractionUnits(resc, resv, argc, argv); break; case 355: - _wrap_helicsPublicationSetMinimumChange(resc, resv, argc, argv); + _wrap_helicsPublicationGetUnits(resc, resv, argc, argv); break; case 356: - _wrap_helicsInputSetMinimumChange(resc, resv, argc, argv); + _wrap_helicsInputGetInfo(resc, resv, argc, argv); break; case 357: - _wrap_helicsInputIsUpdated(resc, resv, argc, argv); + _wrap_helicsInputSetInfo(resc, resv, argc, argv); break; case 358: - _wrap_helicsInputLastUpdateTime(resc, resv, argc, argv); + _wrap_helicsInputGetTag(resc, resv, argc, argv); break; case 359: - _wrap_helicsInputClearUpdate(resc, resv, argc, argv); + _wrap_helicsInputSetTag(resc, resv, argc, argv); break; case 360: - _wrap_helicsFederateGetPublicationCount(resc, resv, argc, argv); + _wrap_helicsPublicationGetInfo(resc, resv, argc, argv); break; case 361: - _wrap_helicsFederateGetInputCount(resc, resv, argc, argv); + _wrap_helicsPublicationSetInfo(resc, resv, argc, argv); break; case 362: - _wrap_helicsFederateRegisterEndpoint(resc, resv, argc, argv); + _wrap_helicsPublicationGetTag(resc, resv, argc, argv); break; case 363: - _wrap_helicsFederateRegisterGlobalEndpoint(resc, resv, argc, argv); + _wrap_helicsPublicationSetTag(resc, resv, argc, argv); break; case 364: - _wrap_helicsFederateRegisterTargetedEndpoint(resc, resv, argc, argv); + _wrap_helicsInputGetOption(resc, resv, argc, argv); break; case 365: - _wrap_helicsFederateRegisterGlobalTargetedEndpoint(resc, resv, argc, argv); + _wrap_helicsInputSetOption(resc, resv, argc, argv); break; case 366: - _wrap_helicsFederateGetEndpoint(resc, resv, argc, argv); + _wrap_helicsPublicationGetOption(resc, resv, argc, argv); break; case 367: - _wrap_helicsFederateGetEndpointByIndex(resc, resv, argc, argv); + _wrap_helicsPublicationSetOption(resc, resv, argc, argv); break; case 368: - _wrap_helicsEndpointIsValid(resc, resv, argc, argv); + _wrap_helicsPublicationSetMinimumChange(resc, resv, argc, argv); break; case 369: - _wrap_helicsEndpointSetDefaultDestination(resc, resv, argc, argv); + _wrap_helicsInputSetMinimumChange(resc, resv, argc, argv); break; case 370: - _wrap_helicsEndpointGetDefaultDestination(resc, resv, argc, argv); + _wrap_helicsInputIsUpdated(resc, resv, argc, argv); break; case 371: - _wrap_helicsEndpointSendBytes(resc, resv, argc, argv); + _wrap_helicsInputLastUpdateTime(resc, resv, argc, argv); break; case 372: - _wrap_helicsEndpointSendBytesTo(resc, resv, argc, argv); + _wrap_helicsInputClearUpdate(resc, resv, argc, argv); break; case 373: - _wrap_helicsEndpointSendBytesToAt(resc, resv, argc, argv); + _wrap_helicsFederateGetPublicationCount(resc, resv, argc, argv); break; case 374: - _wrap_helicsEndpointSendBytesAt(resc, resv, argc, argv); + _wrap_helicsFederateGetInputCount(resc, resv, argc, argv); break; case 375: - _wrap_helicsEndpointSendMessage(resc, resv, argc, argv); + _wrap_helicsFederateRegisterEndpoint(resc, resv, argc, argv); break; case 376: - _wrap_helicsEndpointSendMessageZeroCopy(resc, resv, argc, argv); + _wrap_helicsFederateRegisterGlobalEndpoint(resc, resv, argc, argv); break; case 377: - _wrap_helicsEndpointSubscribe(resc, resv, argc, argv); + _wrap_helicsFederateRegisterTargetedEndpoint(resc, resv, argc, argv); break; case 378: - _wrap_helicsFederateHasMessage(resc, resv, argc, argv); + _wrap_helicsFederateRegisterGlobalTargetedEndpoint(resc, resv, argc, argv); break; case 379: - _wrap_helicsEndpointHasMessage(resc, resv, argc, argv); + _wrap_helicsFederateGetEndpoint(resc, resv, argc, argv); break; case 380: - _wrap_helicsFederatePendingMessageCount(resc, resv, argc, argv); + _wrap_helicsFederateGetEndpointByIndex(resc, resv, argc, argv); break; case 381: - _wrap_helicsEndpointPendingMessageCount(resc, resv, argc, argv); + _wrap_helicsEndpointIsValid(resc, resv, argc, argv); break; case 382: - _wrap_helicsEndpointGetMessage(resc, resv, argc, argv); + _wrap_helicsEndpointSetDefaultDestination(resc, resv, argc, argv); break; case 383: - _wrap_helicsEndpointCreateMessage(resc, resv, argc, argv); + _wrap_helicsEndpointGetDefaultDestination(resc, resv, argc, argv); break; case 384: - _wrap_helicsEndpointClearMessages(resc, resv, argc, argv); + _wrap_helicsEndpointSendString(resc, resv, argc, argv); break; case 385: - _wrap_helicsFederateGetMessage(resc, resv, argc, argv); + _wrap_helicsEndpointSendStringTo(resc, resv, argc, argv); break; case 386: - _wrap_helicsFederateCreateMessage(resc, resv, argc, argv); + _wrap_helicsEndpointSendStringToAt(resc, resv, argc, argv); break; case 387: - _wrap_helicsFederateClearMessages(resc, resv, argc, argv); + _wrap_helicsEndpointSendStringAt(resc, resv, argc, argv); break; case 388: - _wrap_helicsEndpointGetType(resc, resv, argc, argv); + _wrap_helicsEndpointSendBytes(resc, resv, argc, argv); break; case 389: - _wrap_helicsEndpointGetName(resc, resv, argc, argv); + _wrap_helicsEndpointSendBytesTo(resc, resv, argc, argv); break; case 390: - _wrap_helicsFederateGetEndpointCount(resc, resv, argc, argv); + _wrap_helicsEndpointSendBytesToAt(resc, resv, argc, argv); break; case 391: - _wrap_helicsEndpointGetInfo(resc, resv, argc, argv); + _wrap_helicsEndpointSendBytesAt(resc, resv, argc, argv); break; case 392: - _wrap_helicsEndpointSetInfo(resc, resv, argc, argv); + _wrap_helicsEndpointSendMessage(resc, resv, argc, argv); break; case 393: - _wrap_helicsEndpointGetTag(resc, resv, argc, argv); + _wrap_helicsEndpointSendMessageZeroCopy(resc, resv, argc, argv); break; case 394: - _wrap_helicsEndpointSetTag(resc, resv, argc, argv); + _wrap_helicsEndpointSubscribe(resc, resv, argc, argv); break; case 395: - _wrap_helicsEndpointSetOption(resc, resv, argc, argv); + _wrap_helicsFederateHasMessage(resc, resv, argc, argv); break; case 396: - _wrap_helicsEndpointGetOption(resc, resv, argc, argv); + _wrap_helicsEndpointHasMessage(resc, resv, argc, argv); break; case 397: - _wrap_helicsEndpointAddSourceTarget(resc, resv, argc, argv); + _wrap_helicsFederatePendingMessageCount(resc, resv, argc, argv); break; case 398: - _wrap_helicsEndpointAddDestinationTarget(resc, resv, argc, argv); + _wrap_helicsEndpointPendingMessageCount(resc, resv, argc, argv); break; case 399: - _wrap_helicsEndpointRemoveTarget(resc, resv, argc, argv); + _wrap_helicsEndpointGetMessage(resc, resv, argc, argv); break; case 400: - _wrap_helicsEndpointAddSourceFilter(resc, resv, argc, argv); + _wrap_helicsEndpointCreateMessage(resc, resv, argc, argv); break; case 401: - _wrap_helicsEndpointAddDestinationFilter(resc, resv, argc, argv); + _wrap_helicsEndpointClearMessages(resc, resv, argc, argv); break; case 402: - _wrap_helicsMessageGetSource(resc, resv, argc, argv); + _wrap_helicsFederateGetMessage(resc, resv, argc, argv); break; case 403: - _wrap_helicsMessageGetDestination(resc, resv, argc, argv); + _wrap_helicsFederateCreateMessage(resc, resv, argc, argv); break; case 404: - _wrap_helicsMessageGetOriginalSource(resc, resv, argc, argv); + _wrap_helicsFederateClearMessages(resc, resv, argc, argv); break; case 405: - _wrap_helicsMessageGetOriginalDestination(resc, resv, argc, argv); + _wrap_helicsEndpointGetType(resc, resv, argc, argv); break; case 406: - _wrap_helicsMessageGetTime(resc, resv, argc, argv); + _wrap_helicsEndpointGetName(resc, resv, argc, argv); break; case 407: - _wrap_helicsMessageGetString(resc, resv, argc, argv); + _wrap_helicsFederateGetEndpointCount(resc, resv, argc, argv); break; case 408: - _wrap_helicsMessageGetMessageID(resc, resv, argc, argv); + _wrap_helicsEndpointGetInfo(resc, resv, argc, argv); break; case 409: - _wrap_helicsMessageGetFlagOption(resc, resv, argc, argv); + _wrap_helicsEndpointSetInfo(resc, resv, argc, argv); break; case 410: - _wrap_helicsMessageGetByteCount(resc, resv, argc, argv); + _wrap_helicsEndpointGetTag(resc, resv, argc, argv); break; case 411: - _wrap_helicsMessageGetBytes(resc, resv, argc, argv); + _wrap_helicsEndpointSetTag(resc, resv, argc, argv); break; case 412: - _wrap_helicsMessageGetBytesPointer(resc, resv, argc, argv); + _wrap_helicsEndpointSetOption(resc, resv, argc, argv); break; case 413: - _wrap_helicsMessageDataBuffer(resc, resv, argc, argv); + _wrap_helicsEndpointGetOption(resc, resv, argc, argv); break; case 414: - _wrap_helicsMessageIsValid(resc, resv, argc, argv); + _wrap_helicsEndpointAddSourceTarget(resc, resv, argc, argv); break; case 415: - _wrap_helicsMessageSetSource(resc, resv, argc, argv); + _wrap_helicsEndpointAddDestinationTarget(resc, resv, argc, argv); break; case 416: - _wrap_helicsMessageSetDestination(resc, resv, argc, argv); + _wrap_helicsEndpointRemoveTarget(resc, resv, argc, argv); break; case 417: - _wrap_helicsMessageSetOriginalSource(resc, resv, argc, argv); + _wrap_helicsEndpointAddSourceFilter(resc, resv, argc, argv); break; case 418: - _wrap_helicsMessageSetOriginalDestination(resc, resv, argc, argv); + _wrap_helicsEndpointAddDestinationFilter(resc, resv, argc, argv); break; case 419: - _wrap_helicsMessageSetTime(resc, resv, argc, argv); + _wrap_helicsMessageGetSource(resc, resv, argc, argv); break; case 420: - _wrap_helicsMessageResize(resc, resv, argc, argv); + _wrap_helicsMessageGetDestination(resc, resv, argc, argv); break; case 421: - _wrap_helicsMessageReserve(resc, resv, argc, argv); + _wrap_helicsMessageGetOriginalSource(resc, resv, argc, argv); break; case 422: - _wrap_helicsMessageSetMessageID(resc, resv, argc, argv); + _wrap_helicsMessageGetOriginalDestination(resc, resv, argc, argv); break; case 423: - _wrap_helicsMessageClearFlags(resc, resv, argc, argv); + _wrap_helicsMessageGetTime(resc, resv, argc, argv); break; case 424: - _wrap_helicsMessageSetFlagOption(resc, resv, argc, argv); + _wrap_helicsMessageGetString(resc, resv, argc, argv); break; case 425: - _wrap_helicsMessageSetString(resc, resv, argc, argv); + _wrap_helicsMessageGetMessageID(resc, resv, argc, argv); break; case 426: - _wrap_helicsMessageSetData(resc, resv, argc, argv); + _wrap_helicsMessageGetFlagOption(resc, resv, argc, argv); break; case 427: - _wrap_helicsMessageSetDataBuffer(resc, resv, argc, argv); + _wrap_helicsMessageGetByteCount(resc, resv, argc, argv); break; case 428: - _wrap_helicsMessageAppendData(resc, resv, argc, argv); + _wrap_helicsMessageGetBytes(resc, resv, argc, argv); break; case 429: - _wrap_helicsMessageCopy(resc, resv, argc, argv); + _wrap_helicsMessageGetBytesPointer(resc, resv, argc, argv); break; case 430: - _wrap_helicsMessageClone(resc, resv, argc, argv); + _wrap_helicsMessageDataBuffer(resc, resv, argc, argv); break; case 431: - _wrap_helicsMessageFree(resc, resv, argc, argv); + _wrap_helicsMessageIsValid(resc, resv, argc, argv); break; case 432: - _wrap_helicsMessageClear(resc, resv, argc, argv); + _wrap_helicsMessageSetSource(resc, resv, argc, argv); break; case 433: - _wrap_helicsFederateRegisterFilter(resc, resv, argc, argv); + _wrap_helicsMessageSetDestination(resc, resv, argc, argv); break; case 434: - _wrap_helicsFederateRegisterGlobalFilter(resc, resv, argc, argv); + _wrap_helicsMessageSetOriginalSource(resc, resv, argc, argv); break; case 435: - _wrap_helicsFederateRegisterCloningFilter(resc, resv, argc, argv); + _wrap_helicsMessageSetOriginalDestination(resc, resv, argc, argv); break; case 436: - _wrap_helicsFederateRegisterGlobalCloningFilter(resc, resv, argc, argv); + _wrap_helicsMessageSetTime(resc, resv, argc, argv); break; case 437: - _wrap_helicsCoreRegisterFilter(resc, resv, argc, argv); + _wrap_helicsMessageResize(resc, resv, argc, argv); break; case 438: - _wrap_helicsCoreRegisterCloningFilter(resc, resv, argc, argv); + _wrap_helicsMessageReserve(resc, resv, argc, argv); break; case 439: - _wrap_helicsFederateGetFilterCount(resc, resv, argc, argv); + _wrap_helicsMessageSetMessageID(resc, resv, argc, argv); break; case 440: - _wrap_helicsFederateGetFilter(resc, resv, argc, argv); + _wrap_helicsMessageClearFlags(resc, resv, argc, argv); break; case 441: - _wrap_helicsFederateGetFilterByIndex(resc, resv, argc, argv); + _wrap_helicsMessageSetFlagOption(resc, resv, argc, argv); break; case 442: - _wrap_helicsFilterIsValid(resc, resv, argc, argv); + _wrap_helicsMessageSetString(resc, resv, argc, argv); break; case 443: - _wrap_helicsFilterGetName(resc, resv, argc, argv); + _wrap_helicsMessageSetData(resc, resv, argc, argv); break; case 444: - _wrap_helicsFilterSet(resc, resv, argc, argv); + _wrap_helicsMessageSetDataBuffer(resc, resv, argc, argv); break; case 445: - _wrap_helicsFilterSetString(resc, resv, argc, argv); + _wrap_helicsMessageAppendData(resc, resv, argc, argv); break; case 446: - _wrap_helicsFilterAddDestinationTarget(resc, resv, argc, argv); + _wrap_helicsMessageCopy(resc, resv, argc, argv); break; case 447: - _wrap_helicsFilterAddSourceTarget(resc, resv, argc, argv); + _wrap_helicsMessageClone(resc, resv, argc, argv); break; case 448: - _wrap_helicsFilterAddDeliveryEndpoint(resc, resv, argc, argv); + _wrap_helicsMessageFree(resc, resv, argc, argv); break; case 449: - _wrap_helicsFilterRemoveTarget(resc, resv, argc, argv); + _wrap_helicsMessageClear(resc, resv, argc, argv); break; case 450: - _wrap_helicsFilterRemoveDeliveryEndpoint(resc, resv, argc, argv); + _wrap_helicsFederateRegisterFilter(resc, resv, argc, argv); break; case 451: - _wrap_helicsFilterGetInfo(resc, resv, argc, argv); + _wrap_helicsFederateRegisterGlobalFilter(resc, resv, argc, argv); break; case 452: - _wrap_helicsFilterSetInfo(resc, resv, argc, argv); + _wrap_helicsFederateRegisterCloningFilter(resc, resv, argc, argv); break; case 453: - _wrap_helicsFilterGetTag(resc, resv, argc, argv); + _wrap_helicsFederateRegisterGlobalCloningFilter(resc, resv, argc, argv); break; case 454: - _wrap_helicsFilterSetTag(resc, resv, argc, argv); + _wrap_helicsCoreRegisterFilter(resc, resv, argc, argv); break; case 455: - _wrap_helicsFilterSetOption(resc, resv, argc, argv); + _wrap_helicsCoreRegisterCloningFilter(resc, resv, argc, argv); break; case 456: - _wrap_helicsFilterGetOption(resc, resv, argc, argv); + _wrap_helicsFederateGetFilterCount(resc, resv, argc, argv); break; case 457: - _wrap_helicsFederateRegisterTranslator(resc, resv, argc, argv); + _wrap_helicsFederateGetFilter(resc, resv, argc, argv); break; case 458: - _wrap_helicsFederateRegisterGlobalTranslator(resc, resv, argc, argv); + _wrap_helicsFederateGetFilterByIndex(resc, resv, argc, argv); break; case 459: - _wrap_helicsCoreRegisterTranslator(resc, resv, argc, argv); + _wrap_helicsFilterIsValid(resc, resv, argc, argv); break; case 460: - _wrap_helicsFederateGetTranslatorCount(resc, resv, argc, argv); + _wrap_helicsFilterGetName(resc, resv, argc, argv); break; case 461: - _wrap_helicsFederateGetTranslator(resc, resv, argc, argv); + _wrap_helicsFilterSet(resc, resv, argc, argv); break; case 462: - _wrap_helicsFederateGetTranslatorByIndex(resc, resv, argc, argv); + _wrap_helicsFilterSetString(resc, resv, argc, argv); break; case 463: - _wrap_helicsTranslatorIsValid(resc, resv, argc, argv); + _wrap_helicsFilterGetPropertyDouble(resc, resv, argc, argv); break; case 464: - _wrap_helicsTranslatorGetName(resc, resv, argc, argv); + _wrap_helicsFilterGetPropertyString(resc, resv, argc, argv); break; case 465: - _wrap_helicsTranslatorSet(resc, resv, argc, argv); + _wrap_helicsFilterAddDestinationTarget(resc, resv, argc, argv); break; case 466: - _wrap_helicsTranslatorSetString(resc, resv, argc, argv); + _wrap_helicsFilterAddSourceTarget(resc, resv, argc, argv); break; case 467: - _wrap_helicsTranslatorAddInputTarget(resc, resv, argc, argv); + _wrap_helicsFilterAddDeliveryEndpoint(resc, resv, argc, argv); break; case 468: - _wrap_helicsTranslatorAddPublicationTarget(resc, resv, argc, argv); + _wrap_helicsFilterRemoveTarget(resc, resv, argc, argv); break; case 469: - _wrap_helicsTranslatorAddSourceEndpoint(resc, resv, argc, argv); + _wrap_helicsFilterRemoveDeliveryEndpoint(resc, resv, argc, argv); break; case 470: - _wrap_helicsTranslatorAddDestinationEndpoint(resc, resv, argc, argv); + _wrap_helicsFilterGetInfo(resc, resv, argc, argv); break; case 471: - _wrap_helicsTranslatorRemoveTarget(resc, resv, argc, argv); + _wrap_helicsFilterSetInfo(resc, resv, argc, argv); break; case 472: - _wrap_helicsTranslatorGetInfo(resc, resv, argc, argv); + _wrap_helicsFilterGetTag(resc, resv, argc, argv); break; case 473: - _wrap_helicsTranslatorSetInfo(resc, resv, argc, argv); + _wrap_helicsFilterSetTag(resc, resv, argc, argv); break; case 474: - _wrap_helicsTranslatorGetTag(resc, resv, argc, argv); + _wrap_helicsFilterSetOption(resc, resv, argc, argv); break; case 475: - _wrap_helicsTranslatorSetTag(resc, resv, argc, argv); + _wrap_helicsFilterGetOption(resc, resv, argc, argv); break; case 476: - _wrap_helicsTranslatorSetOption(resc, resv, argc, argv); + _wrap_helicsFederateRegisterTranslator(resc, resv, argc, argv); break; case 477: - _wrap_helicsTranslatorGetOption(resc, resv, argc, argv); + _wrap_helicsFederateRegisterGlobalTranslator(resc, resv, argc, argv); break; case 478: - _wrap_helicsBrokerSetLoggingCallback(resc, resv, argc, argv); + _wrap_helicsCoreRegisterTranslator(resc, resv, argc, argv); break; case 479: - _wrap_helicsCoreSetLoggingCallback(resc, resv, argc, argv); + _wrap_helicsFederateGetTranslatorCount(resc, resv, argc, argv); break; case 480: - _wrap_helicsFederateSetLoggingCallback(resc, resv, argc, argv); + _wrap_helicsFederateGetTranslator(resc, resv, argc, argv); break; case 481: - _wrap_helicsFilterSetCustomCallback(resc, resv, argc, argv); + _wrap_helicsFederateGetTranslatorByIndex(resc, resv, argc, argv); break; case 482: - _wrap_helicsTranslatorSetCustomCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorIsValid(resc, resv, argc, argv); break; case 483: - _wrap_helicsFederateSetQueryCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorGetName(resc, resv, argc, argv); break; case 484: - _wrap_helicsFederateSetTimeRequestEntryCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorSet(resc, resv, argc, argv); break; case 485: - _wrap_helicsFederateSetTimeUpdateCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorSetString(resc, resv, argc, argv); break; case 486: - _wrap_helicsFederateSetStateChangeCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorAddInputTarget(resc, resv, argc, argv); break; case 487: - _wrap_helicsFederateSetTimeRequestReturnCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorAddPublicationTarget(resc, resv, argc, argv); break; case 488: - _wrap_helicsFederateInitializingEntryCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorAddSourceEndpoint(resc, resv, argc, argv); break; case 489: - _wrap_helicsFederateExecutingEntryCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorAddDestinationEndpoint(resc, resv, argc, argv); break; case 490: - _wrap_helicsFederateCosimulationTerminationCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorRemoveTarget(resc, resv, argc, argv); break; case 491: - _wrap_helicsFederateErrorHandlerCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorGetInfo(resc, resv, argc, argv); break; case 492: - _wrap_helicsCallbackFederateNextTimeCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorSetInfo(resc, resv, argc, argv); break; case 493: - _wrap_helicsCallbackFederateNextTimeIterativeCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorGetTag(resc, resv, argc, argv); break; case 494: - _wrap_helicsCallbackFederateInitializeCallback(resc, resv, argc, argv); + _wrap_helicsTranslatorSetTag(resc, resv, argc, argv); break; case 495: + _wrap_helicsTranslatorSetOption(resc, resv, argc, argv); + break; + case 496: + _wrap_helicsTranslatorGetOption(resc, resv, argc, argv); + break; + case 497: + _wrap_helicsBrokerSetLoggingCallback(resc, resv, argc, argv); + break; + case 498: + _wrap_helicsCoreSetLoggingCallback(resc, resv, argc, argv); + break; + case 499: + _wrap_helicsFederateSetLoggingCallback(resc, resv, argc, argv); + break; + case 500: + _wrap_helicsFilterSetCustomCallback(resc, resv, argc, argv); + break; + case 501: + _wrap_helicsTranslatorSetCustomCallback(resc, resv, argc, argv); + break; + case 502: + _wrap_helicsFederateSetQueryCallback(resc, resv, argc, argv); + break; + case 503: + _wrap_helicsFederateSetTimeRequestEntryCallback(resc, resv, argc, argv); + break; + case 504: + _wrap_helicsFederateSetTimeUpdateCallback(resc, resv, argc, argv); + break; + case 505: + _wrap_helicsFederateSetStateChangeCallback(resc, resv, argc, argv); + break; + case 506: + _wrap_helicsFederateSetTimeRequestReturnCallback(resc, resv, argc, argv); + break; + case 507: + _wrap_helicsFederateInitializingEntryCallback(resc, resv, argc, argv); + break; + case 508: + _wrap_helicsFederateExecutingEntryCallback(resc, resv, argc, argv); + break; + case 509: + _wrap_helicsFederateCosimulationTerminationCallback(resc, resv, argc, argv); + break; + case 510: + _wrap_helicsFederateErrorHandlerCallback(resc, resv, argc, argv); + break; + case 511: + _wrap_helicsCallbackFederateNextTimeCallback(resc, resv, argc, argv); + break; + case 512: + _wrap_helicsCallbackFederateNextTimeIterativeCallback(resc, resv, argc, argv); + break; + case 513: + _wrap_helicsCallbackFederateInitializeCallback(resc, resv, argc, argv); + break; + case 514: _wrap_helicsQueryBufferFill(resc, resv, argc, argv); break; default: diff --git a/matlabBindings/+helics/HELICS_INVALID_DOUBLE.m b/matlabBindings/+helics/HELICS_INVALID_DOUBLE.m new file mode 100644 index 0000000..0265c89 --- /dev/null +++ b/matlabBindings/+helics/HELICS_INVALID_DOUBLE.m @@ -0,0 +1,3 @@ +function v = HELICS_INVALID_DOUBLE() + v = helicsMex('HELICS_INVALID_DOUBLE'); +end diff --git a/matlabBindings/+helics/HelicsCoreTypes.m b/matlabBindings/+helics/HelicsCoreTypes.m index 22586f5..52dc061 100644 --- a/matlabBindings/+helics/HelicsCoreTypes.m +++ b/matlabBindings/+helics/HelicsCoreTypes.m @@ -17,6 +17,7 @@ % HELICS_CORE_TYPE_INPROC: value:18 an in process core type for handling communications in shared memory it is pretty similar to the test core but stripped from the "test" components % HELICS_CORE_TYPE_NULL: value:66 an explicit core type that is recognized but explicitly doesn't exist, for testing and a few other assorted reasons % HELICS_CORE_TYPE_EMPTY: value:77 an explicit core type exists but does nothing but return empty values or sink calls +% HELICS_CORE_TYPE_EXTRACT: value:101 core type specification to allow extraction from later arguments or files classdef HelicsCoreTypes properties (Constant) HELICS_CORE_TYPE_DEFAULT = int32(0); @@ -35,5 +36,6 @@ HELICS_CORE_TYPE_INPROC = int32(18); HELICS_CORE_TYPE_NULL = int32(66); HELICS_CORE_TYPE_EMPTY = int32(77); + HELICS_CORE_TYPE_EXTRACT = int32(101); end end \ No newline at end of file diff --git a/matlabBindings/+helics/helicsAppDestroy.m b/matlabBindings/+helics/helicsAppDestroy.m new file mode 100644 index 0000000..9ff3cbf --- /dev/null +++ b/matlabBindings/+helics/helicsAppDestroy.m @@ -0,0 +1,6 @@ +function varargout = helicsAppDestroy(varargin) +% Disconnect and free a HelicsApp. +% @param app The app to destroy. + + [varargout{1:nargout}] = helicsMex('helicsAppDestroy', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsAppEnabled.m b/matlabBindings/+helics/helicsAppEnabled.m new file mode 100644 index 0000000..b4b0b9e --- /dev/null +++ b/matlabBindings/+helics/helicsAppEnabled.m @@ -0,0 +1,5 @@ +function varargout = helicsAppEnabled(varargin) +% HELICS_TRUE if the app library is enabled + + [varargout{1:nargout}] = helicsMex('helicsAppEnabled', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsAppFinalize.m b/matlabBindings/+helics/helicsAppFinalize.m new file mode 100644 index 0000000..52c20c7 --- /dev/null +++ b/matlabBindings/+helics/helicsAppFinalize.m @@ -0,0 +1,7 @@ +function varargout = helicsAppFinalize(varargin) +% Finalize the HelicsApp. +% @param app The app to finalize. +% @param[in,out] err An error object that will contain an error code and string if any error occurred during the execution of the function. + + [varargout{1:nargout}] = helicsMex('helicsAppFinalize', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsAppFree.m b/matlabBindings/+helics/helicsAppFree.m new file mode 100644 index 0000000..3ec7b0d --- /dev/null +++ b/matlabBindings/+helics/helicsAppFree.m @@ -0,0 +1,6 @@ +function varargout = helicsAppFree(varargin) +% Free the HelicsApp object. +% @param app The app to free. + + [varargout{1:nargout}] = helicsMex('helicsAppFree', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsAppGetFederate.m b/matlabBindings/+helics/helicsAppGetFederate.m new file mode 100644 index 0000000..2681d6d --- /dev/null +++ b/matlabBindings/+helics/helicsAppGetFederate.m @@ -0,0 +1,10 @@ +function varargout = helicsAppGetFederate(varargin) +% Run the HelicsApp. +% @details Execute the HelicsApp to completion +% @param app The app to execute. +% +% @return An opaque value federate object that can be used in any of the federate methods, not recommended to use this object to advance +% time, the app will not likely function normally; other query, information calls, or modification calls on the federate are fine. + + [varargout{1:nargout}] = helicsMex('helicsAppGetFederate', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsAppInitialize.m b/matlabBindings/+helics/helicsAppInitialize.m new file mode 100644 index 0000000..67a4081 --- /dev/null +++ b/matlabBindings/+helics/helicsAppInitialize.m @@ -0,0 +1,8 @@ +function varargout = helicsAppInitialize(varargin) +% Initialize the HelicsApp federate. +% @details Generate all the interfaces and load data for the application. +% @param app The app to initialize. +% @param[in,out] err An error object that will contain an error code and string if any error occurred during the execution of the function. + + [varargout{1:nargout}] = helicsMex('helicsAppInitialize', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsAppIsActive.m b/matlabBindings/+helics/helicsAppIsActive.m new file mode 100644 index 0000000..2ed1662 --- /dev/null +++ b/matlabBindings/+helics/helicsAppIsActive.m @@ -0,0 +1,7 @@ +function varargout = helicsAppIsActive(varargin) +% Check if the HelicsApp is active and ready to run. +% @param app The app to check. +% @return True if the app is active, otherwise false. + + [varargout{1:nargout}] = helicsMex('helicsAppIsActive', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsAppLoadFile.m b/matlabBindings/+helics/helicsAppLoadFile.m new file mode 100644 index 0000000..802efad --- /dev/null +++ b/matlabBindings/+helics/helicsAppLoadFile.m @@ -0,0 +1,13 @@ +function varargout = helicsAppLoadFile(varargin) +% Load a file to an App. +% +% @details Loads a configuration file for an app. +% +% @param appName A string with the name of the app, can be NULL or an empty string to pull the default name from fedInfo or the config +% file. +% @param app The app to load a file. +% @param configFile Configuration file or string to pass into the app, can be NULL or empty. +% @param[in,out] err An error object that will contain an error code and string if any error occurred during the execution of the function. + + [varargout{1:nargout}] = helicsMex('helicsAppLoadFile', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsAppRun.m b/matlabBindings/+helics/helicsAppRun.m new file mode 100644 index 0000000..f11c41d --- /dev/null +++ b/matlabBindings/+helics/helicsAppRun.m @@ -0,0 +1,8 @@ +function varargout = helicsAppRun(varargin) +% Run the HelicsApp. +% @details Execute the app to completion. +% @param app The app to execute. +% @param[in,out] err An error object that will contain an error code and string if any error occurred during the execution of the function. + + [varargout{1:nargout}] = helicsMex('helicsAppRun', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsAppRunTo.m b/matlabBindings/+helics/helicsAppRunTo.m new file mode 100644 index 0000000..c741f55 --- /dev/null +++ b/matlabBindings/+helics/helicsAppRunTo.m @@ -0,0 +1,9 @@ +function varargout = helicsAppRunTo(varargin) +% Run a HelicsApp to a specified stop time. +% @details It is possible to call this method repeatedly with different times. +% @param app The app to run. +% @param stopTime The desired stop time. +% @param[in,out] err An error object that will contain an error code and string if any error occurred during the execution of the function. + + [varargout{1:nargout}] = helicsMex('helicsAppRunTo', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsCreateApp.m b/matlabBindings/+helics/helicsCreateApp.m new file mode 100644 index 0000000..13a8b58 --- /dev/null +++ b/matlabBindings/+helics/helicsCreateApp.m @@ -0,0 +1,15 @@ +function varargout = helicsCreateApp(varargin) +% Create a HelicsApp object. +% +% @details Create a HelicsApp object. +% +% @param appName A string with the name of the app, can be NULL or an empty string to pull the default name from fedInfo or the config file. +% @param appType The type of app to create. +% @param configFile Configuration file or string to pass into the app, can be NULL or empty. +% @param fedInfo The federate information to pass into the app, can be NULL. +% +% +% @return An opaque value app object, or nullptr if the object creation failed. + + [varargout{1:nargout}] = helicsMex('helicsCreateApp', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsCreateBroker.m b/matlabBindings/+helics/helicsCreateBroker.m index ab5faf8..d53e86f 100644 --- a/matlabBindings/+helics/helicsCreateBroker.m +++ b/matlabBindings/+helics/helicsCreateBroker.m @@ -5,6 +5,7 @@ % @param name The name of the broker. It can be a nullptr or empty string to have a name automatically assigned. % @param initString An initialization string to send to the core-the format is similar to command line arguments. % Typical options include a broker address such as --broker="XSSAF" if this is a subbroker, or the number of federates, +% or it can also be a json or toml file with broker configuration. % or the address. % % diff --git a/matlabBindings/+helics/helicsCreateCombinationFederateFromConfig.m b/matlabBindings/+helics/helicsCreateCombinationFederateFromConfig.m index 01a24c5..80efda2 100644 --- a/matlabBindings/+helics/helicsCreateCombinationFederateFromConfig.m +++ b/matlabBindings/+helics/helicsCreateCombinationFederateFromConfig.m @@ -4,7 +4,7 @@ % @details Combination federates are both value federates and message federates, objects can be used in all functions % that take a HelicsFederate, helics_message_federate or HelicsFederate object as an argument % -% @param configFile A JSON file or a JSON string or TOML file that contains setup and configuration information. +% @param configFile A JSON file or a JSON string,TOML file, or command line arguments that contains setup and configuration information. % % % diff --git a/matlabBindings/+helics/helicsCreateCore.m b/matlabBindings/+helics/helicsCreateCore.m index bb63060..de31f03 100644 --- a/matlabBindings/+helics/helicsCreateCore.m +++ b/matlabBindings/+helics/helicsCreateCore.m @@ -4,7 +4,8 @@ % @param type The type of the core to create. % @param name The name of the core. It can be a nullptr or empty string to have a name automatically assigned. % @param initString An initialization string to send to the core. The format is similar to command line arguments. -% Typical options include a broker name, the broker address, the number of federates, etc. +% Typical options include a broker name, the broker address, the number of federates, etc. Can also be a +% file (toml, ini, json) or json object containing the core configuration. % % % diff --git a/matlabBindings/+helics/helicsDataBufferFillFromRawString.m b/matlabBindings/+helics/helicsDataBufferFillFromRawString.m index 691d869..cefc144 100644 --- a/matlabBindings/+helics/helicsDataBufferFillFromRawString.m +++ b/matlabBindings/+helics/helicsDataBufferFillFromRawString.m @@ -1,7 +1,8 @@ function varargout = helicsDataBufferFillFromRawString(varargin) % convert a raw string (may contain nulls) to serialized bytesin a buffer % @param data the HelicsDataBuffer to fill -% @param value the value to serialize into the dataBuffer +% @param str the value to serialize into the dataBuffer +% @param stringSize the size of the string value to serialize into the dataBuffer % @return the buffer size after filling [varargout{1:nargout}] = helicsMex('helicsDataBufferFillFromRawString', varargin{:}); diff --git a/matlabBindings/+helics/helicsEndpointSendString.m b/matlabBindings/+helics/helicsEndpointSendString.m new file mode 100644 index 0000000..1e1b044 --- /dev/null +++ b/matlabBindings/+helics/helicsEndpointSendString.m @@ -0,0 +1,9 @@ +function varargout = helicsEndpointSendString(varargin) +% Send a message to the targeted destination. +% +% @param endpoint The endpoint to send the data from. +% @param message The string to send. +% @param[in,out] err A pointer to an error object for catching errors. + + [varargout{1:nargout}] = helicsMex('helicsEndpointSendString', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsEndpointSendStringAt.m b/matlabBindings/+helics/helicsEndpointSendStringAt.m new file mode 100644 index 0000000..8b60f35 --- /dev/null +++ b/matlabBindings/+helics/helicsEndpointSendStringAt.m @@ -0,0 +1,13 @@ +function varargout = helicsEndpointSendStringAt(varargin) +% Send a message at a specific time to the targeted destinations. +% +% @param endpoint The endpoint to send the data from. +% +% @param message The data to send. +% +% @param time The time the message should be sent. +% +% @param[in,out] err A pointer to an error object for catching errors. + + [varargout{1:nargout}] = helicsMex('helicsEndpointSendStringAt', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsEndpointSendStringTo.m b/matlabBindings/+helics/helicsEndpointSendStringTo.m new file mode 100644 index 0000000..459ba87 --- /dev/null +++ b/matlabBindings/+helics/helicsEndpointSendStringTo.m @@ -0,0 +1,12 @@ +function varargout = helicsEndpointSendStringTo(varargin) +% Send a message to the specified destination. +% +% @param endpoint The endpoint to send the data from. +% +% @param message The string to send. +% +% @param dst The target destination. Use nullptr to send to the default destination. +% @param[in,out] err A pointer to an error object for catching errors. + + [varargout{1:nargout}] = helicsMex('helicsEndpointSendStringTo', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsEndpointSendStringToAt.m b/matlabBindings/+helics/helicsEndpointSendStringToAt.m new file mode 100644 index 0000000..54110e4 --- /dev/null +++ b/matlabBindings/+helics/helicsEndpointSendStringToAt.m @@ -0,0 +1,14 @@ +function varargout = helicsEndpointSendStringToAt(varargin) +% Send a message to the specified destination at a specific time. +% +% @param endpoint The endpoint to send the data from. +% @param message The data to send. +% +% @param dst The target destination. Use nullptr to send to the default destination. +% +% @param time The time the message should be sent. +% +% @param[in,out] err A pointer to an error object for catching errors. + + [varargout{1:nargout}] = helicsMex('helicsEndpointSendStringToAt', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsFilterGetPropertyDouble.m b/matlabBindings/+helics/helicsFilterGetPropertyDouble.m new file mode 100644 index 0000000..401c49b --- /dev/null +++ b/matlabBindings/+helics/helicsFilterGetPropertyDouble.m @@ -0,0 +1,9 @@ +function varargout = helicsFilterGetPropertyDouble(varargin) +% Get a double property from a filter. +% +% @param filt The filter to retrieve a value from. +% @param prop A string containing the property to get. +% + + [varargout{1:nargout}] = helicsMex('helicsFilterGetPropertyDouble', varargin{:}); +end diff --git a/matlabBindings/+helics/helicsFilterGetPropertyString.m b/matlabBindings/+helics/helicsFilterGetPropertyString.m new file mode 100644 index 0000000..f9b2ee6 --- /dev/null +++ b/matlabBindings/+helics/helicsFilterGetPropertyString.m @@ -0,0 +1,10 @@ +function varargout = helicsFilterGetPropertyString(varargin) +% Get a string property on a filter. The string output memory is valid until a subsequent call to getPropertyString on the particular +% filter. +% +% @param filt The filter to retrieve a value from. +% @param prop A string containing the property to get. +% + + [varargout{1:nargout}] = helicsMex('helicsFilterGetPropertyString', varargin{:}); +end diff --git a/poetry.lock b/poetry.lock index 6e302ed..7c20fd6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,92 +1,70 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] -name = "cffi" -version = "1.16.0" -description = "Foreign Function Interface for Python calling C code." +name = "cheader2json" +version = "0.0.0rc2" +description = "Parse C header file and output JSON ast + types" optional = false python-versions = ">=3.8" files = [ - {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, - {file = "cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e61e3e4fa664a8588aa25c883eab612a188c725755afff6289454d6362b9673"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a72e8961a86d19bdb45851d8f1f08b041ea37d2bd8d4fd19903bc3083d80c896"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b50bf3f55561dac5438f8e70bfcdfd74543fd60df5fa5f62d94e5867deca684"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7651c50c8c5ef7bdb41108b7b8c5a83013bfaa8a935590c5d74627c047a583c7"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4108df7fe9b707191e55f33efbcb2d81928e10cea45527879a4749cbe472614"}, - {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:32c68ef735dbe5857c810328cb2481e24722a59a2003018885514d4c09af9743"}, - {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:673739cb539f8cdaa07d92d02efa93c9ccf87e345b9a0b556e3ecc666718468d"}, - {file = "cffi-1.16.0-cp310-cp310-win32.whl", hash = "sha256:9f90389693731ff1f659e55c7d1640e2ec43ff725cc61b04b2f9c6d8d017df6a"}, - {file = "cffi-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:e6024675e67af929088fda399b2094574609396b1decb609c55fa58b028a32a1"}, - {file = "cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b84834d0cf97e7d27dd5b7f3aca7b6e9263c56308ab9dc8aae9784abb774d404"}, - {file = "cffi-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b8ebc27c014c59692bb2664c7d13ce7a6e9a629be20e54e7271fa696ff2b417"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee07e47c12890ef248766a6e55bd38ebfb2bb8edd4142d56db91b21ea68b7627"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8a9d3ebe49f084ad71f9269834ceccbf398253c9fac910c4fd7053ff1386936"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e70f54f1796669ef691ca07d046cd81a29cb4deb1e5f942003f401c0c4a2695d"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5bf44d66cdf9e893637896c7faa22298baebcd18d1ddb6d2626a6e39793a1d56"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b78010e7b97fef4bee1e896df8a4bbb6712b7f05b7ef630f9d1da00f6444d2e"}, - {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c6a164aa47843fb1b01e941d385aab7215563bb8816d80ff3a363a9f8448a8dc"}, - {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e09f3ff613345df5e8c3667da1d918f9149bd623cd9070c983c013792a9a62eb"}, - {file = "cffi-1.16.0-cp311-cp311-win32.whl", hash = "sha256:2c56b361916f390cd758a57f2e16233eb4f64bcbeee88a4881ea90fca14dc6ab"}, - {file = "cffi-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:db8e577c19c0fda0beb7e0d4e09e0ba74b1e4c092e0e40bfa12fe05b6f6d75ba"}, - {file = "cffi-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956"}, - {file = "cffi-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:68e7c44931cc171c54ccb702482e9fc723192e88d25a0e133edd7aff8fcd1f6e"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abd808f9c129ba2beda4cfc53bde801e5bcf9d6e0f22f095e45327c038bfe68e"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88e2b3c14bdb32e440be531ade29d3c50a1a59cd4e51b1dd8b0865c54ea5d2e2"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7be2d771cdba2942e13215c4e340bfd76398e9227ad10402a8767ab1865d2e6"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e715596e683d2ce000574bae5d07bd522c781a822866c20495e52520564f0969"}, - {file = "cffi-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2d92b25dbf6cae33f65005baf472d2c245c050b1ce709cc4588cdcdd5495b520"}, - {file = "cffi-1.16.0-cp312-cp312-win32.whl", hash = "sha256:b2ca4e77f9f47c55c194982e10f058db063937845bb2b7a86c84a6cfe0aefa8b"}, - {file = "cffi-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:68678abf380b42ce21a5f2abde8efee05c114c2fdb2e9eef2efdb0257fba1235"}, - {file = "cffi-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a09582f178759ee8128d9270cd1344154fd473bb77d94ce0aeb2a93ebf0feaf0"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e760191dd42581e023a68b758769e2da259b5d52e3103c6060ddc02c9edb8d7b"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80876338e19c951fdfed6198e70bc88f1c9758b94578d5a7c4c91a87af3cf31c"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a6a14b17d7e17fa0d207ac08642c8820f84f25ce17a442fd15e27ea18d67c59b"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6602bc8dc6f3a9e02b6c22c4fc1e47aa50f8f8e6d3f78a5e16ac33ef5fefa324"}, - {file = "cffi-1.16.0-cp38-cp38-win32.whl", hash = "sha256:131fd094d1065b19540c3d72594260f118b231090295d8c34e19a7bbcf2e860a"}, - {file = "cffi-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:31d13b0f99e0836b7ff893d37af07366ebc90b678b6664c955b54561fc36ef36"}, - {file = "cffi-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:582215a0e9adbe0e379761260553ba11c58943e4bbe9c36430c4ca6ac74b15ed"}, - {file = "cffi-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b29ebffcf550f9da55bec9e02ad430c992a87e5f512cd63388abb76f1036d8d2"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dc9b18bf40cc75f66f40a7379f6a9513244fe33c0e8aa72e2d56b0196a7ef872"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cb4a35b3642fc5c005a6755a5d17c6c8b6bcb6981baf81cea8bfbc8903e8ba8"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b86851a328eedc692acf81fb05444bdf1891747c25af7529e39ddafaf68a4f3f"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c0f31130ebc2d37cdd8e44605fb5fa7ad59049298b3f745c74fa74c62fbfcfc4"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f8e709127c6c77446a8c0a8c8bf3c8ee706a06cd44b1e827c3e6a2ee6b8c098"}, - {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:748dcd1e3d3d7cd5443ef03ce8685043294ad6bd7c02a38d1bd367cfd968e000"}, - {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8895613bcc094d4a1b2dbe179d88d7fb4a15cee43c052e8885783fac397d91fe"}, - {file = "cffi-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed86a35631f7bfbb28e108dd96773b9d5a6ce4811cf6ea468bb6a359b256b1e4"}, - {file = "cffi-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:3686dffb02459559c74dd3d81748269ffb0eb027c39a6fc99502de37d501faa8"}, - {file = "cffi-1.16.0.tar.gz", hash = "sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0"}, + {file = "cheader2json-0.0.0rc2-py3-none-any.whl", hash = "sha256:657e02d9a50846a2773ae2a6b2ad6d4c7fccef27255e6a98a46eaa1b9180e3c8"}, + {file = "cheader2json-0.0.0rc2.tar.gz", hash = "sha256:5e8f29780013bde315960f6c0cde23fc72b3a0e66eaaed9a0e24f0763336c592"}, ] [package.dependencies] -pycparser = "*" +click = "*" +libclang = "18.1.1" + +[package.extras] +dev = ["build", "pre-commit"] +docs = ["myst-parser", "sphinx"] +test = ["pytest"] [[package]] -name = "clang" -version = "14.0" -description = "libclang python bindings" +name = "click" +version = "8.1.7" +description = "Composable command line interface toolkit" optional = false -python-versions = "*" +python-versions = ">=3.7" +files = [ + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ - {file = "clang-14.0-py3-none-any.whl", hash = "sha256:049c7f7740f46f733fc96b5395910ffc57f56d4d61bca65b5556e9772d146deb"}, - {file = "clang-14.0.tar.gz", hash = "sha256:0fe241386d3b780666e032d8c2e482b1d434880185c685071aa38b78317e969f"}, + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] [[package]] -name = "pycparser" -version = "2.21" -description = "C parser in Python" +name = "libclang" +version = "18.1.1" +description = "Clang Python Bindings, mirrored from the official LLVM repo: https://github.com/llvm/llvm-project/tree/main/clang/bindings/python, to make the installation process easier." optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = "*" files = [ - {file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"}, - {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, + {file = "libclang-18.1.1-1-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:0b2e143f0fac830156feb56f9231ff8338c20aecfe72b4ffe96f19e5a1dbb69a"}, + {file = "libclang-18.1.1-py2.py3-none-macosx_10_9_x86_64.whl", hash = "sha256:6f14c3f194704e5d09769108f03185fce7acaf1d1ae4bbb2f30a72c2400cb7c5"}, + {file = "libclang-18.1.1-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:83ce5045d101b669ac38e6da8e58765f12da2d3aafb3b9b98d88b286a60964d8"}, + {file = "libclang-18.1.1-py2.py3-none-manylinux2010_x86_64.whl", hash = "sha256:c533091d8a3bbf7460a00cb6c1a71da93bffe148f172c7d03b1c31fbf8aa2a0b"}, + {file = "libclang-18.1.1-py2.py3-none-manylinux2014_aarch64.whl", hash = "sha256:54dda940a4a0491a9d1532bf071ea3ef26e6dbaf03b5000ed94dd7174e8f9592"}, + {file = "libclang-18.1.1-py2.py3-none-manylinux2014_armv7l.whl", hash = "sha256:cf4a99b05376513717ab5d82a0db832c56ccea4fd61a69dbb7bccf2dfb207dbe"}, + {file = "libclang-18.1.1-py2.py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:69f8eb8f65c279e765ffd28aaa7e9e364c776c17618af8bff22a8df58677ff4f"}, + {file = "libclang-18.1.1-py2.py3-none-win_amd64.whl", hash = "sha256:4dd2d3b82fab35e2bf9ca717d7b63ac990a3519c7e312f19fa8e86dcc712f7fb"}, + {file = "libclang-18.1.1-py2.py3-none-win_arm64.whl", hash = "sha256:3f0e1f49f04d3cd198985fea0511576b0aee16f9ff0e0f0cad7f9c57ec3c20e8"}, + {file = "libclang-18.1.1.tar.gz", hash = "sha256:a1214966d08d73d971287fc3ead8dfaf82eb07fb197680d8b3859dbbbbf78250"}, ] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "153b72b909db78e22ec7108416eb46a97d0acbc3ed3f9f904cd9a3da7618f0e0" +content-hash = "0b0352b74f86cfe0bdf8507e5b04c6cdf8bca226e79a69663d92843ae09a4ac4" diff --git a/pyproject.toml b/pyproject.toml index 2996fca..efea74e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,8 +7,7 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.10" -cffi = "^1.15.1" -clang = "14" +cheader2json = "^0.0.0rc2" [build-system] diff --git a/src/bindingGenerators/__init__.py b/src/bindingGenerators/__init__.py index c80d77e..e69de29 100644 --- a/src/bindingGenerators/__init__.py +++ b/src/bindingGenerators/__init__.py @@ -1,2 +0,0 @@ -from . import clangParser -from . import matlabBindingGenerator \ No newline at end of file diff --git a/src/bindingGenerators/clangParser.py b/src/bindingGenerators/clangParser.py deleted file mode 100644 index 4ea69b7..0000000 --- a/src/bindingGenerators/clangParser.py +++ /dev/null @@ -1,189 +0,0 @@ -''' -Copyright (c) 2017-2022, -Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable Energy, LLC. See -the top-level NOTICE for additional details. All rights reserved. -SPDX-License-Identifier: BSD-3-Clause -''' -import json -import logging -from typing import List - -import clang.cindex as cidx - - -clangLogger = logging.getLogger(__name__) -clangLogger.setLevel(logging.DEBUG) -logFormatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') -clangLogFileHandler = logging.FileHandler('clangParserLog.log',mode='w',encoding='utf-8') -clangLogStreamHandler = logging.StreamHandler() -clangLogFileHandler.setLevel(logging.DEBUG) -clangLogFileHandler.setFormatter(logFormatter) -clangLogStreamHandler.setLevel(logging.INFO) -clangLogStreamHandler.setFormatter(logFormatter) -clangLogger.addHandler(clangLogFileHandler) -clangLogger.addHandler(clangLogStreamHandler) - - -class HelicsHeaderParser (object): - """ - Class that will parse the HELICS C API headers and create other language bindings - - @ivar parsedInfo: a dictionary containing all the parsed cursors found in the HELICS C API headers - - """ - _types = {} - def __init__(self, helicsHeaders: List[str]): - """ - Constructor - """ - HelicsHeaderParser._types["functions"] = {} - self.parsedInfo = {} - self.headerFiles = helicsHeaders - self.parseHelicsHeaderFiles(helicsHeaders) - - - def _cursorInfo(self, node: cidx.Cursor) -> dict(): - """ - Helper function for parseHelicsHeaderFiles() - """ - cursorInfoDict = { - "kind" : node.kind.name, - "spelling" : node.spelling, - "location" : node.location.file.name, - "type" : node.type.kind.spelling, - "result_type" : node.result_type.kind.spelling, - "brief_comment" : node.brief_comment, - } - cursor_range = node.extent - cursorInfoDict["start_line"] = cursor_range.start.line - cursorInfoDict["end_line"] = cursor_range.end.line - if node.kind == cidx.CursorKind.FUNCTION_DECL: - cursorInfoDict["raw_comment"] = node.raw_comment - if node.result_type.kind == cidx.TypeKind.POINTER: - pointerType = node.result_type.get_pointee() - if pointerType.kind == cidx.TypeKind.POINTER: - cursorInfoDict["result_type"] = "Double Pointer" - cursorInfoDict["double_pointer_type"] = pointerType.get_pointee().kind.spelling + "_**" - else: - cursorInfoDict["pointer_type"] = pointerType.kind.spelling + "_*" - if node.result_type.kind == cidx.TypeKind.TYPEDEF: - cursorInfoDict["result_type"] = node.result_type.get_typedef_name() - if cursorInfoDict.get("result_type","") != "": - if cursorInfoDict.get("result_type","") not in HelicsHeaderParser._types.keys(): - HelicsHeaderParser._types[cursorInfoDict.get("result_type","")] = [cursorInfoDict.get("spelling","")] - else: - HelicsHeaderParser._types.get(cursorInfoDict.get("result_type",""),[]).append(cursorInfoDict.get("spelling","")) - if cursorInfoDict.get("pointer_type","") != "": - if cursorInfoDict.get("pointer_type","") not in HelicsHeaderParser._types.keys(): - HelicsHeaderParser._types[cursorInfoDict.get("pointer_type","")] = [cursorInfoDict.get("spelling","")] - else: - HelicsHeaderParser._types.get(cursorInfoDict.get("pointer_type",""),[]).append(cursorInfoDict.get("spelling","")) - if cursorInfoDict.get("double_pointer_type","") != "": - if cursorInfoDict.get("double_pointer_type","") not in HelicsHeaderParser._types.keys(): - HelicsHeaderParser._types[cursorInfoDict.get("double_pointer_type","")] = [cursorInfoDict.get("spelling","")] - else: - HelicsHeaderParser._types.get(cursorInfoDict.get("double_pointer_type",""),[]).append(cursorInfoDict.get("spelling","")) - cursorInfoDict["arguments"] = {} - argNum = 0 - for arg in node.get_arguments(): - cursorInfoDict["arguments"][argNum] = self._cursorInfo(arg) - argNum += 1 - cursorInfoDict["argument_count"] = argNum - HelicsHeaderParser._types["functions"][cursorInfoDict.get("spelling","")] = cursorInfoDict["arguments"] - if node.kind == cidx.CursorKind.PARM_DECL: - if node.type.kind == cidx.TypeKind.TYPEDEF: - cursorInfoDict["type"] = node.type.get_typedef_name() - if node.type.kind == cidx.TypeKind.POINTER: - typePointee = node.type.get_pointee() - if typePointee.kind == cidx.TypeKind.TYPEDEF: - cursorInfoDict["pointer_type"] = typePointee.get_typedef_name() + "_*" - elif typePointee.kind == cidx.TypeKind.POINTER: - cursorInfoDict["type"] = "Double Pointer" - cursorInfoDict["double_pointer_type"] = typePointee.get_pointee().kind.spelling + "_**" - else: - cursorInfoDict["pointer_type"] = typePointee.kind.spelling + "_*" - if cursorInfoDict.get("type","") != "": - if cursorInfoDict.get("type","") not in HelicsHeaderParser._types.keys(): - HelicsHeaderParser._types[cursorInfoDict.get("type","")] = [cursorInfoDict.get("spelling","")] - else: - HelicsHeaderParser._types.get(cursorInfoDict.get("type",""),[]).append(cursorInfoDict.get("spelling","")) - if cursorInfoDict.get("pointer_type","") != "": - if cursorInfoDict.get("pointer_type","") not in HelicsHeaderParser._types.keys(): - HelicsHeaderParser._types[cursorInfoDict.get("pointer_type","")] = [cursorInfoDict.get("spelling","")] - else: - HelicsHeaderParser._types.get(cursorInfoDict.get("pointer_type",""),[]).append(cursorInfoDict.get("spelling","")) - if cursorInfoDict.get("double_pointer_type","") != "": - if cursorInfoDict.get("double_pointer_type","") not in HelicsHeaderParser._types.keys(): - HelicsHeaderParser._types[cursorInfoDict.get("double_pointer_type","")] = [cursorInfoDict.get("spelling","")] - else: - HelicsHeaderParser._types.get(cursorInfoDict.get("double_pointer_type",""),[]).append(cursorInfoDict.get("spelling","")) - if node.kind == cidx.CursorKind.TYPEDEF_DECL or node.type.kind == cidx.TypeKind.TYPEDEF: - cursorInfoDict["type"] = node.underlying_typedef_type.spelling - if cursorInfoDict["type"] == "": - cursorInfoDict["type"] = node.type.get_typedef_name() - if node.kind == cidx.CursorKind.ENUM_DECL: - cursorInfoDict["enumerations"] = {} - enumNum = 0 - for i in node.get_children(): - cursorInfoDict["enumerations"][enumNum] = self._cursorInfo(i) - enumNum += 1 - if node.kind == cidx.CursorKind.ENUM_CONSTANT_DECL: - cursorInfoDict["value"] = node.enum_value - if node.kind == cidx.CursorKind.VAR_DECL: - tokens = [] - for t in node.get_tokens(): - tokens.append(t.spelling) - if tokens[len(tokens)-2] == "-": - value = tokens[len(tokens)-2]+tokens[len(tokens)-1] - else: - value = tokens[len(tokens)-1] - try: - cursorInfoDict["value"] = json.loads(value) - except: - cursorInfoDict["value"] = value - if node.kind == cidx.CursorKind.STRUCT_DECL: - cursorInfoDict["members"] = {} - memberNum = 0 - for i in node.get_children(): - cursorInfoDict["members"][memberNum] = self._cursorInfo(i) - memberNum += 1 - if node.kind == cidx.CursorKind.MACRO_DEFINITION: - value = '' - for t in node.get_tokens(): - value = t.spelling - try: - cursorInfoDict["value"] = json.loads(value) - except: - cursorInfoDict["value"] = value - return cursorInfoDict - - - def parseHelicsHeaderFiles(self, helicsHeaders: List[str]) -> None: - """ - Function that parses the HELICS C header files - @param helicsHeaders: A list of the HELICS C header files to parse - """ - ignoredMacros = ["HELICS_C_API_H_", "HELICS_EXPORT", "HELICS_DEPRECATED"] - idx = cidx.Index.create() - cursorNum = 0 - for headerFile in helicsHeaders: - tu = idx.parse(headerFile, options=cidx.TranslationUnit.PARSE_DETAILED_PROCESSING_RECORD) - for c in tu.cursor.get_children(): - location_file = c.location.file - if c.location.file != None: - if c.location.file.name == headerFile and c.displayname not in ignoredMacros: - self.parsedInfo[cursorNum] = self._cursorInfo(c) - cursorNum += 1 - deletekeys = [] - for key in self.parsedInfo.keys(): - - if self.parsedInfo[key]["spelling"] == "": - for i in self.parsedInfo.keys(): - if i != key: - if self.parsedInfo[key]["start_line"] == self.parsedInfo[i]["start_line"] and self.parsedInfo[key]["end_line"] == self.parsedInfo[i]["end_line"]: - self.parsedInfo[key]["spelling"] = self.parsedInfo[i]["spelling"] - deletekeys.append(i) - for key in deletekeys: - del self.parsedInfo[key] - clangLogger.info("Clang successfully parsed the HELICS header files!") - clangLogger.debug(f"The clang parser result:\n{json.dumps(self.parsedInfo, indent=4, sort_keys=True)}\n{json.dumps(HelicsHeaderParser._types, indent=4, sort_keys=True)}") \ No newline at end of file diff --git a/src/bindingGenerators/matlabBindingGenerator.py b/src/bindingGenerators/matlabBindingGenerator.py index e282994..7703e0a 100644 --- a/src/bindingGenerators/matlabBindingGenerator.py +++ b/src/bindingGenerators/matlabBindingGenerator.py @@ -6,12 +6,12 @@ ''' import json import logging -import os import re import shutil +from pathlib import Path from typing import Any, Dict, List, Tuple -from . import clangParser +from cheader2json.cheader_reader import CHeaderParser matlabBindingGeneratorLogger = logging.getLogger(__name__) @@ -41,8 +41,8 @@ def __init__(self, rootDir: str, headerFiles: List[str]): ''' Constructor ''' - self.__helicsParser = clangParser.HelicsHeaderParser(headerFiles) - self.__rootDir = os.path.abspath(rootDir) + self.__helicsParser = CHeaderParser(headerFiles, ["HELICS_C_API_H_", "HELICS_EXPORT", "HELICS_DEPRECATED"]) + self.__rootDir = Path(rootDir) def getParser(self): return self.__helicsParser @@ -54,7 +54,8 @@ def generateSource(self): def createBoilerPlate(headerFiles: List[str], helicsElementMapTuples) -> str: boilerPlateStr = "/*\n" boilerPlateStr += "Copyright (c) 2017-2022,\n" - boilerPlateStr += "Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable Energy, LLC. See\n" + boilerPlateStr += "Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for " + boilerPlateStr += "Sustainable Energy, LLC. See\n" boilerPlateStr += "the top-level NOTICE for additional details. All rights reserved.\n" boilerPlateStr += "SPDX-License-Identifier: BSD-3-Clause\n" boilerPlateStr += "*/\n" @@ -122,10 +123,15 @@ def createEnum(enumDict: Dict[str,str]) -> None: """ Create Matlab Binding Enumerations for each C Enumeration """ - matlabBindingGeneratorLogger.debug(f"creating MATLAB enum definition for:\n{json.dumps(enumDict,indent=4,sort_keys=True)}") + matlabBindingGeneratorLogger.debug("creating MATLAB enum definition for:\n" + f"{json.dumps(enumDict,indent=4,sort_keys=True)}") enumSpelling = enumDict.get('spelling','') enumComment = enumDict.get('brief_comment','') - with open(os.path.join(self.__rootDir, f"matlabBindings/+helics/{enumSpelling}.m"),"w") as enumMFile: + enumFileDir = self.__rootDir / "matlabBindings" / "+helics" + if not enumFileDir.is_dir(): + enumFileDir.mkdir(parents=True, exist_ok=True) + enumFile = enumFileDir / f"{enumSpelling}.m" + with enumFile.open(mode="w", encoding="utf-8") as enumMFile: enumMFile.write(f"% {enumComment}\n%\n% Attributes:") docStrBody = "" enumStrBody = "" @@ -145,24 +151,31 @@ def createEnum(enumDict: Dict[str,str]) -> None: def createMacro(macroDict: Dict[str,str], cursorIdx: int): - matlabBindingGeneratorLogger.debug(f"creating MATLAB macro definition for:\n{json.dumps(macroDict,indent=4,sort_keys=True)}") + matlabBindingGeneratorLogger.debug("creating MATLAB macro definition for:\n" + f"{json.dumps(macroDict,indent=4,sort_keys=True)}") macroSpelling = macroDict.get("spelling","") macroComment = macroDict.get("brief_comment","") macroValue = macroDict.get("value") macroWrapperStr = "" macroMainFunctionElementStr = "" macroMapTuple = None + macroFilePath = self.__rootDir / "matlabBindings" / "+helics" + if not macroFilePath.is_dir(): + macroFilePath.mkdir(parents=True, exist_ok=True) + macroFile = macroFilePath / f"{macroSpelling}.m" if isinstance(macroValue, str): - with open(os.path.join(self.__rootDir, f"matlabBindings/+helics/{macroSpelling}.m"), "w") as macroFile: - macroFile.write(f"function v = {macroSpelling}()\n") + with macroFile.open(mode="w", encoding="utf-8") as mh: + mh.write(f"function v = {macroSpelling}()\n") if macroComment != None: - macroFile.write(f"% {macroComment}\n") - macroFile.write(f"\tv = helicsMex('{macroSpelling}');\n") - macroFile.write("end\n") - macroWrapperStr += f"void _wrap_{macroSpelling}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" + mh.write(f"% {macroComment}\n") + mh.write(f"\tv = helicsMex('{macroSpelling}');\n") + mh.write("end\n") + macroWrapperStr += f"void _wrap_{macroSpelling}(int resc, mxArray *resv[], int argc, const mxArray " + macroWrapperStr += "*argv[])" + "{\n" macroWrapperStr += "\tif(argc != 0){\n" macroWrapperStr += "\t\tmexUnlock();\n" - macroWrapperStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{macroSpelling}:rhs\",\"This function doesn't take arguments.\");\n" + macroWrapperStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{macroSpelling}:rhs\",\"This function doesn't take " + macroWrapperStr += "arguments.\");\n" macroWrapperStr += "\t}\n" macroWrapperStr += "\tmxArray *_out = mxCreateNumericMatrix(1,1,mxINT64_CLASS,mxREAL);\n" macroWrapperStr += f"\t*((int64_t*)mxGetData(_out)) = (int64_t){macroSpelling};\n" @@ -173,12 +186,12 @@ def createMacro(macroDict: Dict[str,str], cursorIdx: int): macroMainFunctionElementStr += f"\t\tbreak;\n" macroMapTuple = (macroSpelling, cursorIdx) elif isinstance(macroValue, float) or isinstance(macroValue, int): - with open(os.path.join(self.__rootDir, f"matlabBindings/+helics/{macroSpelling}.m"), "w") as macroFile: - macroFile.write(f"function v = {macroSpelling}()\n") + with macroFile.open(mode="w", encoding="utf-8") as mh: + mh.write(f"function v = {macroSpelling}()\n") if macroComment != None: - macroFile.write(f"% {macroComment}\n") - macroFile.write(f"\tv = {macroValue};\n") - macroFile.write("end\n") + mh.write(f"% {macroComment}\n") + mh.write(f"\tv = {macroValue};\n") + mh.write("end\n") return macroWrapperStr, macroMainFunctionElementStr, macroMapTuple @@ -189,38 +202,44 @@ def createVar(varDict: Dict[str,str], cursorIdx: int): varType = varDict.get("type","") varValue = varDict.get("value") if varSpelling not in varsToIgnore: - matlabBindingGeneratorLogger.debug(f"creating MATLAB var definition for:\n{json.dumps(varDict,indent=4,sort_keys=True)}") + matlabBindingGeneratorLogger.debug("creating MATLAB var definition for:\n" + f"{json.dumps(varDict,indent=4,sort_keys=True)}") + varFilePath = self.__rootDir / "matlabBindings" / "+helics" + if not varFilePath.is_dir(): + varFilePath.mkdir(parents=True, exist_ok=True) + varFile = varFilePath / f"{varSpelling}.m" if isinstance(varValue, str): - with open(os.path.join(self.__rootDir, f"matlabBindings/+helics/{varSpelling}.m"), "w") as varFile: - varFile.write(f"function v = {varSpelling}()\n") + with varFile.open(mode="w", encoding="utf-8") as vh: + vh.write(f"function v = {varSpelling}()\n") if varComment != None: - varFile.write(f"% {varComment}\n") - varFile.write(f"\tv = {varValue}();\n") - varFile.write("end\n") + vh.write(f"% {varComment}\n") + vh.write(f"\tv = {varValue}();\n") + vh.write("end\n") elif isinstance(varValue, float): - with open(os.path.join(self.__rootDir, f"matlabBindings/+helics/{varSpelling}.m"), "w") as varFile: - varFile.write(f"function v = {varSpelling}()\n") + with varFile.open(mode="w", encoding="utf-8") as vh: + vh.write(f"function v = {varSpelling}()\n") if varComment != None: - varFile.write(f"% {varComment}\n") - varFile.write(f"\tv = {varValue};\n") - varFile.write("end\n") + vh.write(f"% {varComment}\n") + vh.write(f"\tv = {varValue};\n") + vh.write("end\n") elif isinstance(varValue, int): - with open(os.path.join(self.__rootDir, f"matlabBindings/+helics/{varSpelling}.m"), "w") as varFile: - varFile.write(f"function v = {varSpelling}()\n") + with varFile.open(mode="w", encoding="utf-8") as vh: + vh.write(f"function v = {varSpelling}()\n") if varComment != None: - varFile.write(f"% {varComment}\n") + vh.write(f"% {varComment}\n") if varType != "HelicsBool": - varFile.write(f"\tv = int32({varValue});\n") + vh.write(f"\tv = int32({varValue});\n") else: if varSpelling == "HELICS_TRUE": - varFile.write(f"\tv = true;\n") + vh.write(f"\tv = true;\n") elif varSpelling == "HELICS_FALSE": - varFile.write(f"\tv = false;\n") - varFile.write("end\n") + vh.write(f"\tv = false;\n") + vh.write("end\n") def createFunction(functionDict: Dict[str,str], cursorIdx: int): - matlabBindingGeneratorLogger.debug(f"creating MATLAB function definition for:\n{json.dumps(functionDict,indent=4,sort_keys=True)}") + matlabBindingGeneratorLogger.debug("creating MATLAB function definition for:\n" + f"{json.dumps(functionDict,indent=4,sort_keys=True)}") modifiedMatlabFunctionList = [ "helicsCreateBrokerFromArgs", "helicsCreateCoreFromArgs", @@ -287,7 +306,8 @@ def createFunction(functionDict: Dict[str,str], cursorIdx: int): return createModifiedMatlabFunction(functionDict, cursorIdx) if functionName not in functionsToIgnore: functionComment = functionDict.get("raw_comment") - matlabBindingGeneratorLogger.debug(f"the raw_comment before converting to a matlab help text:\n{functionComment}") + matlabBindingGeneratorLogger.debug("the raw_comment before converting to a matlab help text:\n" + f"{functionComment}") functionComment = re.sub("^/\*\*\n","",functionComment) functionComment = re.sub("^/\*\*(?=.)","%",functionComment) functionComment = re.sub("\n.*\*(?=[^/])","\n%",functionComment) @@ -297,25 +317,39 @@ def createFunction(functionDict: Dict[str,str], cursorIdx: int): functionComment = re.sub("\n.*@param\[in,out\] err.*\n","\n",functionComment) functionComment = re.sub("%(?=[^ ])", "% ",functionComment) functionComment += "\n\n" - matlabBindingGeneratorLogger.debug(f"the raw_comment after converting to a matlab help text:\n{functionComment}") - with open(os.path.join(self.__rootDir, f"matlabBindings/+helics/{functionName}.m"), "w") as functionMFile: + matlabBindingGeneratorLogger.debug("the raw_comment after converting to a matlab help text:\n" + f"{functionComment}") + functionFilePath = self.__rootDir / "matlabBindings" / "+helics" + if not functionFilePath.is_dir(): + functionFilePath.mkdir(parents=True, exist_ok=True) + functionFile = functionFilePath / f"{functionName}.m" + with functionFile.open(mode="w", encoding="utf-8") as functionMFile: functionMFile.write(f"function varargout = {functionName}(varargin)\n") functionMFile.write(functionComment) - functionMFile.write("\t[varargout{1:nargout}] = helicsMex(" + f"'{functionName}', varargin" + "{:});\n") + functionMStr = "\t[varargout{1:nargout}] = helicsMex(" + functionMStr += f"'{functionName}', varargin" + functionMStr += "{:});\n" + functionMFile.write(functionMStr) functionMFile.write("end\n") functionWrapperStr = "" functionMainElements = "" functionMainElements += f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" - functionWrapperStr += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" + functionMainElements += "\t\tbreak;\n" + functionWrapperStr += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray " + functionWrapperStr += "*argv[]){\n" lastArgPos, isLastArgOptional = isLastArgumentOptional(functionDict) functionWrapperStr += getNumberOfArgumentsCheckStr(functionDict,isLastArgOptional) for a in functionDict.get("arguments",{}).keys(): if a == lastArgPos: - functionWrapperStr += getArgInitializationStr(functionDict.get("arguments",{}).get(a,{}), int(a), functionName, isLastArgOptional) + functionWrapperStr += getArgInitializationStr(functionDict.get("arguments",{}).get(a,{}), + int(a), + functionName, + isLastArgOptional) else: - functionWrapperStr += getArgInitializationStr(functionDict.get("arguments",{}).get(a,{}), int(a), functionName) + functionWrapperStr += getArgInitializationStr(functionDict.get("arguments",{}).get(a,{}), + int(a), + functionName) if functionDict.get("result_type","") != "Void": functionWrapperStr += f"{getFunctionReturnInitializationStr(functionDict)} = {functionName}(" for a in functionDict.get("arguments",{}).keys(): @@ -377,17 +411,22 @@ def getNumberOfArgumentsCheckStr(functionDict: Dict[str,str], lastArgOptional=Fa if lastArgOptional: argCheckStr += f"\tif(argc < {argCount - 1} || argc > {argCount}){{\n" argCheckStr += "\t\tmexUnlock();\n" - argCheckStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires at least {argCount - 1} arguments and at most {argCount} arguments.\");\n" + argCheckStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires at least " + argCheckStr += f"{argCount - 1} arguments and at most {argCount} arguments.\");\n" argCheckStr += "\t}\n\n" else: argCheckStr += f"\tif(argc != {argCount}){{\n" argCheckStr += "\t\tmexUnlock();\n" - argCheckStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires {argCount} arguments.\");\n" + argCheckStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires " + argCheckStr += f"{argCount} arguments.\");\n" argCheckStr += "\t}\n\n" return argCheckStr - def getArgInitializationStr(argDict: Dict[str,str], argPos: int, functionName: str, isArgOptional: bool = False) -> str: + def getArgInitializationStr(argDict: Dict[str,str], + argPos: int, + functionName: str, + isArgOptional: bool = False) -> str: argInitTextMap = { "Char_S": initializeArgChar(argDict.get("spelling",""), argPos, functionName), "Char_S_*": initializeArgChar(argDict.get("spelling",""), argPos, functionName, isArgOptional), @@ -395,26 +434,63 @@ def getArgInitializationStr(argDict: Dict[str,str], argPos: int, functionName: s "Int": initializeArgInt(argDict.get("spelling",""), argPos, functionName), "Void_*": initializeArgVoidPtr(argDict.get("spelling",""), argPos, functionName), "HelicsBool": initializeArgHelicsBool(argDict.get("spelling",""), argPos, functionName), - "HelicsBroker": initializeArgHelicsClass("HelicsBroker", argDict.get("spelling",""), argPos, functionName), + "HelicsApp": initializeArgHelicsClass("HelicsApp", argDict.get("spelling",""), argPos, functionName), + "HelicsBroker": initializeArgHelicsClass("HelicsBroker", argDict.get("spelling",""), + argPos, + functionName), "HelicsCore": initializeArgHelicsClass("HelicsCore", argDict.get("spelling",""), argPos, functionName), - "HelicsDataBuffer": initializeArgHelicsClass("HelicsDataBuffer", argDict.get("spelling",""), argPos, functionName), - "HelicsDataTypes": initializeArgHelicsEnum("HelicsDataTypes", argDict.get("spelling",""), argPos, functionName), - "HelicsEndpoint": initializeArgHelicsClass("HelicsEndpoint", argDict.get("spelling",""), argPos, functionName), + "HelicsDataBuffer": initializeArgHelicsClass("HelicsDataBuffer", argDict.get("spelling",""), + argPos, + functionName), + "HelicsDataTypes": initializeArgHelicsEnum("HelicsDataTypes", argDict.get("spelling",""), + argPos, + functionName), + "HelicsEndpoint": initializeArgHelicsClass("HelicsEndpoint", argDict.get("spelling",""), + argPos, + functionName), "HelicsError_*": initializeArgHelicsErrorPtr(argDict.get("spelling","")), - "HelicsFederate": initializeArgHelicsClass("HelicsFederate", argDict.get("spelling",""), argPos, functionName), - "HelicsFederateInfo": initializeArgHelicsClass("HelicsFederateInfo", argDict.get("spelling",""), argPos, functionName), - "HelicsFilter": initializeArgHelicsClass("HelicsFilter", argDict.get("spelling",""), argPos, functionName), - "HelicsFilterTypes": initializeArgHelicsEnum("HelicsFilterTypes", argDict.get("spelling",""), argPos, functionName), - "HelicsInput": initializeArgHelicsClass("HelicsInput", argDict.get("spelling",""), argPos, functionName), - "HelicsIterationRequest": initializeArgHelicsEnum("HelicsIterationRequest", argDict.get("spelling",""), argPos, functionName), + "HelicsFederate": initializeArgHelicsClass("HelicsFederate", argDict.get("spelling",""), + argPos, + functionName), + "HelicsFederateInfo": initializeArgHelicsClass("HelicsFederateInfo", argDict.get("spelling",""), + argPos, + functionName), + "HelicsFilter": initializeArgHelicsClass("HelicsFilter", argDict.get("spelling",""), + argPos, + functionName), + "HelicsFilterTypes": initializeArgHelicsEnum("HelicsFilterTypes", argDict.get("spelling",""), + argPos, + functionName), + "HelicsInput": initializeArgHelicsClass("HelicsInput", argDict.get("spelling",""), + argPos, + functionName), + "HelicsIterationRequest": initializeArgHelicsEnum("HelicsIterationRequest", + argDict.get("spelling",""), + argPos, + functionName), "HelicsIterationResult_*": initializeArgHelicsIterationResultPtr(argDict.get("spelling","")), - "HelicsMessage": initializeArgHelicsClass("HelicsMessage", argDict.get("spelling",""), argPos, functionName), - "HelicsPublication": initializeArgHelicsClass("HelicsPublication", argDict.get("spelling",""), argPos, functionName), - "HelicsQuery": initializeArgHelicsClass("HelicsQuery", argDict.get("spelling",""), argPos, functionName), - "HelicsQueryBuffer": initializeArgHelicsClass("HelicsQueryBuffer", argDict.get("spelling",""), argPos, functionName), + "HelicsMessage": initializeArgHelicsClass("HelicsMessage", argDict.get("spelling",""), + argPos, + functionName), + "HelicsPublication": initializeArgHelicsClass("HelicsPublication", argDict.get("spelling",""), + argPos, + functionName), + "HelicsQuery": initializeArgHelicsClass("HelicsQuery", argDict.get("spelling",""), + argPos, + functionName), + "HelicsQueryBuffer": initializeArgHelicsClass("HelicsQueryBuffer", + argDict.get("spelling",""), + argPos, + functionName), "HelicsTime": initializeArgHelicsTime(argDict.get("spelling",""), argPos, functionName), - "HelicsTranslator": initializeArgHelicsClass("HelicsTranslator", argDict.get("spelling",""), argPos, functionName), - "HelicsTranslatorTypes": initializeArgHelicsEnum("HelicsTranslatorTypes", argDict.get("spelling",""), argPos, functionName), + "HelicsTranslator": initializeArgHelicsClass("HelicsTranslator", + argDict.get("spelling",""), + argPos, + functionName), + "HelicsTranslatorTypes": initializeArgHelicsEnum("HelicsTranslatorTypes", + argDict.get("spelling",""), + argPos, + functionName), "int32_t": initializeArgInt32_t(argDict.get("spelling",""), argPos, functionName), "int64_t": initializeArgInt64_t(argDict.get("spelling",""), argPos, functionName) } @@ -425,7 +501,8 @@ def getArgInitializationStr(argDict: Dict[str,str], argPos: int, functionName: s argType = argDict.get("type") argInitText = argInitTextMap.get(argType) if argInitText == None: - raise RuntimeError(f"Unhandled c argument type conversion for {argType}. Please update the argInitTextMap") + raise RuntimeError(f"Unhandled c argument type conversion for {argType}. Please update the " + "argInitTextMap") return argInitText @@ -437,6 +514,7 @@ def getFunctionReturnInitializationStr(functionDict: Dict[str,str]) -> str: "Int": "\tint result", "Void_*": "\tvoid *result", "HelicsBool": "\tHelicsBool result", + "HelicsApp": "\tHelicsApp result", "HelicsBroker": "\tHelicsBroker result", "HelicsCore": "\tHelicsCore result", "HelicsDataBuffer": "\tHelicsDataBuffer result", @@ -455,7 +533,7 @@ def getFunctionReturnInitializationStr(functionDict: Dict[str,str]) -> str: "int32_t": "\tint32_t result", "int64_t": "\tint64_t result", } - retStr = "" + retStr = "" returnType = functionDict.get('double_pointer_type') if returnType == None: returnType = functionDict.get('pointer_type') @@ -463,7 +541,9 @@ def getFunctionReturnInitializationStr(functionDict: Dict[str,str]) -> str: returnType = functionDict.get('result_type') retStr = returnTextMap.get(returnType) if retStr == None: - raise RuntimeError(f"Unhandled c return type conversion for {returnType}. Please update the returnTextMap. functionDict: {json.dumps(functionDict, indent=4, sort_keys=True)}") + raise RuntimeError(f"Unhandled c return type conversion for {returnType}. " + "Please update the returnTextMap. functionDict: " + f"{json.dumps(functionDict, indent=4, sort_keys=True)}") return retStr @@ -475,6 +555,7 @@ def getArgFunctionCallStr(argDict: Dict[str,str], position: int) -> str: "Int": argDefaultFunctionCall(argDict.get("spelling",""), position), "Void_*": argDefaultFunctionCall(argDict.get("spelling",""), position), "HelicsBool": argDefaultFunctionCall(argDict.get("spelling",""), position), + "HelicsApp": argDefaultFunctionCall(argDict.get("spelling",""), position), "HelicsBroker": argDefaultFunctionCall(argDict.get("spelling",""), position), "HelicsCore": argDefaultFunctionCall(argDict.get("spelling",""), position), "HelicsDataBuffer": argDefaultFunctionCall(argDict.get("spelling",""), position), @@ -505,7 +586,8 @@ def getArgFunctionCallStr(argDict: Dict[str,str], position: int) -> str: argType = argDict.get("type") argFunctionCallText = argFunctionCallTextMap.get(argType) if argFunctionCallText == None: - raise RuntimeError(f"Unhandled c argument type conversion for {argType}. Please update the argFunctionCallTextMap") + raise RuntimeError(f"Unhandled c argument type conversion for {argType}. Please update the " + "argFunctionCallTextMap.") return argFunctionCallText @@ -517,6 +599,7 @@ def getFunctionReturnConversionStr(functionDict: Dict[str,str]) -> str: "Int": returnIntTomxArray(), "Void_*": returnVoidPtrTomxArray(), "HelicsBool": returnHelicsBoolTomxArray(), + "HelicsApp": returnVoidPtrTomxArray(), "HelicsBroker": returnVoidPtrTomxArray(), "HelicsCore": returnVoidPtrTomxArray(), "HelicsDataBuffer": returnVoidPtrTomxArray(), @@ -543,7 +626,8 @@ def getFunctionReturnConversionStr(functionDict: Dict[str,str]) -> str: returnType = functionDict.get('result_type') retStr = returnTextMap.get(returnType) if retStr == None: - raise RuntimeError(f"Unhandled c return type conversion for {returnType}. Please update the returnTextMap. functionDict: {json.dumps(functionDict, indent=4, sort_keys=True)}") + raise RuntimeError(f"Unhandled c return type conversion for {returnType}. Please update the " + f"returnTextMap. functionDict: {json.dumps(functionDict, indent=4, sort_keys=True)}") return retStr @@ -555,6 +639,7 @@ def getArgFunctionCleanUpStr(argDict: Dict[str,str]) -> str: "Int": "", "Void_*": "", "HelicsBool": "", + "HelicsApp": "", "HelicsBroker": "", "HelicsCore": "", "HelicsDataBuffer": "", @@ -585,7 +670,8 @@ def getArgFunctionCleanUpStr(argDict: Dict[str,str]) -> str: argType = argDict.get("type") argCleanUpText = argCleanUpMap.get(argType) if argCleanUpText == None: - raise RuntimeError(f"Unhandled c argument type conversion for {argType}. Please update the argCleanupMap") + raise RuntimeError(f"Unhandled c argument type conversion for {argType}. Please update the " + "argCleanupMap.") return argCleanUpText @@ -594,13 +680,15 @@ def initializeArgChar(argName: str, position: int, functionName: str, argIsOptio if not argIsOptional: retStr += f"\tif(!mxIsChar(argv[{position}])){{\n" retStr += "\t\tmexUnlock();\n" - retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be a string.\");\n" + retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be " + retStr += "a string.\");\n" retStr += "\t}\n" else: retStr += f"\tif(argc > {position}){{\n" retStr += f"\t\tif(!mxIsChar(argv[{position}])){{\n" retStr += "\t\t\tmexUnlock();\n" - retStr += f"\t\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be a string.\");\n" + retStr += f"\t\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must " + retStr += "be a string.\");\n" retStr += "\t\t}\n" retStr += "\t}\n" retStr += f"\tchar *{argName} = nullptr;\n" @@ -617,7 +705,8 @@ def initializeArgChar(argName: str, position: int, functionName: str, argIsOptio def initializeArgDouble(argName: str, position: int, functionName: str) -> str: retStr = f"\tif(!mxIsNumeric(argv[{position}])){{\n" retStr += "\t\tmexUnlock();\n" - retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of type double.\");\n" + retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of " + retStr += "type double.\");\n" retStr += "\t}\n" retStr += f"\tdouble {argName} = mxGetScalar(argv[{position}]);\n\n" return retStr @@ -626,7 +715,8 @@ def initializeArgDouble(argName: str, position: int, functionName: str) -> str: def initializeArgInt(argName: str, position: int, functionName: str) -> str: retStr = f"\tif(!mxIsNumeric(argv[{position}])){{\n" retStr += "\t\tmexUnlock();\n" - retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of type integer.\");\n" + retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of " + retStr += "type integer.\");\n" retStr += "\t}\n" retStr += f"\t\tint {argName} = static_cast(mxGetScalar(argv[{position}]));\n\n" @@ -636,7 +726,8 @@ def initializeArgInt(argName: str, position: int, functionName: str) -> str: def initializeArgVoidPtr(argName: str, position: int, functionName: str) -> str: retStr = f"\tif(mxGetClassID(argv[{position}]) != mxUINT64_CLASS){{\n" retStr += "\t\tmexUnlock();\n" - retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of type uint64.\");\n" + retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of " + retStr += "type uint64.\");\n" retStr += "\t}\n" retStr += f"\t\tvoid *{argName} = mxGetData(argv[{position}]);\n\n" return retStr @@ -655,11 +746,13 @@ def initializeArgHelicsBool(argName: str, position: int, functionName: str) -> s retStr += f"\t\t\tp{argName} = mxGetLogicals(logical{argName});\n" retStr += "\t\t} else {\n" retStr += "\t\t\tmexUnlock();\n" - retStr += f"\t\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be a logical type or a 0 or 1.\");\n" + retStr += f"\t\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be a " + retStr += "logical type or a 0 or 1.\");\n" retStr += "\t\t}\n" retStr += "\t} else {\n" retStr += "\t\tmexUnlock();\n" - retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be a logical type or a 0 or 1.\");\n" + retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be a " + retStr += "logical type or a 0 or 1.\");\n" retStr += "\t}\n" retStr += f"\tHelicsBool {argName} = HELICS_FALSE;\n" retStr += f"\tif(p{argName}[0]){{\n" @@ -671,7 +764,8 @@ def initializeArgHelicsBool(argName: str, position: int, functionName: str) -> s def initializeArgHelicsClass(helicsClass: str, argName: str, position: int, functionName: str) -> str: retStr = f"\tif(mxGetClassID(argv[{position}]) != mxUINT64_CLASS){{\n" retStr += "\t\tmexUnlock();\n" - retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of type uint64.\");\n" + retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of " + retStr += "type uint64.\");\n" retStr += "\t}\n" retStr += f"\t{helicsClass} {argName} = *(static_cast<{helicsClass}*>(mxGetData(argv[{position}])));\n\n" return retStr @@ -680,7 +774,8 @@ def initializeArgHelicsClass(helicsClass: str, argName: str, position: int, func def initializeArgHelicsEnum(helicsEnum: str, argName: str, position: int, functionName: str) -> str: retStr = f"\tif(!mxIsNumeric(argv[{position}])){{\n" retStr += "\t\tmexUnlock();\n" - retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of type int32.\");\n" + retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of " + retStr += "type int32.\");\n" retStr += "\t}\n" retStr += f"\tint {argName}Int = static_cast(mxGetScalar(argv[{position}]));\n" retStr += f"\t{helicsEnum} {argName} = static_cast<{helicsEnum}>({argName}Int);\n\n" @@ -695,7 +790,8 @@ def initializeArgHelicsIterationResultPtr(argName: str) -> str: def initializeArgHelicsTime(argName: str, position: int, functionName: str) -> str: retStr = f"\tif(!mxIsNumeric(argv[{position}])){{\n" retStr += "\t\tmexUnlock();\n" - retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of type double.\");\n" + retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of " + retStr += "type double.\");\n" retStr += "\t}\n" retStr += f"\tHelicsTime {argName} = (HelicsTime)(mxGetScalar(argv[{position}]));\n\n" return retStr @@ -704,7 +800,8 @@ def initializeArgHelicsTime(argName: str, position: int, functionName: str) -> s def initializeArgInt32_t(argName: str, position: int, functionName: str) -> str: retStr = f"\tif(mxGetClassID(argv[{position}]) != mxINT32_CLASS){{\n" retStr += "\t\tmexUnlock();\n" - retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of type int32.\");\n" + retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of " + retStr += "type int32.\");\n" retStr += "\t}\n" retStr += f"\tmxInt32 *p{argName} = mxGetInt32s(argv[{position}]);\n" retStr += f"\tint32_t {argName} = static_cast(p{argName}[0]);\n\n" @@ -714,7 +811,8 @@ def initializeArgInt32_t(argName: str, position: int, functionName: str) -> str: def initializeArgInt64_t(argName: str, position: int, functionName: str) -> str: retStr = f"\tif(mxGetClassID(argv[{position}]) != mxINT64_CLASS){{\n" retStr += "\t\tmexUnlock();\n" - retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of type int64.\");\n" + retStr += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument {position+1} must be of " + retStr += "type int64.\");\n" retStr += "\t}\n" retStr += f"\tmxInt64 *p{argName} = mxGetInt64s(argv[{position}]);\n" retStr += f"\tint64_t {argName} = static_cast(p{argName}[0]);\n\n" @@ -882,18 +980,27 @@ def createModifiedMatlabFunction(functionDict: Dict[str,str], cursorIdx: int): "helicsCloseLibrary": helicsCloseLibraryMatlabWrapper, "helicsFederateInitializingEntryCallback": helicsFederateInitializingEntryCallbackMatlabWrapper, "helicsFederateExecutingEntryCallback": helicsFederateExecutingEntryCallbackMatlabWrapper, - "helicsFederateCosimulationTerminationCallback": helicsFederateCosimulationTerminationCallbackMatlabWrapper, + "helicsFederateCosimulationTerminationCallback": \ + helicsFederateCosimulationTerminationCallbackMatlabWrapper, "helicsFederateErrorHandlerCallback": helicsFederateErrorHandlerCallbackMatlabWrapper, "helicsCallbackFederateNextTimeCallback": helicsCallbackFederateNextTimeCallbackMatlabWrapper, - "helicsCallbackFederateNextTimeIterativeCallback": helicsCallbackFederateNextTimeIterativeCallbackMatlabWrapper, + "helicsCallbackFederateNextTimeIterativeCallback": \ + helicsCallbackFederateNextTimeIterativeCallbackMatlabWrapper, "helicsCallbackFederateInitializeCallback": helicsCallbackFederateInitializeCallbackMatlabWrapper } - functionComment, functionWrapper, functionMainElement = modifiedPythonFunctionList[functionDict.get("spelling","")](functionDict, cursorIdx) - - with open(os.path.join(self.__rootDir, f'matlabBindings/+helics/{functionDict.get("spelling","")}.m'), "w") as functionMFile: + functionComment, functionWrapper, functionMainElement = \ + modifiedPythonFunctionList[functionDict.get("spelling","")](functionDict, cursorIdx) + functionFilePath = self.__rootDir / "matlabBindings" / "+helics" + if not functionFilePath.is_dir(): + functionFilePath.mkdir(parents=True, exist_ok=True) + functionFile = functionFilePath / f"{functionDict.get("spelling","")}.m" + with functionFile.open(mode="w", encoding="utf-8") as functionMFile: functionMFile.write(f'function varargout = {functionDict.get("spelling","")}(varargin)\n') functionMFile.write(functionComment) - functionMFile.write("\t[varargout{1:nargout}] = helicsMex(" + f'\'{functionDict.get("spelling","")}\', varargin' + "{:});\n") + functionMStr = "\t[varargout{1:nargout}] = helicsMex(" + functionMStr += f"'{functionDict.get("spelling","")}', varargin" + functionMStr += "{:});\n" + functionMFile.write(functionMStr) functionMFile.write("end\n") return functionWrapper, functionMainElement, (functionDict.get("spelling",""), cursorIdx) @@ -905,7 +1012,8 @@ def helicsCreateCoreFromArgsMatlabWrapper(functionDict: Dict[str,str], cursorIdx raise RuntimeError("the function signature for helicsCreateCoreFromArgs has changed!") arg0 = functionDict.get("arguments", {}).get(0, {}) if arg0.get("spelling","") != "type" or arg0.get("pointer_type", "") != "Char_S_*": - raise RuntimeError(f"the function signature for helicsCreateCoreFromArgs has changed! arg: {arg0.get('spelling','')} type: {arg0.get('pointer_type','')}") + raise RuntimeError("the function signature for helicsCreateCoreFromArgs has changed! arg: " + f"{arg0.get('spelling','')} type: {arg0.get('pointer_type','')}") arg1 = functionDict.get("arguments", {}).get(1, {}) if arg1.get("spelling","") != "name" or arg1.get("pointer_type", "") != "Char_S_*": raise RuntimeError("the function signature for helicsCreateCoreFromArgs has changed!") @@ -924,19 +1032,22 @@ def helicsCreateCoreFromArgsMatlabWrapper(functionDict: Dict[str,str], cursorIdx functionComment += "%\t@param name The name of the core.\n" functionComment += "%\t@param arguments The list of string values from a command line.\n\n" functionComment += "%\t@return A HelicsCore object.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 3){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 3){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgChar("type", 0, functionName) functionWrapper += initializeArgChar("name", 1, functionName) functionWrapper += "\tint arg2 = 0;\n" functionWrapper += "\tchar **arg3;\n" functionWrapper += "\tint ii;\n" - functionWrapper += f"\tif(!mxIsCell(argv[2])){{\n" + functionWrapper += "\tif(!mxIsCell(argv[2])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 3 must be a cell array of strings.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 3 must be a cell " + functionWrapper += "array of strings.\");\n" functionWrapper += "\t}\n" functionWrapper += "\targ2 = static_cast(mxGetNumberOfElements(argv[2]));\n" functionWrapper += "\targ3 = static_cast(malloc((arg2)*sizeof(char *)));\n" @@ -960,7 +1071,7 @@ def helicsCreateCoreFromArgsMatlabWrapper(functionDict: Dict[str,str], cursorIdx functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -990,16 +1101,19 @@ def helicsCreateBrokerFromArgsMatlabWrapper(functionDict: Dict[str,str], cursorI functionComment += "%\t@param name The name of the core.\n" functionComment += "%\t@param arguments The list of string values from a command line.\n\n" functionComment += "%\t@return A HelicsBroker object.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 3){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 3){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgChar("type", 0, functionName) functionWrapper += initializeArgChar("name", 1, functionName) - functionWrapper += f"\tif(!mxIsCell(argv[2])){{\n" + functionWrapper += "\tif(!mxIsCell(argv[2])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 3 must be a cell array of strings.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 3 must be a cell " + functionWrapper += "array of strings.\");\n" functionWrapper += "\t}\n" functionWrapper += "\tint arg2 = 0;\n" functionWrapper += "\tchar **arg3;\n" @@ -1026,7 +1140,7 @@ def helicsCreateBrokerFromArgsMatlabWrapper(functionDict: Dict[str,str], cursorI functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1051,15 +1165,18 @@ def helicsFederateInfoLoadFromArgsMatlabWrapper(functionDict: Dict[str,str], cur functionComment = "%\tLoad federate info from command line arguments.\n\n" functionComment += "%\t@param fi A federateInfo object.\n" functionComment += "%\t@param arguments A list of strings from the command line.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFederateInfo", "fedInfo", 0, functionName) - functionWrapper += f"\tif(!mxIsCell(argv[1])){{\n" + functionWrapper += "\tif(!mxIsCell(argv[1])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be of cell array of strings.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be of " + functionWrapper += "cell array of strings.\");\n" functionWrapper += "\t}\n" functionWrapper += "\tint arg1 = 0;\n" functionWrapper += "\tchar **arg2;\n" @@ -1084,7 +1201,7 @@ def helicsFederateInfoLoadFromArgsMatlabWrapper(functionDict: Dict[str,str], cur functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1109,10 +1226,12 @@ def helicsEndpointSendBytesMatlabWrapper(functionDict: Dict[str,str], cursorIdx: functionComment = "%\tSend a message to the targeted destinations.\n\n" functionComment += "%\t@param endpoint The endpoint to send the data from.\n" functionComment += "%\t@param data The data to send.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsEndpoint", "endpoint", 0, functionName) functionWrapper += initializeArgChar("data", 1, functionName) @@ -1129,7 +1248,7 @@ def helicsEndpointSendBytesMatlabWrapper(functionDict: Dict[str,str], cursorIdx: functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1158,10 +1277,12 @@ def helicsEndpointSendBytesAtMatlabWrapper(functionDict: Dict[str,str], cursorId functionComment += "%\t@param endpoint The endpoint to send the data from.\n" functionComment += "%\t@param data The data to send.\n" functionComment += "%\t@param time The time to send the message at.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 3){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 3){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsEndpoint", "endpoint", 0, functionName) functionWrapper += initializeArgChar("data", 1, functionName) @@ -1179,7 +1300,7 @@ def helicsEndpointSendBytesAtMatlabWrapper(functionDict: Dict[str,str], cursorId functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1208,10 +1329,12 @@ def helicsEndpointSendBytesToMatlabWrapper(functionDict: Dict[str,str], cursorId functionComment += "%\t@param endpoint The endpoint to send the data from.\n" functionComment += "%\t@param data The data to send.\n" functionComment += "%\t@param dst The destination to send the message to.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 3){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 3){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsEndpoint", "endpoint", 0, functionName) functionWrapper += initializeArgChar("data", 1, functionName) @@ -1230,7 +1353,7 @@ def helicsEndpointSendBytesToMatlabWrapper(functionDict: Dict[str,str], cursorId functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1263,10 +1386,12 @@ def helicsEndpointSendBytesToAtMatlabWrapper(functionDict: Dict[str,str], cursor functionComment += "%\t@param data The data to send.\n" functionComment += "%\t@param dst The destination to send the message to.\n" functionComment += "%\t@param time The time to send the message at.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 4){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 4){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 4 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 4 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsEndpoint", "endpoint", 0, functionName) functionWrapper += initializeArgChar("data", 1, functionName) @@ -1286,7 +1411,7 @@ def helicsEndpointSendBytesToAtMatlabWrapper(functionDict: Dict[str,str], cursor functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1312,23 +1437,27 @@ def helicsFederateRequestTimeIterativeMatlabWrapper(functionDict: Dict[str,str], raise RuntimeError("the function signature for helicsFederateRequestTimeIterative has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tRequest an iterative time.\n\n" - functionComment += "%\t@details This call allows for finer grain control of the iterative process than /ref helicsFederateRequestTime. It takes a time and and\n" + functionComment += "%\t@details This call allows for finer grain control of the iterative process than " + functionComment += "/ref helicsFederateRequestTime. It takes a time and and\n" functionComment += "%\titeration request, and returns a time and iteration status.\n\n" functionComment += "%\t@param fed The federate to make the request of.\n" functionComment += "%\t@param requestTime The next desired time.\n" functionComment += "%\t@param iterate The requested iteration mode.\n\n" functionComment += "%\t@return granted time and HelicsIterationResult.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 3){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 3){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFederate", "fed", 0, functionName) functionWrapper += initializeArgHelicsTime("requestTime", 1, functionName) functionWrapper += initializeArgHelicsEnum("HelicsIterationRequest", "iterate", 2, functionName) functionWrapper += initializeArgHelicsIterationResultPtr("outIteration") functionWrapper += initializeArgHelicsErrorPtr("err") - functionWrapper += f"\tHelicsTime result = {functionName}(fed, requestTime, iterate, &outIteration, &err);\n\n" + functionWrapper += f"\tHelicsTime result = {functionName}(fed, requestTime, iterate, &outIteration, &err);" + functionWrapper += "\n\n" functionWrapper += returnDoubleTomxArray() functionWrapper += "\tif(_out){\n" functionWrapper += "\t\t--resc;\n" @@ -1344,7 +1473,7 @@ def helicsFederateRequestTimeIterativeMatlabWrapper(functionDict: Dict[str,str], functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1366,10 +1495,12 @@ def helicsFederateRequestTimeIterativeCompleteMatlabWrapper(functionDict: Dict[s functionComment = "%\tComplete an iterative time request asynchronous call.\n\n" functionComment += "%\t@param fed The federate to make the request of.\n\n" functionComment += "%\t@return tuple of HelicsTime and HelicsIterationResult.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFederate", "fed", 0, functionName) functionWrapper += initializeArgHelicsIterationResultPtr("outIteration") @@ -1390,7 +1521,7 @@ def helicsFederateRequestTimeIterativeCompleteMatlabWrapper(functionDict: Dict[s functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1418,10 +1549,12 @@ def helicsInputGetBytesMatlabWrapper(functionDict: Dict[str,str], cursorIdx: int functionComment = "%\tGet the raw data for the latest value of a subscription.\n\n" functionComment += "%\t@param ipt The input to get the data for.\n\n" functionComment += "%\t@return raw Bytes of the value, the value is uninterpreted raw bytes.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsInput", "ipt", 0, functionName) functionWrapper += "\tint maxDataLen = helicsInputGetByteCount(ipt) + 2;\n\n" @@ -1445,7 +1578,7 @@ def helicsInputGetBytesMatlabWrapper(functionDict: Dict[str,str], cursorIdx: int functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1464,10 +1597,12 @@ def helicsInputGetComplexObjectMatlabWrapper(functionDict: Dict[str,str], cursor functionComment = "%\tGet a complex value from an input object.\n\n" functionComment += "%\t@param ipt The input to get the data for.\n\n" functionComment += "%\t@return A complex number.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsInput", "ipt", 0, functionName) functionWrapper += initializeArgHelicsErrorPtr("err") @@ -1485,7 +1620,7 @@ def helicsInputGetComplexObjectMatlabWrapper(functionDict: Dict[str,str], cursor functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1510,10 +1645,12 @@ def helicsInputGetComplexMatlabWrapper(functionDict: Dict[str,str], cursorIdx: i functionComment = "%\tGet a complex value from an input object.\n\n" functionComment += "%\t@param ipt The input to get the data for.\n\n" functionComment += "%\t@return A complex number.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsInput", "ipt", 0, functionName) functionWrapper += "\tdouble values[2];\n\n" @@ -1531,7 +1668,7 @@ def helicsInputGetComplexMatlabWrapper(functionDict: Dict[str,str], cursorIdx: i functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1562,10 +1699,12 @@ def helicsInputGetNamedPointMatlabWrapper(functionDict: Dict[str,str], cursorIdx functionComment = "%\tGet a named point from a subscription.\n\n" functionComment += "%\t@param ipt The input to get the result for.\n\n" functionComment += "%\t@return a string and a double value for the named point\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsInput", "ipt", 0, functionName) functionWrapper += "\tint maxStringLen = helicsInputGetStringSize(ipt) + 2;\n\n" @@ -1593,7 +1732,7 @@ def helicsInputGetNamedPointMatlabWrapper(functionDict: Dict[str,str], cursorIdx functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1621,10 +1760,12 @@ def helicsInputGetStringMatlabWrapper(functionDict: Dict[str,str], cursorIdx: in functionComment = "%\tGet a string value from a subscription.\n\n" functionComment += "%\t@param ipt The input to get the string for.\n\n" functionComment += "%\t@return the string value.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsInput", "ipt", 0, functionName) functionWrapper += "\tint maxStringLen = helicsInputGetStringSize(ipt) + 2;\n\n" @@ -1647,7 +1788,7 @@ def helicsInputGetStringMatlabWrapper(functionDict: Dict[str,str], cursorIdx: in functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1675,10 +1816,12 @@ def helicsInputGetVectorMatlabWrapper(functionDict: Dict[str,str], cursorIdx: in functionComment = "%\tGet a vector from a subscription.\n\n" functionComment += "%\t@param ipt The input to get the vector for.\n\n" functionComment += "%\t@return a list of floating point values.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsInput", "ipt", 0, functionName) functionWrapper += "\tint maxLength = helicsInputGetVectorSize(ipt);\n\n" @@ -1686,7 +1829,8 @@ def helicsInputGetVectorMatlabWrapper(functionDict: Dict[str,str], cursorIdx: in functionWrapper += "\tint actualSize = 0;\n\n" functionWrapper += initializeArgHelicsErrorPtr("err") functionWrapper += f"\t{functionName}(ipt, data, maxLength, &actualSize, &err);\n\n" - functionWrapper += "\tmxDouble *result_data = static_cast(mxMalloc(actualSize * sizeof(mxDouble)));\n" + functionWrapper += "\tmxDouble *result_data = static_cast(mxMalloc(actualSize * " + functionWrapper += "sizeof(mxDouble)));\n" functionWrapper += "\tfor(int i=0; i(value->real), static_cast(value->imag), &err);\n\n" + functionWrapper += f"\t{functionName}(ipt, static_cast(value->real), " + functionWrapper += "static_cast(value->imag), &err);\n\n" functionWrapper += "\tmxArray *_out = nullptr;\n" functionWrapper += "\tif(_out){\n" functionWrapper += "\t\t--resc;\n" @@ -1846,7 +1999,7 @@ def helicsInputSetDefaultComplexMatlabWrapper(functionDict: Dict[str,str], curso functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1871,20 +2024,24 @@ def helicsInputSetDefaultVectorMatlabWrapper(functionDict: Dict[str,str], cursor functionComment = "%\tSet the default as a list of floats.\n\n" functionComment += "%\t@param ipt The input to get the data for.\n" functionComment += "%\t@param vectorInput The default list of floating point values.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsInput", "ipt", 0, functionName) - functionWrapper += f"\tif(!mxIsNumeric(argv[1])){{\n" + functionWrapper += "\tif(!mxIsNumeric(argv[1])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be an array of doubles.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be an " + functionWrapper += "array of doubles.\");\n" functionWrapper += "\t}\n" functionWrapper += "\tint vectorLength = static_cast(mxGetNumberOfElements(argv[1]));\n\n" functionWrapper += "\tdouble *vectorInput = static_cast(mxGetDoubles(argv[1]));\n\n" functionWrapper += initializeArgHelicsErrorPtr("err") - functionWrapper += f"\t{functionName}(ipt, static_cast(vectorInput), vectorLength, &err);\n\n" + functionWrapper += f"\t{functionName}(ipt, static_cast(vectorInput), vectorLength, &err);" + functionWrapper += "\n\n" functionWrapper += "\tmxArray *_out = nullptr;\n" functionWrapper += "\tif(_out){\n" functionWrapper += "\t\t--resc;\n" @@ -1894,7 +2051,7 @@ def helicsInputSetDefaultVectorMatlabWrapper(functionDict: Dict[str,str], cursor functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1919,15 +2076,18 @@ def helicsInputSetDefaultComplexVectorMatlabWrapper(functionDict: Dict[str,str], functionComment = "%\tSet the default as a list of floats.\n\n" functionComment += "%\t@param ipt The input to get the data for.\n" functionComment += "%\t@param vectorInput The default list of complex values.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsInput", "ipt", 0, functionName) - functionWrapper += f"\tif(!mxIsComplex(argv[1])){{\n" + functionWrapper += "\tif(!mxIsComplex(argv[1])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be of an array of type complex.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be of an " + functionWrapper += "array of type complex.\");\n" functionWrapper += "\t}\n" functionWrapper += "\tint vectorLength = static_cast(mxGetN(argv[1])*2);\n\n" functionWrapper += "\tdouble *vectorInput = static_cast(malloc(vectorLength * sizeof(double)));\n" @@ -1937,7 +2097,8 @@ def helicsInputSetDefaultComplexVectorMatlabWrapper(functionDict: Dict[str,str], functionWrapper += "\t\tvectorInput[2*i + 1] = vals[i].imag;\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsErrorPtr("err") - functionWrapper += f"\t{functionName}(ipt, static_cast(vectorInput), vectorLength, &err);\n\n" + functionWrapper += f"\t{functionName}(ipt, static_cast(vectorInput), vectorLength, &err);" + functionWrapper += "\n\n" functionWrapper += "\tmxArray *_out = nullptr;\n" functionWrapper += "\tif(_out){\n" functionWrapper += "\t\t--resc;\n" @@ -1947,7 +2108,7 @@ def helicsInputSetDefaultComplexVectorMatlabWrapper(functionDict: Dict[str,str], functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -1972,10 +2133,12 @@ def helicsMessageAppendDataMatlabWrapper(functionDict: Dict[str,str], cursorIdx: functionComment = "%\tAppend data to the payload.\n\n" functionComment += "%\t@param message The message object in question.\n" functionComment += "%\t@param data A string containing the message data to append.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsMessage", "message", 0, functionName) functionWrapper += initializeArgChar("data", 1, functionName) @@ -1991,7 +2154,7 @@ def helicsMessageAppendDataMatlabWrapper(functionDict: Dict[str,str], cursorIdx: functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2019,17 +2182,20 @@ def helicsMessageGetBytesMatlabWrapper(functionDict: Dict[str,str], cursorIdx: i functionComment = "%\tGet the raw data for a message object.\n\n" functionComment += "%\t@param message A message object to get the data for.\n\n" functionComment += "%\t@return Raw string data.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsMessage", "message", 0, functionName) functionWrapper += "\tint maxMessageLength = helicsMessageGetByteCount(message) + 2;\n\n" functionWrapper += "\tchar *data = static_cast(malloc(maxMessageLength));\n\n" functionWrapper += "\tint actualSize = 0;\n\n" functionWrapper += initializeArgHelicsErrorPtr("err") - functionWrapper += f"\t{functionName}(message, static_cast(data), maxMessageLength, &actualSize, &err);\n\n" + functionWrapper += f"\t{functionName}(message, static_cast(data), maxMessageLength, &actualSize, " + functionWrapper += "&err);\n\n" functionWrapper += "\tmwSize dims[2] = {1,static_cast(actualSize)};\n" functionWrapper += "\tmxArray *_out = mxCreateCharArray(2,dims);\n" functionWrapper += "\tmxChar *out_data = static_cast(mxGetData(_out));\n" @@ -2045,7 +2211,7 @@ def helicsMessageGetBytesMatlabWrapper(functionDict: Dict[str,str], cursorIdx: i functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2070,10 +2236,12 @@ def helicsMessageSetDataMatlabWrapper(functionDict: Dict[str,str], cursorIdx: in functionComment = "%\tSet the data payload of a message as raw data.\n\n" functionComment += "%\t@param message The message object in question.\n" functionComment += "%\t@param data A string containing the message data.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsMessage", "message", 0, functionName) functionWrapper += initializeArgChar("data", 1, functionName) @@ -2089,7 +2257,7 @@ def helicsMessageSetDataMatlabWrapper(functionDict: Dict[str,str], cursorIdx: in functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2114,10 +2282,12 @@ def helicsPublicationPublishBytesMatlabWrapper(functionDict: Dict[str,str], curs functionComment = "%\tPublish raw data.\n\n" functionComment += "%\t@param pub The publication to publish for.\n" functionComment += "%\t@param data the raw byte data to publish.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsPublication", "pub", 0, functionName) functionWrapper += initializeArgChar("data", 1, functionName) @@ -2133,7 +2303,7 @@ def helicsPublicationPublishBytesMatlabWrapper(functionDict: Dict[str,str], curs functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2158,15 +2328,18 @@ def helicsPublicationPublishComplexMatlabWrapper(functionDict: Dict[str,str], cu functionComment = "%\tPublish a complex number.\n\n" functionComment += "%\t@param pub The publication to publish for.\n" functionComment += "%\t@param value The complex number.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsPublication", "pub", 0, functionName) - functionWrapper += f"\tif(!mxIsComplex(argv[1])){{\n" + functionWrapper += "\tif(!mxIsComplex(argv[1])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be of type complex.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be of " + functionWrapper += "type complex.\");\n" functionWrapper += "\t}\n" functionWrapper += "\tmxComplexDouble *complexValue = mxGetComplexDoubles(argv[1]);\n" functionWrapper += "\tdouble value[2] = {complexValue[0].real, complexValue[0].imag};\n\n" @@ -2181,7 +2354,7 @@ def helicsPublicationPublishComplexMatlabWrapper(functionDict: Dict[str,str], cu functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2206,20 +2379,24 @@ def helicsPublicationPublishVectorMatlabWrapper(functionDict: Dict[str,str], cur functionComment = "%\tPublish a vector of doubles.\n\n" functionComment += "%\t@param pub The publication to publish for.\n" functionComment += "%\t@param vectorInput The list of floating point values.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsPublication", "pub", 0, functionName) - functionWrapper += f"\tif(!mxIsNumeric(argv[1])){{\n" + functionWrapper += "\tif(!mxIsNumeric(argv[1])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be an array of type double.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be an " + functionWrapper += "array of type double.\");\n" functionWrapper += "\t}\n" functionWrapper += "\tint vectorLength = static_cast(mxGetNumberOfElements(argv[1]));\n\n" functionWrapper += "\tdouble *vectorInput = static_cast(mxGetDoubles(argv[1]));\n\n" functionWrapper += initializeArgHelicsErrorPtr("err") - functionWrapper += f"\t{functionName}(pub, static_cast(vectorInput), vectorLength, &err);\n\n" + functionWrapper += f"\t{functionName}(pub, static_cast(vectorInput), vectorLength, &err);\n" + functionWrapper += "\n" functionWrapper += "\tmxArray *_out = nullptr;\n" functionWrapper += "\tif(_out){\n" functionWrapper += "\t\t--resc;\n" @@ -2229,7 +2406,7 @@ def helicsPublicationPublishVectorMatlabWrapper(functionDict: Dict[str,str], cur functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2254,15 +2431,18 @@ def helicsPublicationPublishComplexVectorMatlabWrapper(functionDict: Dict[str,st functionComment = "%\tPublish a vector of doubles.\n\n" functionComment += "%\t@param pub The publication to publish for.\n" functionComment += "%\t@param vectorInput The list of complex values.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsPublication", "pub", 0, functionName) - functionWrapper += f"\tif(!mxIsComplex(argv[1])){{\n" + functionWrapper += "\tif(!mxIsComplex(argv[1])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be an array of type complex.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be an " + functionWrapper += "array of type complex.\");\n" functionWrapper += "\t}\n" functionWrapper += "\tint vectorLength = static_cast(mxGetN(argv[1])*2);\n\n" functionWrapper += "\tdouble *vectorInput = static_cast(malloc(vectorLength * sizeof(double)));\n" @@ -2272,7 +2452,8 @@ def helicsPublicationPublishComplexVectorMatlabWrapper(functionDict: Dict[str,st functionWrapper += "\t\tvectorInput[2*i + 1] = vals[i].imag;\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsErrorPtr("err") - functionWrapper += f"\t{functionName}(pub, static_cast(vectorInput), vectorLength, &err);\n\n" + functionWrapper += f"\t{functionName}(pub, static_cast(vectorInput), vectorLength, &err);\n" + functionWrapper += "\n" functionWrapper += "\tmxArray *_out = nullptr;\n" functionWrapper += "\tif(_out){\n" functionWrapper += "\t\t--resc;\n" @@ -2282,7 +2463,7 @@ def helicsPublicationPublishComplexVectorMatlabWrapper(functionDict: Dict[str,st functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2305,13 +2486,17 @@ def helicsQueryBufferFillMatlabWrapper(functionDict: Dict[str,str], cursorIdx: i raise RuntimeError("the function signature for helicsQueryBufferFill has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tSet the data for a query callback.\n\n" - functionComment += "%\t@details There are many queries that HELICS understands directly, but it is occasionally useful to have a federate be able to respond to specific queries with answers specific to a federate.\n\n" + functionComment += "%\t@details There are many queries that HELICS understands directly, but it is " + functionComment += "occasionally useful to have a federate be able to respond to specific queries with " + functionComment += "answers specific to a federate.\n\n" functionComment += "%\t@param buffer The buffer received in a helicsQueryCallback.\n" functionComment += "%\t@param queryResult The string with the data to fill the buffer with.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsQueryBuffer", "buffer", 0, functionName) functionWrapper += initializeArgChar("queryResult", 1, functionName) @@ -2327,7 +2512,7 @@ def helicsQueryBufferFillMatlabWrapper(functionDict: Dict[str,str], cursorIdx: i functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2358,10 +2543,14 @@ def helicsBrokerSetLoggingCallbackMatlabWrapper(functionDict: Dict[str,str], cur raise RuntimeError("the function signature for helicsBrokerSetLoggingCallback has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tSet the logging callback to a broker\n\n" - functionComment += "%\t@details Add a logging callback function to a broker.\n%\t\tThe logging callback will be called when\n%\t\ta message flows into a broker from the core or from a broker.\n\n" + functionComment += "%\t@details Add a logging callback function to a broker.\n%\t\tThe logging callback " + functionComment += "will be called when\n%\t\ta message flows into a broker from the core or from a broker." + functionComment += "\n\n" functionComment += "%\t@param broker The broker object in which to set the callback.\n" - functionComment += "%\t@param logger A function handle with the signature void(int loglevel, string identifier, string message).\n" - functionWrapper = "void matlabBrokerLoggingCallback(int loglevel, const char* identifier, const char* message, void *userData){\n" + functionComment += "%\t@param logger A function handle with the signature void(int loglevel, string " + functionComment += "identifier, string message).\n" + functionWrapper = "void matlabBrokerLoggingCallback(int loglevel, const char* identifier, const char* " + functionWrapper += "message, void *userData){\n" functionWrapper += "\tmxArray *lhs;\n" functionWrapper += "\tmxArray *rhs[4];\n" functionWrapper += "\trhs[0] = reinterpret_cast(userData);\n" @@ -2376,10 +2565,12 @@ def helicsBrokerSetLoggingCallbackMatlabWrapper(functionDict: Dict[str,str], cur functionWrapper += "\tmxDestroyArray(rhs[2]);\n" functionWrapper += "\tmxDestroyArray(rhs[3]);\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsBroker", "broker", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" @@ -2394,7 +2585,7 @@ def helicsBrokerSetLoggingCallbackMatlabWrapper(functionDict: Dict[str,str], cur functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2417,10 +2608,13 @@ def helicsCoreSetLoggingCallbackMatlabWrapper(functionDict: Dict[str,str], curso raise RuntimeError("the function signature for helicsCoreSetLoggingCallback has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tSet the logging callback to a core\n\n" - functionComment += "%\t@details Add a logging callback function to a core.\n%\t\tThe logging callback will be called when\n%\t\ta message flows into a core from the core or from a broker.\n\n" + functionComment += "%\t@details Add a logging callback function to a core.\n%\t\tThe logging callback will " + functionComment += "be called when\n%\t\ta message flows into a core from the core or from a broker.\n\n" functionComment += "%\t@param core The core object in which to set the callback.\n" - functionComment += "%\t@param logger A function handle with the signature void(int loglevel, string identifier, string message).\n" - functionWrapper = "void matlabCoreLoggingCallback(int loglevel, const char* identifier, const char* message, void *userData){\n" + functionComment += "%\t@param logger A function handle with the signature void(int loglevel, string " + functionComment += "identifier, string message).\n" + functionWrapper = "void matlabCoreLoggingCallback(int loglevel, const char* identifier, const char* " + functionWrapper += "message, void *userData){\n" functionWrapper += "\tmxArray *lhs;\n" functionWrapper += "\tmxArray *rhs[4];\n" functionWrapper += "\trhs[0] = reinterpret_cast(userData);\n" @@ -2435,10 +2629,12 @@ def helicsCoreSetLoggingCallbackMatlabWrapper(functionDict: Dict[str,str], curso functionWrapper += "\tmxDestroyArray(rhs[2]);\n" functionWrapper += "\tmxDestroyArray(rhs[3]);\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsCore", "core", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" @@ -2453,7 +2649,7 @@ def helicsCoreSetLoggingCallbackMatlabWrapper(functionDict: Dict[str,str], curso functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2476,10 +2672,14 @@ def helicsFederateSetLoggingCallbackMatlabWrapper(functionDict: Dict[str,str], c raise RuntimeError("the function signature for helicsFederateSetLoggingCallback has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tSet the logging callback for a federate\n\n" - functionComment += "%\t@details Add a logging callback function for a federate.\n%\t\tThe logging callback will be called when\n%\t\ta message flows into a federate from the core or from a federate.\n\n" + functionComment += "%\t@details Add a logging callback function for a federate.\n%\t\tThe logging callback " + functionComment += "will be called when\n%\t\ta message flows into a federate from the core or from a " + functionComment += "federate.\n\n" functionComment += "%\t@param fed The federate object in which to set the callback.\n" - functionComment += "%\t@param logger A function handle with the signature void(int loglevel, string identifier, string message).\n" - functionWrapper = "void matlabFederateLoggingCallback(int loglevel, const char* identifier, const char* message, void *userData){\n" + functionComment += "%\t@param logger A function handle with the signature void(int loglevel, string " + functionComment += "identifier, string message).\n" + functionWrapper = "void matlabFederateLoggingCallback(int loglevel, const char* identifier, const char* " + functionWrapper += "message, void *userData){\n" functionWrapper += "\tmxArray *lhs;\n" functionWrapper += "\tmxArray *rhs[4];\n" functionWrapper += "\trhs[0] = reinterpret_cast(userData);\n" @@ -2494,10 +2694,12 @@ def helicsFederateSetLoggingCallbackMatlabWrapper(functionDict: Dict[str,str], c functionWrapper += "\tmxDestroyArray(rhs[2]);\n" functionWrapper += "\tmxDestroyArray(rhs[3]);\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFederate", "fed", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" @@ -2512,7 +2714,7 @@ def helicsFederateSetLoggingCallbackMatlabWrapper(functionDict: Dict[str,str], c functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2535,9 +2737,11 @@ def helicsFilterSetCustomCallbackMatlabWrapper(functionDict: Dict[str,str], curs raise RuntimeError("the function signature for helicsFilterSetCustomCallback has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tSet a general callback for a custom filter.\n\n" - functionComment += "%\t@details Add a custom filter callback function for creating a custom filter operation in the c shared library.\n\n" + functionComment += "%\t@details Add a custom filter callback function for creating a custom filter " + functionComment += "operation in the c shared library.\n\n" functionComment += "%\t@param filter The filter object in which to set the callback.\n" - functionComment += "%\t@param filtCall A function handle with the signature HelicsMessage(HelicsMessage message).\n" + functionComment += "%\t@param filtCall A function handle with the signature HelicsMessage(HelicsMessage " + functionComment += "message).\n" functionWrapper = "HelicsMessage matlabFilterCustomCallback(HelicsMessage message, void *userData){\n" functionWrapper += "\tmxArray *lhs[1];\n" functionWrapper += "\tmxArray *rhs[2];\n" @@ -2550,10 +2754,12 @@ def helicsFilterSetCustomCallbackMatlabWrapper(functionDict: Dict[str,str], curs functionWrapper += "\tmxDestroyArray(rhs[1]);\n" functionWrapper += "\treturn rv;\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFilter", "filter", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" @@ -2568,7 +2774,7 @@ def helicsFilterSetCustomCallbackMatlabWrapper(functionDict: Dict[str,str], curs functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2591,10 +2797,14 @@ def helicsFederateSetQueryCallbackMatlabWrapper(functionDict: Dict[str,str], cur raise RuntimeError("the function signature for helicsFederateSetQueryCallback has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tSet callback for queries executed against a federate.\n\n" - functionComment += "%\t@details There are many queries that HELICS understands directly, but it is occasionally useful to a have a federate be able to respond\n%\ttospecific queries with answers specific to a federate.\n\n" + functionComment += "%\t@details There are many queries that HELICS understands directly, but it is " + functionComment += "occasionally useful to a have a federate be able to respond\n%\ttospecific queries " + functionComment += "with answers specific to a federate.\n\n" functionComment += "%\t@param fed The federate object in which to set the callback.\n" - functionComment += "%\t@param queryAnswer A function handle with the signature const void(const char *query, int querySize, HelicsQueryBuffer buffer).\n" - functionWrapper = "void matlabFederateQueryCallback(const char* query, int querySize, HelicsQueryBuffer buffer, void *userData){\n" + functionComment += "%\t@param queryAnswer A function handle with the signature const void(const char " + functionComment += "*query, int querySize, HelicsQueryBuffer buffer).\n" + functionWrapper = "void matlabFederateQueryCallback(const char* query, int querySize, HelicsQueryBuffer " + functionWrapper += "buffer, void *userData){\n" functionWrapper += "\tmxArray *lhs;\n" functionWrapper += "\tmxArray *rhs[4];\n" functionWrapper += "\tmwSize dims[2] = {1, static_cast(querySize)};\n" @@ -2615,10 +2825,12 @@ def helicsFederateSetQueryCallbackMatlabWrapper(functionDict: Dict[str,str], cur functionWrapper += "\tmxDestroyArray(rhs[2]);\n" functionWrapper += "\tmxDestroyArray(rhs[3]);\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFilter", "filter", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" @@ -2633,7 +2845,7 @@ def helicsFederateSetQueryCallbackMatlabWrapper(functionDict: Dict[str,str], cur functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2656,10 +2868,13 @@ def helicsFederateSetTimeUpdateCallbackMatlabWrapper(functionDict: Dict[str,str] raise RuntimeError("the function signature for helicsFederateSetTimeUpdateCallback has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tSet callback for the federate time update.n\n" - functionComment += "%\t@details This callback will be executed every time the simulation time is updated starting on entry to executing mode.\n\n" + functionComment += "%\t@details This callback will be executed every time the simulation time is updated " + functionComment += "starting on entry to executing mode.\n\n" functionComment += "%\t@param fed The federate object in which to set the callback.\n" - functionComment += "%\t@param timeUpdate A function handle with the signature void(double newTime, int iterating).\n" - functionWrapper = "void matlabFederateTimeUpdateCallback(HelicsTime newTime, HelicsBool iterating, void *userData){\n" + functionComment += "%\t@param timeUpdate A function handle with the signature void(double newTime, int " + functionComment += "iterating).\n" + functionWrapper = "void matlabFederateTimeUpdateCallback(HelicsTime newTime, HelicsBool iterating, void " + functionWrapper += "*userData){\n" functionWrapper += "\tmxArray *lhs;\n" functionWrapper += "\tmxArray *rhs[3];\n" functionWrapper += "\trhs[0] = reinterpret_cast(userData);\n" @@ -2675,10 +2890,12 @@ def helicsFederateSetTimeUpdateCallbackMatlabWrapper(functionDict: Dict[str,str] functionWrapper += "\tmxDestroyArray(rhs[1]);\n" functionWrapper += "\tmxDestroyArray(rhs[2]);\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFederate", "fed", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" @@ -2693,7 +2910,7 @@ def helicsFederateSetTimeUpdateCallbackMatlabWrapper(functionDict: Dict[str,str] functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2716,10 +2933,13 @@ def helicsFederateSetStateChangeCallbackMatlabWrapper(functionDict: Dict[str,str raise RuntimeError("the function signature for helicsFederateSetStateChangeCallback has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tSet callback for the federate mode change.n\n" - functionComment += "%\t@details This callback will be executed every time the operating mode of the federate changes.\n\n" + functionComment += "%\t@details This callback will be executed every time the operating mode of the " + functionComment += "federate changes.\n\n" functionComment += "%\t@param fed The federate object in which to set the callback.\n" - functionComment += "%\t@param stateChange A function handle with the signature void(int newState, int oldState).\n" - functionWrapper = "void matlabFederateSetStateChangeCallback(HelicsFederateState newState, HelicsFederateState oldState, void *userData){\n" + functionComment += "%\t@param stateChange A function handle with the signature void(int newState, int " + functionComment += "oldState).\n" + functionWrapper = "void matlabFederateSetStateChangeCallback(HelicsFederateState newState, " + functionWrapper += "HelicsFederateState oldState, void *userData){\n" functionWrapper += "\tmxArray *lhs;\n" functionWrapper += "\tmxArray *rhs[3];\n" functionWrapper += "\trhs[0] = reinterpret_cast(userData);\n" @@ -2734,10 +2954,12 @@ def helicsFederateSetStateChangeCallbackMatlabWrapper(functionDict: Dict[str,str functionWrapper += "\tmxDestroyArray(rhs[1]);\n" functionWrapper += "\tmxDestroyArray(rhs[2]);\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFederate", "fed", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" @@ -2752,7 +2974,7 @@ def helicsFederateSetStateChangeCallbackMatlabWrapper(functionDict: Dict[str,str functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2776,10 +2998,13 @@ def helicsFederateSetTimeRequestEntryCallbackMatlabWrapper(functionDict: Dict[st functionName = functionDict.get("spelling","") functionComment = "%\tSet callback for the federate time request.n\n" functionComment += "%\t@details This callback will be executed when a valid time request is made.\n" - functionComment += "%\tIt is intended for the possibility of embedded data grabbers in a callback to simplify user code.\n\n" + functionComment += "%\tIt is intended for the possibility of embedded data grabbers in a callback to " + functionComment += "simplify user code.\n\n" functionComment += "%\t@param fed The federate object in which to set the callback.\n" - functionComment += "%\t@param requestTime A callback with the signature void(double currentTime, double requestTime, bool iterating).\n" - functionWrapper = "void matlabFederateSetTimeRequestEntryCallback(HelicsTime currentTime, HelicsTime requestTime, HelicsBool iterating, void *userData){\n" + functionComment += "%\t@param requestTime A callback with the signature void(double currentTime, double " + functionComment += "requestTime, bool iterating).\n" + functionWrapper = "void matlabFederateSetTimeRequestEntryCallback(HelicsTime currentTime, HelicsTime " + functionWrapper += "requestTime, HelicsBool iterating, void *userData){\n" functionWrapper += "\tmxArray *lhs;\n" functionWrapper += "\tmxArray *rhs[4];\n" functionWrapper += "\trhs[0] = reinterpret_cast(userData);\n" @@ -2797,10 +3022,12 @@ def helicsFederateSetTimeRequestEntryCallbackMatlabWrapper(functionDict: Dict[st functionWrapper += "\tmxDestroyArray(rhs[2]);\n" functionWrapper += "\tmxDestroyArray(rhs[3]);\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFederate", "fed", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" @@ -2815,7 +3042,7 @@ def helicsFederateSetTimeRequestEntryCallbackMatlabWrapper(functionDict: Dict[st functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2838,11 +3065,15 @@ def helicsFederateSetTimeRequestReturnCallbackMatlabWrapper(functionDict: Dict[s raise RuntimeError("the function signature for helicsFederateSetTimeRequestReturnCallback has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tSet callback for the federate time request return.n\n" - functionComment += "%\t@details This callback will be executed when after all other callbacks for a time request return.\n" - functionComment += "%\tThis callback will be the last thing executed before returning control the user program.\n\n" + functionComment += "%\t@details This callback will be executed when after all other callbacks for a time " + functionComment += "request return.\n" + functionComment += "%\tThis callback will be the last thing executed before returning control the user " + functionComment += "program.\n\n" functionComment += "%\t@param fed The federate object in which to set the callback.\n" - functionComment += "%\t@param requestTimeReturn A callback with the signature void(double newTime, bool iterating).\n" - functionWrapper = "void matlabFederateSetTimeRequestReturnCallback(HelicsTime newTime, HelicsBool iterating, void *userData){\n" + functionComment += "%\t@param requestTimeReturn A callback with the signature void(double newTime, bool " + functionComment += "iterating).\n" + functionWrapper = "void matlabFederateSetTimeRequestReturnCallback(HelicsTime newTime, HelicsBool " + functionWrapper += "iterating, void *userData){\n" functionWrapper += "\tmxArray *lhs;\n" functionWrapper += "\tmxArray *rhs[3];\n" functionWrapper += "\trhs[0] = reinterpret_cast(userData);\n" @@ -2858,15 +3089,18 @@ def helicsFederateSetTimeRequestReturnCallbackMatlabWrapper(functionDict: Dict[s functionWrapper += "\tmxDestroyArray(rhs[1]);\n" functionWrapper += "\tmxDestroyArray(rhs[2]);\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFederate", "fed", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" functionWrapper += initializeArgHelicsErrorPtr("err") - functionWrapper += f"\t{functionName}(fed, &matlabFederateSetTimeRequestReturnCallback, userData, &err);\n\n" + functionWrapper += f"\t{functionName}(fed, &matlabFederateSetTimeRequestReturnCallback, userData, &err);\n" + functionWrapper += "\n" functionWrapper += "\tmxArray *_out = nullptr;\n" functionWrapper += "\tif(_out){\n" functionWrapper += "\t\t--resc;\n" @@ -2876,7 +3110,7 @@ def helicsFederateSetTimeRequestReturnCallbackMatlabWrapper(functionDict: Dict[s functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2902,11 +3136,15 @@ def helicsTranslatorSetCustomCallbackMatlabWrapper(functionDict: Dict[str,str], raise RuntimeError("the function signature for helicsTranslatorSetCustomCallback has changed!") functionName = functionDict.get("spelling","") functionComment = "%\tSet a general callback for a custom Translator.n\n" - functionComment += "%\t@details Add a pair of custom callbacks for running a translator operation in the C shared library.\n" + functionComment += "%\t@details Add a pair of custom callbacks for running a translator operation in the C " + functionComment += "shared library.\n" functionComment += "%\t@param translator The translator object to set the callbacks for.\n" - functionComment += "%\t@param toMessageCall A callback with the signature void(HelicsDataBuffer, HelicsMessage).\n" - functionComment += "%\t@param toValueCall A callback with the signature void(HelicsMessage, HelicsDataBuffer).\n" - functionWrapper = "void matlabToMessageCallCallback(HelicsDataBuffer value, HelicsMessage message, void *userData){\n" + functionComment += "%\t@param toMessageCall A callback with the signature void(HelicsDataBuffer, " + functionComment += "HelicsMessage).\n" + functionComment += "%\t@param toValueCall A callback with the signature void(HelicsMessage, " + functionComment += "HelicsDataBuffer).\n" + functionWrapper = "void matlabToMessageCallCallback(HelicsDataBuffer value, HelicsMessage message, void " + functionWrapper += "*userData){\n" functionWrapper += "\tmxArray *lhs;\n" functionWrapper += "\tmxArray *rhs[3];\n" functionWrapper += "\trhs[0] = static_cast(userData)[0];\n" @@ -2921,7 +3159,8 @@ def helicsTranslatorSetCustomCallbackMatlabWrapper(functionDict: Dict[str,str], functionWrapper += "\tmxDestroyArray(rhs[1]);\n" functionWrapper += "\tmxDestroyArray(rhs[2]);\n" functionWrapper += "}\n\n" - functionWrapper += "void matlabToValueCallCallback(HelicsMessage message, HelicsDataBuffer value, void *userData){\n" + functionWrapper += "void matlabToValueCallCallback(HelicsMessage message, HelicsDataBuffer value, void " + functionWrapper += "*userData){\n" functionWrapper += "\tmxArray *lhs;\n" functionWrapper += "\tmxArray *rhs[3];\n" functionWrapper += "\trhs[0] = static_cast(userData)[1];\n" @@ -2936,10 +3175,12 @@ def helicsTranslatorSetCustomCallbackMatlabWrapper(functionDict: Dict[str,str], functionWrapper += "\tmxDestroyArray(rhs[1]);\n" functionWrapper += "\tmxDestroyArray(rhs[2]);\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 3){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 3){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 3 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsTranslator", "translator", 0, functionName) functionWrapper += "\tmxArray *callbacks[2];\n" @@ -2947,7 +3188,8 @@ def helicsTranslatorSetCustomCallbackMatlabWrapper(functionDict: Dict[str,str], functionWrapper += "\tcallbacks[1] = const_cast(argv[2]);\n" functionWrapper += "\tvoid *userData = reinterpret_cast(callbacks);\n" functionWrapper += initializeArgHelicsErrorPtr("err") - functionWrapper += f"\t{functionName}(translator, &matlabToMessageCallCallback, &matlabToValueCallCallback, userData, &err);\n\n" + functionWrapper += f"\t{functionName}(translator, &matlabToMessageCallCallback, " + functionWrapper += "&matlabToValueCallCallback, userData, &err);\n\n" functionWrapper += "\tmxArray *_out = nullptr;\n" functionWrapper += "\tif(_out){\n" functionWrapper += "\t\t--resc;\n" @@ -2957,7 +3199,7 @@ def helicsTranslatorSetCustomCallbackMatlabWrapper(functionDict: Dict[str,str], functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -2980,15 +3222,18 @@ def helicsDataBufferFillFromComplexMatlabWrapper(functionDict: Dict[str,str], cu functionComment += "%\t@param data The helicsDataBuffer to fill.\n" functionComment += "%\t@param value The complex value.\n" functionComment += "%\t@return int The buffer size.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsDataBuffer", "data", 0, functionName) - functionWrapper += f"\tif(!mxIsComplex(argv[1])){{\n" + functionWrapper += "\tif(!mxIsComplex(argv[1])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 1 must be of type complex.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 1 must be of " + functionWrapper += "type complex.\");\n" functionWrapper += "\t}\n\n" functionWrapper += "\tmxComplexDouble *value = mxGetComplexDoubles(argv[1]);\n\n" functionWrapper += f"\tint32_t result = {functionName}(data, value->real, value->imag);\n\n" @@ -3002,7 +3247,7 @@ def helicsDataBufferFillFromComplexMatlabWrapper(functionDict: Dict[str,str], cu functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -3025,19 +3270,23 @@ def helicsDataBufferFillFromVectorMatlabWrapper(functionDict: Dict[str,str], cur functionComment += "%\t@param data The helicsDataBuffer to fill.\n" functionComment += "%\t@param value The vector of doubles.\n" functionComment += "%\t@return int The buffer size.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsDataBuffer", "data", 0, functionName) - functionWrapper += f"\tif(!mxIsNumeric(argv[1])){{\n" + functionWrapper += "\tif(!mxIsNumeric(argv[1])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 1 must be an array of doubles.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 1 must be an " + functionWrapper += "array of doubles.\");\n" functionWrapper += "\t}\n" functionWrapper += "\tint dataSize = static_cast(mxGetNumberOfElements(argv[1]));\n\n" functionWrapper += "\tdouble *value = static_cast(mxGetDoubles(argv[1]));\n\n" - functionWrapper += f"\tint32_t result = {functionName}(data, static_cast(value), dataSize);\n\n" + functionWrapper += f"\tint32_t result = {functionName}(data, static_cast(value), dataSize);" + functionWrapper += "\n\n" functionWrapper += "\tmxArray *_out = mxCreateNumericMatrix(1, 1, mxINT32_CLASS, mxREAL);\n" functionWrapper += "\tmxInt32 *rv = mxGetInt32s(_out);\n" functionWrapper += "\trv[0] = static_cast(result);\n" @@ -3048,7 +3297,7 @@ def helicsDataBufferFillFromVectorMatlabWrapper(functionDict: Dict[str,str], cur functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -3056,30 +3305,37 @@ def helicsDataBufferFillFromComplexVectorMatlabWrapper(functionDict: Dict[str,st #check to see if function signiture changed argNum = len(functionDict.get("arguments", {}).keys()) if argNum != 3: - raise RuntimeError("the function signature for helicsDataBufferFillFromComplexVectorMatlabWrapper has changed!") + raise RuntimeError("the function signature for helicsDataBufferFillFromComplexVectorMatlabWrapper has " + "changed!") arg0 = functionDict.get("arguments", {}).get(0, {}) if arg0.get("spelling","") != "data" or arg0.get("type", "") != "HelicsDataBuffer": - raise RuntimeError("the function signature for helicsDataBufferFillFromComplexVectorMatlabWrapper has changed!") + raise RuntimeError("the function signature for helicsDataBufferFillFromComplexVectorMatlabWrapper has " + "changed!") arg1 = functionDict.get("arguments", {}).get(1, {}) if arg1.get("spelling","") != "value" or arg1.get("pointer_type", "") != "Double_*": - raise RuntimeError("the function signature for helicsDataBufferFillFromComplexVectorMatlabWrapper has changed!") + raise RuntimeError("the function signature for helicsDataBufferFillFromComplexVectorMatlabWrapper has " + "changed!") arg2 = functionDict.get("arguments", {}).get(2, {}) if arg2.get("spelling","") != "dataSize" or arg2.get("type", "") != "Int": - raise RuntimeError("the function signature for helicsDataBufferFillFromComplexVectorMatlabWrapper has changed!") + raise RuntimeError("the function signature for helicsDataBufferFillFromComplexVectorMatlabWrapper has " + "changed!") functionName = functionDict.get("spelling","") functionComment = "%\tconvert a complex vector to serialized bytes.\n\n" functionComment += "%\t@param data The helicsDataBuffer to fill.\n" functionComment += "%\t@param value The vector of complex values.\n" functionComment += "%\t@return int The buffer size.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsDataBuffer", "data", 0, functionName) - functionWrapper += f"\tif(!mxIsComplex(argv[1])){{\n" + functionWrapper += "\tif(!mxIsComplex(argv[1])){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be of an array of type complex.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:TypeError\",\"Argument 2 must be of an " + functionWrapper += "array of type complex.\");\n" functionWrapper += "\t}\n" functionWrapper += "\tint dataSize = static_cast(mxGetN(argv[1])*2);\n\n" functionWrapper += "\tdouble *value = static_cast(malloc(dataSize * sizeof(double)));\n" @@ -3088,7 +3344,8 @@ def helicsDataBufferFillFromComplexVectorMatlabWrapper(functionDict: Dict[str,st functionWrapper += "\t\tvalue[2*i] = vals[i].real;\n" functionWrapper += "\t\tvalue[2*i + 1] = vals[i].imag;\n" functionWrapper += "\t}\n\n" - functionWrapper += f"\tint32_t result = {functionName}(data, static_cast(value), dataSize);\n\n" + functionWrapper += f"\tint32_t result = {functionName}(data, static_cast(value), dataSize);" + functionWrapper += "\n\n" functionWrapper += "\tmxArray *_out = mxCreateNumericMatrix(1, 1, mxINT32_CLASS, mxREAL);\n" functionWrapper += "\tmxInt32 *rv = mxGetInt32s(_out);\n" functionWrapper += "\trv[0] = static_cast(result);\n" @@ -3099,7 +3356,7 @@ def helicsDataBufferFillFromComplexVectorMatlabWrapper(functionDict: Dict[str,st functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -3124,10 +3381,12 @@ def helicsDataBufferToStringMatlabWrapper(functionDict: Dict[str,str], cursorIdx functionComment = "%\tGet a string value from a HelicsDataBuffer.\n\n" functionComment += "%\t@param data The HelicsDataBuffer to get the string from.\n\n" functionComment += "%\t@return the string value.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsDataBuffer", "data", 0, functionName) functionWrapper += "\tint maxStringLen = helicsDataBufferStringSize(data) + 2;\n\n" @@ -3148,7 +3407,7 @@ def helicsDataBufferToStringMatlabWrapper(functionDict: Dict[str,str], cursorIdx functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -3173,10 +3432,12 @@ def helicsDataBufferToRawStringMatlabWrapper(functionDict: Dict[str,str], cursor functionComment = "%\tGet a raw string value from a HelicsDataBuffer.\n\n" functionComment += "%\t@param data The HelicsDataBuffer to get the raw string from.\n\n" functionComment += "%\t@return the raw string value.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsDataBuffer", "data", 0, functionName) functionWrapper += "\tint maxStringLen = helicsDataBufferStringSize(data) + 2;\n\n" @@ -3197,7 +3458,7 @@ def helicsDataBufferToRawStringMatlabWrapper(functionDict: Dict[str,str], cursor functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -3219,10 +3480,12 @@ def helicsDataBufferToComplexMatlabWrapper(functionDict: Dict[str,str], cursorId functionComment = "%\tGet a complex value from an input object.\n\n" functionComment += "%\t@param ipt The input to get the data for.\n\n" functionComment += "%\t@return A complex number.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsDataBuffer", "data", 0, functionName) functionWrapper += "\tdouble values[2];\n\n" @@ -3238,7 +3501,7 @@ def helicsDataBufferToComplexMatlabWrapper(functionDict: Dict[str,str], cursorId functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -3254,10 +3517,12 @@ def helicsDataBufferToComplexObjectMatlabWrapper(functionDict: Dict[str,str], cu functionComment = "%\tGet a complex value from an HelicsDataBuffer.\n\n" functionComment += "%\t@param data The HelicsDataBuffer to get the data for.\n\n" functionComment += "%\t@return A complex number.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsDataBuffer", "data", 0, functionName) functionWrapper += f"\tHelicsComplex result = {functionName}(data);\n\n" @@ -3273,7 +3538,7 @@ def helicsDataBufferToComplexObjectMatlabWrapper(functionDict: Dict[str,str], cu functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -3298,17 +3563,20 @@ def helicsDataBufferToVectorMatlabWrapper(functionDict: Dict[str,str], cursorIdx functionComment = "%\tGet a vector from a HelicsDataBuffer.\n\n" functionComment += "%\t@param data The HelicsDataBuffer to get the vector for.\n\n" functionComment += "%\t@return a list of floating point values.\n" - functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 1){{\n" + functionWrapper = f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 1){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 1 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsDataBuffer", "data", 0, functionName) functionWrapper += "\tint maxLen = helicsDataBufferVectorSize(data);\n\n" functionWrapper += "\tdouble *values = static_cast(malloc(maxLen * sizeof(double)));\n\n" functionWrapper += "\tint actualSize = 0;\n\n" functionWrapper += f"\t{functionName}(data, values, maxLen, &actualSize);\n\n" - functionWrapper += "\tmxDouble *result_data = static_cast(mxMalloc(actualSize * sizeof(mxDouble)));\n" + functionWrapper += "\tmxDouble *result_data = static_cast(mxMalloc(actualSize * " + functionWrapper += "sizeof(mxDouble)));\n" functionWrapper += "\tfor(int i=0; i(pIterationRequest[0]);\n\n" + functionWrapper += "\tmxInt32 *pIterationRequest = mxGetInt32s(lhs[1]);\n" + functionWrapper += "\t*iteration = static_cast(pIterationRequest[0]);\n\n" functionWrapper += "\tmxDestroyArray(lhs[0]);\n" functionWrapper += "\tmxDestroyArray(lhs[1]);\n" functionWrapper += "\tmxDestroyArray(rhs[1]);\n" @@ -3787,15 +4098,18 @@ def helicsCallbackFederateNextTimeIterativeCallbackMatlabWrapper(functionDict: D functionWrapper += "\tmxDestroyArray(rhs[3]);\n" functionWrapper += "\treturn rv;\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFederate", "fed", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" functionWrapper += initializeArgHelicsErrorPtr("err") - functionWrapper += f"\t{functionName}(fed, &matlabCallbackFederateNextTimeIterativeCallback, userData, &err);\n\n" + functionWrapper += f"\t{functionName}(fed, &matlabCallbackFederateNextTimeIterativeCallback, userData, " + functionWrapper += "&err);\n\n" functionWrapper += "\tmxArray *_out = nullptr;\n" functionWrapper += "\tif(_out){\n" functionWrapper += "\t\t--resc;\n" @@ -3805,7 +4119,7 @@ def helicsCallbackFederateNextTimeIterativeCallbackMatlabWrapper(functionDict: D functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements @@ -3828,27 +4142,33 @@ def helicsCallbackFederateInitializeCallbackMatlabWrapper(functionDict: Dict[str raise RuntimeError("the function signature for helicsCallbackFederateInitializeCallback has changed!") functionName = functionDict.get("spelling","") functionComment = "\tSet callback for initialization.\n\n" - functionComment += "\t@details This callback will be executed when computing whether to iterate in initialization mode.\n\n" + functionComment += "\t@details This callback will be executed when computing whether to iterate in " + functionComment += "initialization mode.\n\n" functionComment += "\t@param fed The federate object in which to set the callback.\n" - functionComment += "\t@param initialize A function handle with the signature HelicsIterationRequest(void).\n" + functionComment += "\t@param initialize A function handle with the signature HelicsIterationRequest(void)." + functionComment += "\n" functionWrapper = "HelicsIterationRequest matlabCallbackFederateInitializeCallback(void *userData){\n" functionWrapper += "\tmxArray *lhs[1];\n" functionWrapper += "\tmxArray *rhs[1];\n" functionWrapper += "\trhs[0] = reinterpret_cast(userData);\n" functionWrapper += '\tint status = mexCallMATLAB(1,lhs,1,rhs,"feval");\n' - functionWrapper += f"\tif(mxGetClassID(lhs[0]) != mxINT32_CLASS){{\n" + functionWrapper += "\tif(mxGetClassID(lhs[0]) != mxINT32_CLASS){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:matlabCallbackFederateInitializeCallback:TypeError\",\"return type must be of type int32.\");\n" + functionWrapper += "\t\tmexErrMsgIdAndTxt(\"MATLAB:matlabCallbackFederateInitializeCallback:TypeError\",\"" + functionWrapper += "return type must be of type int32.\");\n" functionWrapper += "\t}\n" - functionWrapper += f"\tmxInt32 *pIterationRequest = mxGetInt32s(lhs[0]);\n" - functionWrapper += f"\tHelicsIterationRequest rv = static_cast(pIterationRequest[0]);\n\n" + functionWrapper += "\tmxInt32 *pIterationRequest = mxGetInt32s(lhs[0]);\n" + functionWrapper += "\tHelicsIterationRequest rv = static_cast(pIterationRequest[0])" + functionWrapper += ";\n\n" functionWrapper += "\tmxDestroyArray(lhs[0]);\n" functionWrapper += "\treturn rv;\n" functionWrapper += "}\n\n" - functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + "{\n" - functionWrapper += f"\tif(argc != 2){{\n" + functionWrapper += f"void _wrap_{functionName}(int resc, mxArray *resv[], int argc, const mxArray *argv[])" + functionWrapper += "{\n" + functionWrapper += "\tif(argc != 2){\n" functionWrapper += "\t\tmexUnlock();\n" - functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 arguments.\");\n" + functionWrapper += f"\t\tmexErrMsgIdAndTxt(\"MATLAB:{functionName}:rhs\",\"This function requires 2 " + functionWrapper += "arguments.\");\n" functionWrapper += "\t}\n\n" functionWrapper += initializeArgHelicsClass("HelicsFederate", "fed", 0, functionName) functionWrapper += "\tvoid *userData = mxGetData(argv[1]);\n" @@ -3863,14 +4183,15 @@ def helicsCallbackFederateInitializeCallbackMatlabWrapper(functionDict: Dict[str functionWrapper += "}\n\n\n" functionMainElements = f"\tcase {cursorIdx}:\n" functionMainElements += f"\t\t_wrap_{functionName}(resc, resv, argc, argv);\n" - functionMainElements += f"\t\tbreak;\n" + functionMainElements += "\t\tbreak;\n" return functionComment, functionWrapper, functionMainElements def createMexMain() -> str: mexMainStr = "void mexFunction(int resc, mxArray *resv[], int argc, const mxArray *argv[]) {\n" mexMainStr += "\tif(--argc < 0 || !mxIsChar(*argv)){\n" - mexMainStr += "\t\tmexErrMsgTxt(\"This mex file should only be called from inside the .m files. First input should be the function ID.\");\n" + mexMainStr += "\t\tmexErrMsgTxt(\"This mex file should only be called from inside the .m files. First " + mexMainStr += "input should be the function ID.\");\n" mexMainStr += "\t}\n" mexMainStr += "\tint functionId;\n" mexMainStr += "\ttry {\n" @@ -3890,26 +4211,32 @@ def createMexMain() -> str: def closeBoilerPlate() -> str: boilerPlateStr = "\tdefault:\n" - boilerPlateStr += "\t\tmexErrMsgIdAndTxt(\"helics:mexFunction\",\"An unknown function id was encountered. Call the mex function with a valid function id.\");\n" + boilerPlateStr += "\t\tmexErrMsgIdAndTxt(\"helics:mexFunction\",\"An unknown function id was encountered. " + boilerPlateStr += "Call the mex function with a valid function id.\");\n" boilerPlateStr += "\t}\n}\n\n" - return boilerPlateStr - filePath = os.path.dirname(__file__) - if not os.path.exists(os.path.join(self.__rootDir, "matlabBindings/+helics")): - os.makedirs(os.path.join(self.__rootDir, "matlabBindings/+helics")) + return boilerPlateStr + + + filePath = Path(__file__).parent.resolve() / "extra_m_codes" + srcFilesDir = self.__rootDir / "matlabBindings" / "+helics" + if not srcFilesDir.is_dir(): + srcFilesDir.mkdir(parents=True, exist_ok=True) try: - shutil.copy2(os.path.join(filePath, "extra_m_codes/helicsInputSetDefault.m"), os.path.join(self.__rootDir, "matlabBindings/+helics")) - shutil.copy2(os.path.join(filePath, "extra_m_codes/helicsPublicationPublish.m"), os.path.join(self.__rootDir, "matlabBindings/+helics")) + for child in filePath.iterdir(): + srcFile = srcFilesDir / child.name + shutil.copy2(child, srcFile) except: matlabBindingGeneratorLogger.warning("couldn't copy extra_m_codes.") else: try: - shutil.rmtree(os.path.join(self.__rootDir, 'matlabBindings')) - os.makedirs(os.path.join(self.__rootDir, "matlabBindings/+helics")) + shutil.rmtree(srcFilesDir.parent.resolve()) + srcFilesDir.mkdir(parents=True, exist_ok=True) except: matlabBindingGeneratorLogger.warning("couldn't delete the old bindings files.") try: - shutil.copy2(os.path.join(filePath, "extra_m_codes/helicsInputSetDefault.m"), os.path.join(self.__rootDir, "matlabBindings/+helics")) - shutil.copy2(os.path.join(filePath, "extra_m_codes/helicsPublicationPublish.m"), os.path.join(self.__rootDir, "matlabBindings/+helics")) + for child in filePath.iterdir(): + srcFile = srcFilesDir / child.name + shutil.copy2(child, srcFile) except: matlabBindingGeneratorLogger.warning("couldn't copy extra_m_codes.") helicsMexStr = "" @@ -3920,7 +4247,8 @@ def closeBoilerPlate() -> str: if self.__helicsParser.parsedInfo[cu]["kind"] == "ENUM_DECL": createEnum(self.__helicsParser.parsedInfo[cu]) if self.__helicsParser.parsedInfo[cu]["kind"] == "MACRO_DEFINITION": - macroMexWrapperFunctionStr, macroMexMainFunctionElementStr, macroMapTuple= createMacro(self.__helicsParser.parsedInfo[cu],int(cu)) + macroMexWrapperFunctionStr, macroMexMainFunctionElementStr, macroMapTuple = \ + createMacro(self.__helicsParser.parsedInfo[cu],int(cu)) helicsMexWrapperFunctions.append(macroMexWrapperFunctionStr) helicsMexMainFunctionElements.append(macroMexMainFunctionElementStr) if macroMapTuple != None: @@ -3928,7 +4256,8 @@ def closeBoilerPlate() -> str: if self.__helicsParser.parsedInfo[cu]["kind"] == "VAR_DECL": createVar(self.__helicsParser.parsedInfo[cu],int(cu)) if self.__helicsParser.parsedInfo[cu]["kind"] == "FUNCTION_DECL": - functionMexWrapperFunctionStr, functionMexMainFunctionElementStr, functionMapTuple= createFunction(self.__helicsParser.parsedInfo[cu],int(cu)) + functionMexWrapperFunctionStr, functionMexMainFunctionElementStr, functionMapTuple = \ + createFunction(self.__helicsParser.parsedInfo[cu],int(cu)) helicsMexWrapperFunctions.append(functionMexWrapperFunctionStr) helicsMexMainFunctionElements.append(functionMexMainFunctionElementStr) if functionMapTuple != None: @@ -3940,6 +4269,7 @@ def closeBoilerPlate() -> str: for element in helicsMexMainFunctionElements: helicsMexStr += element helicsMexStr += closeBoilerPlate() - with open(os.path.join(self.__rootDir, "helicsMex.cpp"), "w") as helicsMexFile: - helicsMexFile.write(helicsMexStr) + helicsMexFile = self.__rootDir / "helicsMex.cpp" + with helicsMexFile.open(mode="w", encoding="utf-8") as hmf: + hmf.write(helicsMexStr) matlabBindingGeneratorLogger.info("MATLAB HELICS API successfully created!") diff --git a/src/main.py b/src/main.py index 81e1636..4e548bc 100644 --- a/src/main.py +++ b/src/main.py @@ -4,8 +4,8 @@ the top-level NOTICE for additional details. All rights reserved. SPDX-License-Identifier: BSD-3-Clause ''' -import os from argparse import ArgumentParser +from pathlib import Path from typing import List from bindingGenerators.matlabBindingGenerator import MatlabBindingGenerator @@ -21,7 +21,7 @@ def main(bindingsRootDir: str, helicsHeaders: List[str]) -> None: if __name__ == '__main__': userInputParser = ArgumentParser() - userInputParser.add_argument("bindingsRootDir", nargs="?", default=os.getcwd(), + userInputParser.add_argument("bindingsRootDir", nargs="?", default=Path.cwd(), help="location to generate matlab language bindings.") userInputParser.add_argument("headers", default=[], nargs="+", help="list of helics header files to parse") From 2ed7ea90e3688570fc5c340eb362a0b9217bb427 Mon Sep 17 00:00:00 2001 From: afisher1 Date: Mon, 23 Dec 2024 15:26:50 -0800 Subject: [PATCH 2/2] Removing dev files accidentally added to the repo. --- .vscode/launch.json | 20 ------------- poetry.lock | 70 --------------------------------------------- 2 files changed, 90 deletions(-) delete mode 100644 .vscode/launch.json delete mode 100644 poetry.lock diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index f71ec6a..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: Current File with Arguments", - "type": "debugpy", - "request": "launch", - "program": "${file}", - "console": "integratedTerminal", - "args": [ - "/home/vale/git/matHELICS", - "/home/vale/git/HELICS/install/include/helics/helics.h" - ], - "justMyCode": false - } - ] -} \ No newline at end of file diff --git a/poetry.lock b/poetry.lock deleted file mode 100644 index 7c20fd6..0000000 --- a/poetry.lock +++ /dev/null @@ -1,70 +0,0 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. - -[[package]] -name = "cheader2json" -version = "0.0.0rc2" -description = "Parse C header file and output JSON ast + types" -optional = false -python-versions = ">=3.8" -files = [ - {file = "cheader2json-0.0.0rc2-py3-none-any.whl", hash = "sha256:657e02d9a50846a2773ae2a6b2ad6d4c7fccef27255e6a98a46eaa1b9180e3c8"}, - {file = "cheader2json-0.0.0rc2.tar.gz", hash = "sha256:5e8f29780013bde315960f6c0cde23fc72b3a0e66eaaed9a0e24f0763336c592"}, -] - -[package.dependencies] -click = "*" -libclang = "18.1.1" - -[package.extras] -dev = ["build", "pre-commit"] -docs = ["myst-parser", "sphinx"] -test = ["pytest"] - -[[package]] -name = "click" -version = "8.1.7" -description = "Composable command line interface toolkit" -optional = false -python-versions = ">=3.7" -files = [ - {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, - {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "libclang" -version = "18.1.1" -description = "Clang Python Bindings, mirrored from the official LLVM repo: https://github.com/llvm/llvm-project/tree/main/clang/bindings/python, to make the installation process easier." -optional = false -python-versions = "*" -files = [ - {file = "libclang-18.1.1-1-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:0b2e143f0fac830156feb56f9231ff8338c20aecfe72b4ffe96f19e5a1dbb69a"}, - {file = "libclang-18.1.1-py2.py3-none-macosx_10_9_x86_64.whl", hash = "sha256:6f14c3f194704e5d09769108f03185fce7acaf1d1ae4bbb2f30a72c2400cb7c5"}, - {file = "libclang-18.1.1-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:83ce5045d101b669ac38e6da8e58765f12da2d3aafb3b9b98d88b286a60964d8"}, - {file = "libclang-18.1.1-py2.py3-none-manylinux2010_x86_64.whl", hash = "sha256:c533091d8a3bbf7460a00cb6c1a71da93bffe148f172c7d03b1c31fbf8aa2a0b"}, - {file = "libclang-18.1.1-py2.py3-none-manylinux2014_aarch64.whl", hash = "sha256:54dda940a4a0491a9d1532bf071ea3ef26e6dbaf03b5000ed94dd7174e8f9592"}, - {file = "libclang-18.1.1-py2.py3-none-manylinux2014_armv7l.whl", hash = "sha256:cf4a99b05376513717ab5d82a0db832c56ccea4fd61a69dbb7bccf2dfb207dbe"}, - {file = "libclang-18.1.1-py2.py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:69f8eb8f65c279e765ffd28aaa7e9e364c776c17618af8bff22a8df58677ff4f"}, - {file = "libclang-18.1.1-py2.py3-none-win_amd64.whl", hash = "sha256:4dd2d3b82fab35e2bf9ca717d7b63ac990a3519c7e312f19fa8e86dcc712f7fb"}, - {file = "libclang-18.1.1-py2.py3-none-win_arm64.whl", hash = "sha256:3f0e1f49f04d3cd198985fea0511576b0aee16f9ff0e0f0cad7f9c57ec3c20e8"}, - {file = "libclang-18.1.1.tar.gz", hash = "sha256:a1214966d08d73d971287fc3ead8dfaf82eb07fb197680d8b3859dbbbbf78250"}, -] - -[metadata] -lock-version = "2.0" -python-versions = "^3.10" -content-hash = "0b0352b74f86cfe0bdf8507e5b04c6cdf8bca226e79a69663d92843ae09a4ac4"