From e0ad8f49a4b231463f58647e76e183132b512363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schnabel?= Date: Fri, 10 Nov 2023 16:56:08 +0100 Subject: [PATCH 1/5] Delete XCode project file for unit tests --- gdxtest.xcodeproj/project.pbxproj | 436 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcshareddata/xcschemes/gdxtest.xcscheme | 85 ---- 4 files changed, 536 deletions(-) delete mode 100644 gdxtest.xcodeproj/project.pbxproj delete mode 100644 gdxtest.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 gdxtest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 gdxtest.xcodeproj/xcshareddata/xcschemes/gdxtest.xcscheme diff --git a/gdxtest.xcodeproj/project.pbxproj b/gdxtest.xcodeproj/project.pbxproj deleted file mode 100644 index 4fe98d06..00000000 --- a/gdxtest.xcodeproj/project.pbxproj +++ /dev/null @@ -1,436 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 56; - objects = { - -/* Begin PBXBuildFile section */ - 4299369929C5C12A00227BD2 /* gclgms.c in Sources */ = {isa = PBXBuildFile; fileRef = 4299368729C5C12A00227BD2 /* gclgms.c */; }; - 4299369B29C5C12A00227BD2 /* gxfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4299368A29C5C12A00227BD2 /* gxfile.cpp */; }; - 4299369C29C5C12A00227BD2 /* utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4299368B29C5C12A00227BD2 /* utils.cpp */; }; - 4299369E29C5C12A00227BD2 /* gmsstrm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4299369829C5C12A00227BD2 /* gmsstrm.cpp */; }; - 429936BB29C5C32700227BD2 /* gmsobjtests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 429936B329C5C32700227BD2 /* gmsobjtests.cpp */; }; - 429936BC29C5C32700227BD2 /* doctestmain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 429936B429C5C32700227BD2 /* doctestmain.cpp */; }; - 429936BD29C5C32700227BD2 /* datastoragetests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 429936B529C5C32700227BD2 /* datastoragetests.cpp */; }; - 429936BE29C5C32700227BD2 /* gxfiletests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 429936B629C5C32700227BD2 /* gxfiletests.cpp */; }; - 429936BF29C5C32700227BD2 /* gmsdatatests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 429936B729C5C32700227BD2 /* gmsdatatests.cpp */; }; - 429936C029C5C32700227BD2 /* strhashtests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 429936B829C5C32700227BD2 /* strhashtests.cpp */; }; - 429936C229C5C32700227BD2 /* utilstests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 429936BA29C5C32700227BD2 /* utilstests.cpp */; }; - 42D0995D29C99FA300285505 /* inflate.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0994429C99FA300285505 /* inflate.c */; }; - 42D0995E29C99FA300285505 /* compress.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0994629C99FA300285505 /* compress.c */; }; - 42D0995F29C99FA300285505 /* deflate.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0994729C99FA300285505 /* deflate.c */; }; - 42D0996029C99FA300285505 /* gzread.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0994929C99FA300285505 /* gzread.c */; }; - 42D0996129C99FA300285505 /* crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0994C29C99FA300285505 /* crc32.c */; }; - 42D0996229C99FA300285505 /* infback.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0994D29C99FA300285505 /* infback.c */; }; - 42D0996329C99FA300285505 /* zutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0994E29C99FA300285505 /* zutil.c */; }; - 42D0996429C99FA300285505 /* gzlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0995229C99FA300285505 /* gzlib.c */; }; - 42D0996529C99FA300285505 /* inftrees.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0995429C99FA300285505 /* inftrees.c */; }; - 42D0996629C99FA300285505 /* uncompr.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0995529C99FA300285505 /* uncompr.c */; }; - 42D0996729C99FA300285505 /* gzwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0995629C99FA300285505 /* gzwrite.c */; }; - 42D0996829C99FA300285505 /* trees.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0995729C99FA300285505 /* trees.c */; }; - 42D0996929C99FA300285505 /* gzclose.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0995829C99FA300285505 /* gzclose.c */; }; - 42D0996A29C99FA300285505 /* inffast.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0995A29C99FA300285505 /* inffast.c */; }; - 42D0996B29C99FA300285505 /* adler32.c in Sources */ = {isa = PBXBuildFile; fileRef = 42D0995B29C99FA300285505 /* adler32.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 42C53F4929C5C0B60027E3E6 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 4299368729C5C12A00227BD2 /* gclgms.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gclgms.c; path = src/gclgms.c; sourceTree = ""; }; - 4299368929C5C12A00227BD2 /* tests */ = {isa = PBXFileReference; lastKnownFileType = folder; name = tests; path = src/tests; sourceTree = ""; }; - 4299368A29C5C12A00227BD2 /* gxfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gxfile.cpp; path = src/gxfile.cpp; sourceTree = ""; }; - 4299368B29C5C12A00227BD2 /* utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = utils.cpp; path = src/utils.cpp; sourceTree = ""; }; - 4299368C29C5C12A00227BD2 /* strhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strhash.h; path = src/strhash.h; sourceTree = ""; }; - 4299368E29C5C12A00227BD2 /* gxfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gxfile.h; path = src/gxfile.h; sourceTree = ""; }; - 4299369029C5C12A00227BD2 /* gmsobj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gmsobj.h; path = src/gmsobj.h; sourceTree = ""; }; - 4299369129C5C12A00227BD2 /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utils.h; path = src/utils.h; sourceTree = ""; }; - 4299369229C5C12A00227BD2 /* datastorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = datastorage.h; path = src/datastorage.h; sourceTree = ""; }; - 4299369329C5C12A00227BD2 /* gmsstrm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gmsstrm.h; path = src/gmsstrm.h; sourceTree = ""; }; - 4299369429C5C12A00227BD2 /* cwrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = cwrap.hpp; path = src/cwrap.hpp; sourceTree = ""; }; - 4299369529C5C12A00227BD2 /* gclgms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gclgms.h; path = src/gclgms.h; sourceTree = ""; }; - 4299369629C5C12A00227BD2 /* gmsdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gmsdata.h; path = src/gmsdata.h; sourceTree = ""; }; - 4299369729C5C12A00227BD2 /* gdx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gdx.h; path = src/gdx.h; sourceTree = ""; }; - 4299369829C5C12A00227BD2 /* gmsstrm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gmsstrm.cpp; path = src/gmsstrm.cpp; sourceTree = ""; }; - 429936B329C5C32700227BD2 /* gmsobjtests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = gmsobjtests.cpp; path = src/tests/gmsobjtests.cpp; sourceTree = ""; }; - 429936B429C5C32700227BD2 /* doctestmain.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = doctestmain.cpp; path = src/tests/doctestmain.cpp; sourceTree = ""; }; - 429936B529C5C32700227BD2 /* datastoragetests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = datastoragetests.cpp; path = src/tests/datastoragetests.cpp; sourceTree = ""; }; - 429936B629C5C32700227BD2 /* gxfiletests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = gxfiletests.cpp; path = src/tests/gxfiletests.cpp; sourceTree = ""; }; - 429936B729C5C32700227BD2 /* gmsdatatests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = gmsdatatests.cpp; path = src/tests/gmsdatatests.cpp; sourceTree = ""; }; - 429936B829C5C32700227BD2 /* strhashtests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = strhashtests.cpp; path = src/tests/strhashtests.cpp; sourceTree = ""; }; - 429936BA29C5C32700227BD2 /* utilstests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = utilstests.cpp; path = src/tests/utilstests.cpp; sourceTree = ""; }; - 42C53F4B29C5C0B60027E3E6 /* gdxtest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = gdxtest; sourceTree = BUILT_PRODUCTS_DIR; }; - 42D0994229C99FA300285505 /* zutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zutil.h; sourceTree = ""; }; - 42D0994329C99FA300285505 /* inftrees.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inftrees.h; sourceTree = ""; }; - 42D0994429C99FA300285505 /* inflate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inflate.c; sourceTree = ""; }; - 42D0994529C99FA300285505 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; - 42D0994629C99FA300285505 /* compress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = compress.c; sourceTree = ""; }; - 42D0994729C99FA300285505 /* deflate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = deflate.c; sourceTree = ""; }; - 42D0994829C99FA300285505 /* inffixed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inffixed.h; sourceTree = ""; }; - 42D0994929C99FA300285505 /* gzread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gzread.c; sourceTree = ""; }; - 42D0994A29C99FA300285505 /* trees.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = trees.h; sourceTree = ""; }; - 42D0994B29C99FA300285505 /* inffast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inffast.h; sourceTree = ""; }; - 42D0994C29C99FA300285505 /* crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crc32.c; sourceTree = ""; }; - 42D0994D29C99FA300285505 /* infback.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = infback.c; sourceTree = ""; }; - 42D0994E29C99FA300285505 /* zutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zutil.c; sourceTree = ""; }; - 42D0994F29C99FA300285505 /* deflate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = deflate.h; sourceTree = ""; }; - 42D0995029C99FA300285505 /* gzguts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gzguts.h; sourceTree = ""; }; - 42D0995129C99FA300285505 /* zlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zlib.h; sourceTree = ""; }; - 42D0995229C99FA300285505 /* gzlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gzlib.c; sourceTree = ""; }; - 42D0995329C99FA300285505 /* inflate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inflate.h; sourceTree = ""; }; - 42D0995429C99FA300285505 /* inftrees.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inftrees.c; sourceTree = ""; }; - 42D0995529C99FA300285505 /* uncompr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = uncompr.c; sourceTree = ""; }; - 42D0995629C99FA300285505 /* gzwrite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gzwrite.c; sourceTree = ""; }; - 42D0995729C99FA300285505 /* trees.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = trees.c; sourceTree = ""; }; - 42D0995829C99FA300285505 /* gzclose.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gzclose.c; sourceTree = ""; }; - 42D0995929C99FA300285505 /* crc32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crc32.h; sourceTree = ""; }; - 42D0995A29C99FA300285505 /* inffast.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inffast.c; sourceTree = ""; }; - 42D0995B29C99FA300285505 /* adler32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = adler32.c; sourceTree = ""; }; - 42D0995C29C99FA300285505 /* zconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zconf.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 42C53F4829C5C0B60027E3E6 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 42C53F4229C5C0B60027E3E6 = { - isa = PBXGroup; - children = ( - 42D0994129C99FA300285505 /* zlib */, - 429936B529C5C32700227BD2 /* datastoragetests.cpp */, - 429936B429C5C32700227BD2 /* doctestmain.cpp */, - 429936B729C5C32700227BD2 /* gmsdatatests.cpp */, - 429936B329C5C32700227BD2 /* gmsobjtests.cpp */, - 429936B629C5C32700227BD2 /* gxfiletests.cpp */, - 429936B829C5C32700227BD2 /* strhashtests.cpp */, - 429936BA29C5C32700227BD2 /* utilstests.cpp */, - 4299368929C5C12A00227BD2 /* tests */, - 4299369429C5C12A00227BD2 /* cwrap.hpp */, - 4299369229C5C12A00227BD2 /* datastorage.h */, - 4299368729C5C12A00227BD2 /* gclgms.c */, - 4299369529C5C12A00227BD2 /* gclgms.h */, - 4299369729C5C12A00227BD2 /* gdx.h */, - 4299369629C5C12A00227BD2 /* gmsdata.h */, - 4299369029C5C12A00227BD2 /* gmsobj.h */, - 4299369829C5C12A00227BD2 /* gmsstrm.cpp */, - 4299369329C5C12A00227BD2 /* gmsstrm.h */, - 4299368A29C5C12A00227BD2 /* gxfile.cpp */, - 4299368E29C5C12A00227BD2 /* gxfile.h */, - 4299368C29C5C12A00227BD2 /* strhash.h */, - 4299368B29C5C12A00227BD2 /* utils.cpp */, - 4299369129C5C12A00227BD2 /* utils.h */, - 42C53F4C29C5C0B60027E3E6 /* Products */, - ); - sourceTree = ""; - }; - 42C53F4C29C5C0B60027E3E6 /* Products */ = { - isa = PBXGroup; - children = ( - 42C53F4B29C5C0B60027E3E6 /* gdxtest */, - ); - name = Products; - sourceTree = ""; - }; - 42D0994129C99FA300285505 /* zlib */ = { - isa = PBXGroup; - children = ( - 42D0994229C99FA300285505 /* zutil.h */, - 42D0994329C99FA300285505 /* inftrees.h */, - 42D0994429C99FA300285505 /* inflate.c */, - 42D0994529C99FA300285505 /* LICENSE */, - 42D0994629C99FA300285505 /* compress.c */, - 42D0994729C99FA300285505 /* deflate.c */, - 42D0994829C99FA300285505 /* inffixed.h */, - 42D0994929C99FA300285505 /* gzread.c */, - 42D0994A29C99FA300285505 /* trees.h */, - 42D0994B29C99FA300285505 /* inffast.h */, - 42D0994C29C99FA300285505 /* crc32.c */, - 42D0994D29C99FA300285505 /* infback.c */, - 42D0994E29C99FA300285505 /* zutil.c */, - 42D0994F29C99FA300285505 /* deflate.h */, - 42D0995029C99FA300285505 /* gzguts.h */, - 42D0995129C99FA300285505 /* zlib.h */, - 42D0995229C99FA300285505 /* gzlib.c */, - 42D0995329C99FA300285505 /* inflate.h */, - 42D0995429C99FA300285505 /* inftrees.c */, - 42D0995529C99FA300285505 /* uncompr.c */, - 42D0995629C99FA300285505 /* gzwrite.c */, - 42D0995729C99FA300285505 /* trees.c */, - 42D0995829C99FA300285505 /* gzclose.c */, - 42D0995929C99FA300285505 /* crc32.h */, - 42D0995A29C99FA300285505 /* inffast.c */, - 42D0995B29C99FA300285505 /* adler32.c */, - 42D0995C29C99FA300285505 /* zconf.h */, - ); - path = zlib; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 42C53F4A29C5C0B60027E3E6 /* gdxtest */ = { - isa = PBXNativeTarget; - buildConfigurationList = 42C53F5229C5C0B60027E3E6 /* Build configuration list for PBXNativeTarget "gdxtest" */; - buildPhases = ( - 42C53F4729C5C0B60027E3E6 /* Sources */, - 42C53F4829C5C0B60027E3E6 /* Frameworks */, - 42C53F4929C5C0B60027E3E6 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = gdxtest; - productName = gdxtest; - productReference = 42C53F4B29C5C0B60027E3E6 /* gdxtest */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 42C53F4329C5C0B60027E3E6 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastUpgradeCheck = 1420; - TargetAttributes = { - 42C53F4A29C5C0B60027E3E6 = { - CreatedOnToolsVersion = 14.2; - }; - }; - }; - buildConfigurationList = 42C53F4629C5C0B60027E3E6 /* Build configuration list for PBXProject "gdxtest" */; - compatibilityVersion = "Xcode 14.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 42C53F4229C5C0B60027E3E6; - productRefGroup = 42C53F4C29C5C0B60027E3E6 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 42C53F4A29C5C0B60027E3E6 /* gdxtest */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 42C53F4729C5C0B60027E3E6 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 42D0996329C99FA300285505 /* zutil.c in Sources */, - 429936BB29C5C32700227BD2 /* gmsobjtests.cpp in Sources */, - 429936BC29C5C32700227BD2 /* doctestmain.cpp in Sources */, - 42D0996629C99FA300285505 /* uncompr.c in Sources */, - 42D0996029C99FA300285505 /* gzread.c in Sources */, - 429936BD29C5C32700227BD2 /* datastoragetests.cpp in Sources */, - 42D0995E29C99FA300285505 /* compress.c in Sources */, - 42D0996129C99FA300285505 /* crc32.c in Sources */, - 429936BE29C5C32700227BD2 /* gxfiletests.cpp in Sources */, - 42D0996929C99FA300285505 /* gzclose.c in Sources */, - 429936BF29C5C32700227BD2 /* gmsdatatests.cpp in Sources */, - 42D0995D29C99FA300285505 /* inflate.c in Sources */, - 429936C029C5C32700227BD2 /* strhashtests.cpp in Sources */, - 429936C229C5C32700227BD2 /* utilstests.cpp in Sources */, - 42D0995F29C99FA300285505 /* deflate.c in Sources */, - 4299369E29C5C12A00227BD2 /* gmsstrm.cpp in Sources */, - 4299369929C5C12A00227BD2 /* gclgms.c in Sources */, - 42D0996B29C99FA300285505 /* adler32.c in Sources */, - 42D0996529C99FA300285505 /* inftrees.c in Sources */, - 4299369B29C5C12A00227BD2 /* gxfile.cpp in Sources */, - 42D0996229C99FA300285505 /* infback.c in Sources */, - 42D0996A29C99FA300285505 /* inffast.c in Sources */, - 42D0996429C99FA300285505 /* gzlib.c in Sources */, - 42D0996729C99FA300285505 /* gzwrite.c in Sources */, - 4299369C29C5C12A00227BD2 /* utils.cpp in Sources */, - 42D0996829C99FA300285505 /* trees.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 42C53F5029C5C0B60027E3E6 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 13.1; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 42C53F5129C5C0B60027E3E6 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 13.1; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = macosx; - }; - name = Release; - }; - 42C53F5329C5C0B60027E3E6 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = P2B8CY36F4; - ENABLE_HARDENED_RUNTIME = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 42C53F5429C5C0B60027E3E6 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = P2B8CY36F4; - ENABLE_HARDENED_RUNTIME = YES; - GCC_PREPROCESSOR_DEFINITIONS = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 42C53F4629C5C0B60027E3E6 /* Build configuration list for PBXProject "gdxtest" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 42C53F5029C5C0B60027E3E6 /* Debug */, - 42C53F5129C5C0B60027E3E6 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 42C53F5229C5C0B60027E3E6 /* Build configuration list for PBXNativeTarget "gdxtest" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 42C53F5329C5C0B60027E3E6 /* Debug */, - 42C53F5429C5C0B60027E3E6 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 42C53F4329C5C0B60027E3E6 /* Project object */; -} diff --git a/gdxtest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/gdxtest.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6..00000000 --- a/gdxtest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/gdxtest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/gdxtest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/gdxtest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/gdxtest.xcodeproj/xcshareddata/xcschemes/gdxtest.xcscheme b/gdxtest.xcodeproj/xcshareddata/xcschemes/gdxtest.xcscheme deleted file mode 100644 index 3c78801b..00000000 --- a/gdxtest.xcodeproj/xcshareddata/xcschemes/gdxtest.xcscheme +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 849dc35f2a409dca41941467ee7fb95a554b2f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schnabel?= Date: Fri, 10 Nov 2023 17:14:30 +0100 Subject: [PATCH 2/5] Minor changelog update. Added upcoming technical release version. --- changelog.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog.yaml b/changelog.yaml index 5a464e3f..62d94fb4 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1,4 +1,7 @@ --- +- 7.9.2: + - Removed XCode project file for unit test suite as it is not maintained anymore. + - ... - 7.9.1: - First open source technical release of GDX eXPert-level API. - Added gdxAllowBogusDomains to get flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomainSets). From b1d131406e6a079a26a865b6415861339221ad86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schnabel?= Date: Mon, 13 Nov 2023 10:45:00 +0000 Subject: [PATCH 3/5] Resolve "Correctly treat properties in GDX API definition YAML when generating GDX header (and wrappers)" --- changelog.yaml | 3 ++ generated/cwrap.hpp | 24 ++++++------ generated/gdxcppwrap.h | 40 ++++++++++---------- src/gdx.h | 55 +++++++++++++++------------- src/gdxapi.yaml | 39 +++++++++++++++----- src/gxfile.cpp | 6 +-- src/templates/cwrap.template.j2 | 31 ++++++---------- src/templates/gdxcppwrap.template.j2 | 29 +++++---------- src/templates/gdxheader.template.j2 | 43 ++++------------------ src/yaml2cwrap.py | 2 +- src/yaml2doxy.py | 13 ++++++- 11 files changed, 139 insertions(+), 146 deletions(-) diff --git a/changelog.yaml b/changelog.yaml index 62d94fb4..915dc8ee 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1,6 +1,9 @@ --- - 7.9.2: - Removed XCode project file for unit test suite as it is not maintained anymore. + - > + Entries for property setters and getters in main header and wrappers are now automatically generated from API + definition YAML via Jinja2 templates and not handwritten. - ... - 7.9.1: - First open source technical release of GDX eXPert-level API. diff --git a/generated/cwrap.hpp b/generated/cwrap.hpp index a66873dd..db99f444 100644 --- a/generated/cwrap.hpp +++ b/generated/cwrap.hpp @@ -167,10 +167,10 @@ int gdxFree( TGXFileRec_t **pgdx ); int gdxCreate( TGXFileRec_t **pgdx, char *errBuf, int bufSize ); int gdxCreateD( TGXFileRec_t **pgdx, const char *sysDir, char *msgBuf, int msgBufLen ); void gdxDestroy( TGXFileRec_t **pgx ); -int gdxStoreDomainSets( TGXFileRec_t *pgdx ); -void gdxStoreDomainSetsSet( TGXFileRec_t *pgdx, int x ); -int gdxAllowBogusDomains (TGXFileRec_t *pgdx); -void gdxAllowBogusDomainsSet (TGXFileRec_t *pgdx, int x); +int gdxStoreDomainSets( TGXFileRec_t *pgdx); +void gdxStoreDomainSetsSet( TGXFileRec_t *pgdx, int flag); +int gdxAllowBogusDomains( TGXFileRec_t *pgdx); +void gdxAllowBogusDomainsSet( TGXFileRec_t *pgdx, int flag); void setCallByRef( TGXFileRec_t *TGXFile, const char *FuncName, int cbrValue ); // PROTOTYPES END @@ -658,24 +658,24 @@ GDX_INLINE int gdxRenameUEL( TGXFileRec_t *pgx, const char *OldName, const char } -GDX_INLINE int gdxStoreDomainSets( TGXFileRec_t *TGXFile ) +GDX_INLINE int gdxStoreDomainSets( TGXFileRec_t *pgx) { - return reinterpret_cast( TGXFile )->gdxStoreDomainSets(); + return reinterpret_cast( pgx )->gdxStoreDomainSets(); } -GDX_INLINE void gdxStoreDomainSetsSet( TGXFileRec_t *TGXFile, int x ) +GDX_INLINE void gdxStoreDomainSetsSet( TGXFileRec_t *pgx, int flag) { - reinterpret_cast( TGXFile )->gdxStoreDomainSetsSet( x ); + reinterpret_cast( pgx )->gdxStoreDomainSetsSet( flag ); } -GDX_INLINE int gdxAllowBogusDomains( TGXFileRec_t *TGXFile ) +GDX_INLINE int gdxAllowBogusDomains( TGXFileRec_t *pgx) { - return reinterpret_cast( TGXFile )->gdxAllowBogusDomains(); + return reinterpret_cast( pgx )->gdxAllowBogusDomains(); } -GDX_INLINE void gdxAllowBogusDomainsSet( TGXFileRec_t *TGXFile, int x ) +GDX_INLINE void gdxAllowBogusDomainsSet( TGXFileRec_t *pgx, int flag) { - reinterpret_cast( TGXFile )->gdxAllowBogusDomainsSet( x ); + reinterpret_cast( pgx )->gdxAllowBogusDomainsSet( flag ); } GDX_INLINE int gdxFree( TGXFileRec_t **TGXFile ) diff --git a/generated/gdxcppwrap.h b/generated/gdxcppwrap.h index 34b1a49f..a13ffbbd 100644 --- a/generated/gdxcppwrap.h +++ b/generated/gdxcppwrap.h @@ -99,6 +99,27 @@ class TGXFileObj ::gdxLibraryUnload(); } + + [[nodiscard]] int gdxStoreDomainSets() const + { + return ::gdxStoreDomainSets( pgx ); + } + + void gdxStoreDomainSetsSet(int flag) + { + ::gdxStoreDomainSetsSet( pgx, flag ); + } + + [[nodiscard]] int gdxAllowBogusDomains() const + { + return ::gdxAllowBogusDomains( pgx ); + } + + void gdxAllowBogusDomainsSet(int flag) + { + ::gdxAllowBogusDomainsSet( pgx, flag ); + } + int gdxAcronymAdd( const char *AName, const char *Txt, int AIndx ) { return ::gdxAcronymAdd( pgx, AName, Txt, AIndx ); @@ -549,25 +570,6 @@ class TGXFileObj return ::gdxRenameUEL( pgx, OldName, NewName ); } - int gdxStoreDomainSets() - { - return ::gdxStoreDomainSets( pgx ); - } - - void gdxStoreDomainSetsSet( int x ) - { - ::gdxStoreDomainSetsSet( pgx, x ); - } - - void gdxAllowBogusDomainsSet( int flag ) - { - ::gdxAllowBogusDomainsSet( pgx, flag ); - } - - [[nodiscard]] int gdxAllowBogusDomains() - { - return ::gdxAllowBogusDomains( pgx ); - } int gdxUELMaxLength() { diff --git a/src/gdx.h b/src/gdx.h index 81d8cdbf..06fe23bb 100644 --- a/src/gdx.h +++ b/src/gdx.h @@ -60,42 +60,45 @@ class TGXFileObj void SetTraceLevel( TraceLevels tl ); /** - * Get flag to store one dimensional sets as potential domains, false (0) saves lots of space - * for large 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly. - * @return 1 (true) iff. elements of 1-dim sets should be tracked for domain checking, 0 (false) otherwise. + * @brief Get flag to store one dimensional sets as potential domains, false (0) saves lots of space for large + * 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly. Returns 1 + * (true) iff. elements of 1-dim sets should be tracked for domain checking, 0 (false) otherwise. + * @return 1 (true) iff. flag is set, 0 (false) otherwise. */ - int gdxStoreDomainSets() const; + [[nodiscard]] int gdxStoreDomainSets() const; /** - * Set flag to store one dimensional sets as potential domains, false (0) saves lots of space - * for large 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly. - * @param flag 1 (true) iff. elements of 1-dim sets should be tracked for domain checking, 0 (false) otherwise. + * @brief Set flag to store one dimensional sets as potential domains, false (0) saves lots of space for large + * 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly. Param flag + * 1 (true) iff. elements of 1-dim sets should be tracked for domain checking, 0 (false) otherwise. + * @param flag 1 (true) to enable and 0 (false) to disable flag. */ - void gdxStoreDomainSetsSet( int x ); + void gdxStoreDomainSetsSet(int flag); /** - * @brief Set flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomainSets). - * @details Toggle allowing potentially unsafe writing of records to symbols with one dimensional sets as domain, - * when GDX has no lookup table for the elements of this set. - * This can happen when `gdxStoreDomainSets` was disabled by the user to save memory. - * For backwards compatability, this is enabled by default. - * When the user explicitly disables it, e.g. via `gdxAllowBogusDomainsSet(false)`, then using a one dimensional set as - * domain will cause a GDX error (ERR_NODOMAINDATA). - * @param flag 1 (true) iff. using a 1-dim set as domain (when store domain sets option is disabled) should be ignored. - * Otherwise an error is raised (ERR_NODOMAINDATA). + * @brief Get flag to ignore using 1-dim sets as domain when their elements are not tracked (see + * gdxStoreDomainSets). In case the flag is enabled this is allowing potentially unsafe writing of + * records to symbols with one dimensional sets as domain, when GDX has no lookup table for the + * elements of this set. This can happen when `gdxStoreDomainSets` was disabled by the user to save + * memory. For backwards compatability, this is enabled by default. Return 1 (true) iff. using a 1-dim + * set as domain (when store domain sets option is disabled) should be ignored. Otherwise an error is + * raised (ERR_NODOMAINDATA). + * @return 1 (true) iff. flag is set, 0 (false) otherwise. */ - void gdxAllowBogusDomainsSet( int flag ); + [[nodiscard]] int gdxAllowBogusDomains() const; /** - * @brief Get flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomainSets). - * @details In case the flag is enabled this is allowing potentially unsafe writing of records to symbols with - * one dimensional sets as domain, when GDX has no lookup table for the elements of this set. - * This can happen when `gdxStoreDomainSets` was disabled by the user to save memory. - * For backwards compatability, this is enabled by default. - * @return 1 (true) iff. using a 1-dim set as domain (when store domain sets option is disabled) should be ignored. - * Otherwise an error is raised (ERR_NODOMAINDATA). + * @brief Set flag to ignore using 1-dim sets as domain when their elements are not tracked (see + * gdxStoreDomainSets). Toggle allowing potentially unsafe writing of records to symbols with one + * dimensional sets as domain, when GDX has no lookup table for the elements of this set. This can + * happen when `gdxStoreDomainSets` was disabled by the user to save memory. For backwards + * compatability, this is enabled by default. When the user explicitly disables it, e.g. via + * `gdxAllowBogusDomainsSet(false)`, then using a one dimensional set as domain will cause a GDX error + * (ERR_NODOMAINDATA). Param flag 1 (true) iff. using a 1-dim set as domain (when store domain sets + * option is disabled) should be ignored. Otherwise an error is raised (ERR_NODOMAINDATA). + * @param flag 1 (true) to enable and 0 (false) to disable flag. */ - [[nodiscard]] int gdxAllowBogusDomains(); + void gdxAllowBogusDomainsSet(int flag); /** * @brief Add an alias for a set to the symbol table. One of the two identifiers has to be a known set, an diff --git a/src/gdxapi.yaml b/src/gdxapi.yaml index 22c26cc0..4d5c37e5 100644 --- a/src/gdxapi.yaml +++ b/src/gdxapi.yaml @@ -1384,22 +1384,41 @@ properties: type : bool action : r function : StoreDomainSets - description : Flag to store one dimensional sets as potential domains, false saves lots of space for large 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly. + description : > + Get flag to store one dimensional sets as potential domains, false (0) saves lots of space for large 1-dim sets + that are no domains but can create inconsistent GDX files if used incorrectly. Returns 1 (true) iff. elements of + 1-dim sets should be tracked for domain checking, 0 (false) otherwise. - gdxStoreDomainSets: type : bool action : w function : StoreDomainSets - description : Flag to store one dimensional sets as potential domains, false saves lots of space for large 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly. + description : > + Set flag to store one dimensional sets as potential domains, false (0) saves lots of space for large 1-dim sets + that are no domains but can create inconsistent GDX files if used incorrectly. Param flag 1 (true) iff. elements + of 1-dim sets should be tracked for domain checking, 0 (false) otherwise. - gdxAllowBogusDomains: - type : bool - action : r - function : AllowBogusDomains - description : Flag to ignore using 1-dim sets as domain when their elements are not tracked. + type : bool + action : r + function : AllowBogusDomains + description : > + Get flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomainSets). + In case the flag is enabled this is allowing potentially unsafe writing of records to symbols with one dimensional + sets as domain, when GDX has no lookup table for the elements of this set. This can happen when + `gdxStoreDomainSets` was disabled by the user to save memory. For backwards compatability, this is enabled by + default. Return 1 (true) iff. using a 1-dim set as domain (when store domain sets option is disabled) should be + ignored. Otherwise an error is raised (ERR_NODOMAINDATA). - gdxAllowBogusDomains: - type : bool - action : w - function : AllowBogusDomains - description : Flag to ignore using 1-dim sets as domain when their elements are not tracked. + type : bool + action : w + function : AllowBogusDomains + description : > + Set flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomainSets). + Toggle allowing potentially unsafe writing of records to symbols with one dimensional sets as domain, + when GDX has no lookup table for the elements of this set. This can happen when `gdxStoreDomainSets` was disabled + by the user to save memory. For backwards compatability, this is enabled by default. When the user explicitly + disables it, e.g. via `gdxAllowBogusDomainsSet(false)`, then using a one dimensional set as domain will cause a + GDX error (ERR_NODOMAINDATA). Param flag 1 (true) iff. using a 1-dim set as domain (when store domain sets option + is disabled) should be ignored. Otherwise an error is raised (ERR_NODOMAINDATA). #function pointer definitions functionpointers: diff --git a/src/gxfile.cpp b/src/gxfile.cpp index 5e4eb5d0..15e7441d 100644 --- a/src/gxfile.cpp +++ b/src/gxfile.cpp @@ -3554,12 +3554,12 @@ int TGXFileObj::gdxStoreDomainSets() const return StoreDomainSets; } -void TGXFileObj::gdxStoreDomainSetsSet( int x ) +void TGXFileObj::gdxStoreDomainSetsSet( int flag ) { - StoreDomainSets = x; + StoreDomainSets = flag; } -int TGXFileObj::gdxAllowBogusDomains() +int TGXFileObj::gdxAllowBogusDomains() const { return AllowBogusDomain; } diff --git a/src/templates/cwrap.template.j2 b/src/templates/cwrap.template.j2 index 804b94ad..4f1cb8df 100644 --- a/src/templates/cwrap.template.j2 +++ b/src/templates/cwrap.template.j2 @@ -86,10 +86,11 @@ int gdxFree( TGXFileRec_t **pgdx ); int gdxCreate( TGXFileRec_t **pgdx, char *errBuf, int bufSize ); int gdxCreateD( TGXFileRec_t **pgdx, const char *sysDir, char *msgBuf, int msgBufLen ); void gdxDestroy( TGXFileRec_t **pgx ); -int gdxStoreDomainSets( TGXFileRec_t *pgdx ); -void gdxStoreDomainSetsSet( TGXFileRec_t *pgdx, int x ); -int gdxAllowBogusDomains (TGXFileRec_t *pgdx); -void gdxAllowBogusDomainsSet (TGXFileRec_t *pgdx, int x); +{% for property in properties -%} +{%- set isread = property.action == 'r' -%} +{%- if isread -%}int {% else %}void {% endif -%} +{{property.name}}{% if not isread %}Set{% endif %}( TGXFileRec_t *pgdx{% if not isread %}, int flag{%endif%}); +{% endfor -%} void setCallByRef( TGXFileRec_t *TGXFile, const char *FuncName, int cbrValue ); // PROTOTYPES END @@ -144,25 +145,15 @@ GDX_INLINE {{ map_type(fobj|first, fvals.type) }}{{ fobj|first }}( TGXFileRec_t } {% endfor %} -GDX_INLINE int gdxStoreDomainSets( TGXFileRec_t *TGXFile ) +{% for property in properties -%} +{%- set isread = property.action == 'r' -%} +GDX_INLINE {% if isread -%}int {% else %}void {% endif -%} +{{property.name}}{% if not isread %}Set{% endif %}( TGXFileRec_t *pgx{% if not isread %}, int flag{%endif%}) { - return reinterpret_cast( TGXFile )->gdxStoreDomainSets(); + {% if isread %}return reinterpret_cast( pgx )->{{property.name}}();{% else %}reinterpret_cast( pgx )->{{property.name}}Set( flag );{% endif %} } -GDX_INLINE void gdxStoreDomainSetsSet( TGXFileRec_t *TGXFile, int x ) -{ - reinterpret_cast( TGXFile )->gdxStoreDomainSetsSet( x ); -} - -GDX_INLINE int gdxAllowBogusDomains( TGXFileRec_t *TGXFile ) -{ - return reinterpret_cast( TGXFile )->gdxAllowBogusDomains(); -} - -GDX_INLINE void gdxAllowBogusDomainsSet( TGXFileRec_t *TGXFile, int x ) -{ - reinterpret_cast( TGXFile )->gdxAllowBogusDomainsSet( x ); -} +{% endfor -%} GDX_INLINE int gdxFree( TGXFileRec_t **TGXFile ) { diff --git a/src/templates/gdxcppwrap.template.j2 b/src/templates/gdxcppwrap.template.j2 index 0ac1cebd..c9cb35d5 100644 --- a/src/templates/gdxcppwrap.template.j2 +++ b/src/templates/gdxcppwrap.template.j2 @@ -98,6 +98,16 @@ public: ::gdxFree( &pgx ); ::gdxLibraryUnload(); } + +{% for property in properties -%} +{%- set isread = property.action == 'r' %} + {% if isread -%}[[nodiscard]] int {% else %}void {% endif -%} +{{property.name}}{% if not isread %}Set{% endif %}({% if not isread %}int flag{%endif%}){% if isread %} const{% endif %} + { + {% if isread %}return ::{{property.name}}( pgx );{% else %}::{{property.name}}Set( pgx, flag );{% endif %} + } +{% endfor -%} + {% for function in obj.functions -%} {%- set fobj = function.items()|first -%} {%- set fvals = fobj|last -%} @@ -114,25 +124,6 @@ public: {%- if fvals.parameters %}{{' '}}{% endif %}); } {% endfor %} - int gdxStoreDomainSets() - { - return ::gdxStoreDomainSets( pgx ); - } - - void gdxStoreDomainSetsSet( int x ) - { - ::gdxStoreDomainSetsSet( pgx, x ); - } - - void gdxAllowBogusDomainsSet( int flag ) - { - ::gdxAllowBogusDomainsSet( pgx, flag ); - } - - [[nodiscard]] int gdxAllowBogusDomains() - { - return ::gdxAllowBogusDomains( pgx ); - } int gdxUELMaxLength() { diff --git a/src/templates/gdxheader.template.j2 b/src/templates/gdxheader.template.j2 index 4fb102e6..1a7b1db1 100644 --- a/src/templates/gdxheader.template.j2 +++ b/src/templates/gdxheader.template.j2 @@ -58,44 +58,17 @@ public: trl_all }; void SetTraceLevel( TraceLevels tl ); - +{% for property in properties -%} +{%- set isread = property.action == 'r' %} /** - * Get flag to store one dimensional sets as potential domains, false (0) saves lots of space - * for large 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly. - * @return 1 (true) iff. elements of 1-dim sets should be tracked for domain checking, 0 (false) otherwise. + * @brief {{beautify_html(property.description)}} + * {% if isread %}@return 1 (true) iff. flag is set, 0 (false) otherwise. + {%- else -%}@param flag 1 (true) to enable and 0 (false) to disable flag.{% endif %} */ - int gdxStoreDomainSets() const; + {% if isread -%}[[nodiscard]] int {% else %}void {% endif -%} +{{property.name}}{% if not isread %}Set{% endif %}({% if not isread %}int flag{%endif%}){% if isread %} const{% endif %}; +{% endfor -%} - /** - * Set flag to store one dimensional sets as potential domains, false (0) saves lots of space - * for large 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly. - * @param flag 1 (true) iff. elements of 1-dim sets should be tracked for domain checking, 0 (false) otherwise. - */ - void gdxStoreDomainSetsSet( int x ); - - /** - * @brief Set flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomainSets). - * @details Toggle allowing potentially unsafe writing of records to symbols with one dimensional sets as domain, - * when GDX has no lookup table for the elements of this set. - * This can happen when `gdxStoreDomainSets` was disabled by the user to save memory. - * For backwards compatability, this is enabled by default. - * When the user explicitly disables it, e.g. via `gdxAllowBogusDomainsSet(false)`, then using a one dimensional set as - * domain will cause a GDX error (ERR_NODOMAINDATA). - * @param flag 1 (true) iff. using a 1-dim set as domain (when store domain sets option is disabled) should be ignored. - * Otherwise an error is raised (ERR_NODOMAINDATA). - */ - void gdxAllowBogusDomainsSet( int flag ); - - /** - * @brief Get flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomainSets). - * @details In case the flag is enabled this is allowing potentially unsafe writing of records to symbols with - * one dimensional sets as domain, when GDX has no lookup table for the elements of this set. - * This can happen when `gdxStoreDomainSets` was disabled by the user to save memory. - * For backwards compatability, this is enabled by default. - * @return 1 (true) iff. using a 1-dim set as domain (when store domain sets option is disabled) should be ignored. - * Otherwise an error is raised (ERR_NODOMAINDATA). - */ - [[nodiscard]] int gdxAllowBogusDomains(); {% for group in groups -%} {%- if group %} /// \name {{group}} diff --git a/src/yaml2cwrap.py b/src/yaml2cwrap.py index 74cb7bfd..502b4002 100644 --- a/src/yaml2cwrap.py +++ b/src/yaml2cwrap.py @@ -28,7 +28,7 @@ def generate_c_wrapper(input, template_folder, template, output): env.globals['fp_decor'] = fp_decor template = env.get_template(template) with open(output, 'w') as fp: - fp.write(template.render(obj=obj)) + fp.write(template.render(obj=obj, properties=yaml2doxy.nice_properties(obj))) def main(): diff --git a/src/yaml2doxy.py b/src/yaml2doxy.py index 386652f0..10a7c583 100644 --- a/src/yaml2doxy.py +++ b/src/yaml2doxy.py @@ -95,6 +95,7 @@ def map_type(func_name, type_acro): return map_type + def collect_groups(functions): groups = [] gtf = {} @@ -111,6 +112,16 @@ def collect_groups(functions): return groups, gtf +def nice_property(prop): + name = list(prop.keys())[0] + res = dict(name=name) + res.update(prop[name]) + return res + + +def nice_properties(obj): + return [nice_property(p) for p in obj['properties']] + def generate_method_declarations(input_yaml_fn, template_folder, template_fn, output_header_fn): with open(input_yaml_fn) as fp: @@ -121,7 +132,7 @@ def generate_method_declarations(input_yaml_fn, template_folder, template_fn, ou env.globals[f.__name__] = f template = env.get_template(template_fn) with open(output_header_fn, 'w') as fp: - fp.write(template.render(obj=obj, groups=groups, gtf=gtf)) + fp.write(template.render(obj=obj, groups=groups, gtf=gtf, properties=nice_properties(obj))) def main(): From a8c602eb910f9123200f3d76680a1056ebecc88b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schnabel?= Date: Mon, 13 Nov 2023 21:28:46 +0000 Subject: [PATCH 4/5] Resolve "Add flag/option to map all acronym values (>=GMS_SV_ACR) to NaN" --- changelog.yaml | 3 +- generated/cwrap.hpp | 12 + generated/gdxcc.c | 23 + generated/gdxcc.h | 12 + generated/gdxcclib.cpp | 24 + generated/gdxcppwrap.h | 947 ++++++++++++++------------- src/gdx.h | 14 +- src/gdxapi.yaml | 10 + src/gxfile.cpp | 13 + src/templates/gdxcppwrap.template.j2 | 33 +- src/templates/gdxheader.template.j2 | 2 +- src/tests/gdxtests.cpp | 38 +- 12 files changed, 640 insertions(+), 491 deletions(-) diff --git a/changelog.yaml b/changelog.yaml index 915dc8ee..875109a0 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1,5 +1,6 @@ --- -- 7.9.2: +- 7.10.0: + - Added boolean property gdxMapAcronymsToNaN (disabled by default) that maps all acronym values to special value "Not a Number" (NaN). - Removed XCode project file for unit test suite as it is not maintained anymore. - > Entries for property setters and getters in main header and wrappers are now automatically generated from API diff --git a/generated/cwrap.hpp b/generated/cwrap.hpp index db99f444..4b8f40e3 100644 --- a/generated/cwrap.hpp +++ b/generated/cwrap.hpp @@ -171,6 +171,8 @@ int gdxStoreDomainSets( TGXFileRec_t *pgdx); void gdxStoreDomainSetsSet( TGXFileRec_t *pgdx, int flag); int gdxAllowBogusDomains( TGXFileRec_t *pgdx); void gdxAllowBogusDomainsSet( TGXFileRec_t *pgdx, int flag); +int gdxMapAcronymsToNaN( TGXFileRec_t *pgdx); +void gdxMapAcronymsToNaNSet( TGXFileRec_t *pgdx, int flag); void setCallByRef( TGXFileRec_t *TGXFile, const char *FuncName, int cbrValue ); // PROTOTYPES END @@ -678,6 +680,16 @@ GDX_INLINE void gdxAllowBogusDomainsSet( TGXFileRec_t *pgx, int flag) reinterpret_cast( pgx )->gdxAllowBogusDomainsSet( flag ); } +GDX_INLINE int gdxMapAcronymsToNaN( TGXFileRec_t *pgx) +{ + return reinterpret_cast( pgx )->gdxMapAcronymsToNaN(); +} + +GDX_INLINE void gdxMapAcronymsToNaNSet( TGXFileRec_t *pgx, int flag) +{ + reinterpret_cast( pgx )->gdxMapAcronymsToNaNSet( flag ); +} + GDX_INLINE int gdxFree( TGXFileRec_t **TGXFile ) { gdxDestroy( TGXFile ); diff --git a/generated/gdxcc.c b/generated/gdxcc.c index 0baa4f19..7173552d 100644 --- a/generated/gdxcc.c +++ b/generated/gdxcc.c @@ -1492,6 +1492,27 @@ void GDX_CALLCONV d_gdxAllowBogusDomainsSet (gdxHandle_t pgdx,const int x) printNoReturn(gdxAllowBogusDomainsSet,1) } +/** Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default. + * @param pgdx gdx object handle + */ +int GDX_CALLCONV d_gdxMapAcronymsToNaN (gdxHandle_t pgdx) +{ + int d_s[]={15}; + GAMS_UNUSED(pgdx) + printAndReturn(gdxMapAcronymsToNaN,0,int ) +} + +/** Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default. + * @param pgdx gdx object handle + */ +void GDX_CALLCONV d_gdxMapAcronymsToNaNSet (gdxHandle_t pgdx,const int x) +{ + int d_s[]={0,15}; + GAMS_UNUSED(pgdx) + GAMS_UNUSED(x) + printNoReturn(gdxMapAcronymsToNaNSet,1) +} + /** return dirName on success, NULL on failure */ static char * @@ -1857,6 +1878,8 @@ XLibraryLoad (const char *dllName, char *errBuf, int errBufSize) {int s[]={0,15}; CheckAndLoad(gdxStoreDomainSetsSet,1,"C__"); } {int s[]={15}; CheckAndLoad(gdxAllowBogusDomains,0,"C__"); } {int s[]={0,15}; CheckAndLoad(gdxAllowBogusDomainsSet,1,"C__"); } + {int s[]={15}; CheckAndLoad(gdxMapAcronymsToNaN,0,"C__"); } + {int s[]={0,15}; CheckAndLoad(gdxMapAcronymsToNaNSet,1,"C__"); } return 0; diff --git a/generated/gdxcc.h b/generated/gdxcc.h index 11f1724d..07840591 100644 --- a/generated/gdxcc.h +++ b/generated/gdxcc.h @@ -237,6 +237,8 @@ int GDX_CALLCONV d_gdxStoreDomainSets (gdxHandle_t pgdx); void GDX_CALLCONV d_gdxStoreDomainSetsSet (gdxHandle_t pgdx, const int x); int GDX_CALLCONV d_gdxAllowBogusDomains (gdxHandle_t pgdx); void GDX_CALLCONV d_gdxAllowBogusDomainsSet (gdxHandle_t pgdx, const int x); +int GDX_CALLCONV d_gdxMapAcronymsToNaN (gdxHandle_t pgdx); +void GDX_CALLCONV d_gdxMapAcronymsToNaNSet (gdxHandle_t pgdx, const int x); typedef int (GDX_CALLCONV *gdxAcronymAdd_t) (gdxHandle_t pgdx, const char *AName, const char *Txt, int AIndx); @@ -1155,6 +1157,16 @@ GDX_FUNCPTR(gdxAllowBogusDomains); typedef void (GDX_CALLCONV *gdxAllowBogusDomainsSet_t) (gdxHandle_t pgdx, const int x); GDX_FUNCPTR(gdxAllowBogusDomainsSet); +typedef int (GDX_CALLCONV *gdxMapAcronymsToNaN_t) (gdxHandle_t pgdx); +/** Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default. + * + * @param pgdx gdx object handle + */ +GDX_FUNCPTR(gdxMapAcronymsToNaN); + +typedef void (GDX_CALLCONV *gdxMapAcronymsToNaNSet_t) (gdxHandle_t pgdx, const int x); +GDX_FUNCPTR(gdxMapAcronymsToNaNSet); + #if defined(__cplusplus) } #endif diff --git a/generated/gdxcclib.cpp b/generated/gdxcclib.cpp index e2fb783a..b8fec033 100644 --- a/generated/gdxcclib.cpp +++ b/generated/gdxcclib.cpp @@ -204,6 +204,8 @@ #define C__gdxStoreDomainSetsSet c__gdxstoredomainsetsset #define C__gdxAllowBogusDomains c__gdxallowbogusdomains #define C__gdxAllowBogusDomainsSet c__gdxallowbogusdomainsset +#define C__gdxMapAcronymsToNaN c__gdxmapacronymstonan +#define C__gdxMapAcronymsToNaNSet c__gdxmapacronymstonanset /* declarations shut up compiler warnings */ @@ -882,6 +884,16 @@ GDX_API int GDX_CALLCONV C__XCheck(const char *funcn, int ClNrArg, int Clsign[], DLLsign[0] = 0; DLLsign[1] = 15; return CheckSign(funcn,1,ClNrArg,DLLsign,Clsign,Msg); } + else if(!strcmp(funcn,"gdxMapAcronymsToNaN")) + { + DLLsign[0] = 15; + return CheckSign(funcn,0,ClNrArg,DLLsign,Clsign,Msg); + } + else if(!strcmp(funcn,"gdxMapAcronymsToNaNSet")) + { + DLLsign[0] = 0; DLLsign[1] = 15; + return CheckSign(funcn,1,ClNrArg,DLLsign,Clsign,Msg); + } else { sprintf(Msg,"gdxcclib: %s cannot be found in library.",funcn); @@ -2123,5 +2135,17 @@ GDX_API void GDX_CALLCONV C__gdxAllowBogusDomainsSet(TGXFileRec_t *TGXFile, int gdxAllowBogusDomainsSet(TGXFile,x); } +GDX_API int GDX_CALLCONV C__gdxMapAcronymsToNaN(TGXFileRec_t *TGXFile); +GDX_API int GDX_CALLCONV C__gdxMapAcronymsToNaN(TGXFileRec_t *TGXFile) +{ + return gdxMapAcronymsToNaN(TGXFile); +} + +GDX_API void GDX_CALLCONV C__gdxMapAcronymsToNaNSet(TGXFileRec_t *TGXFile, int x); +GDX_API void GDX_CALLCONV C__gdxMapAcronymsToNaNSet(TGXFileRec_t *TGXFile, int x) +{ + gdxMapAcronymsToNaNSet(TGXFile,x); +} + #endif diff --git a/generated/gdxcppwrap.h b/generated/gdxcppwrap.h index a13ffbbd..82aa8fa0 100644 --- a/generated/gdxcppwrap.h +++ b/generated/gdxcppwrap.h @@ -100,476 +100,485 @@ class TGXFileObj } - [[nodiscard]] int gdxStoreDomainSets() const - { - return ::gdxStoreDomainSets( pgx ); - } - - void gdxStoreDomainSetsSet(int flag) - { - ::gdxStoreDomainSetsSet( pgx, flag ); - } - - [[nodiscard]] int gdxAllowBogusDomains() const - { - return ::gdxAllowBogusDomains( pgx ); - } - - void gdxAllowBogusDomainsSet(int flag) - { - ::gdxAllowBogusDomainsSet( pgx, flag ); - } - - int gdxAcronymAdd( const char *AName, const char *Txt, int AIndx ) - { - return ::gdxAcronymAdd( pgx, AName, Txt, AIndx ); - } - - int gdxAcronymCount() const - { - return ::gdxAcronymCount( pgx ); - } - - int gdxAcronymGetInfo( int N, char *AName, char *Txt, int &AIndx ) const - { - return ::gdxAcronymGetInfo( pgx, N, AName, Txt, &AIndx ); - } - - int gdxAcronymGetMapping( int N, int &orgIndx, int &newIndx, int &autoIndex ) - { - return ::gdxAcronymGetMapping( pgx, N, &orgIndx, &newIndx, &autoIndex ); - } - - int gdxAcronymIndex( double V ) const - { - return ::gdxAcronymIndex( pgx, V ); - } - - int gdxAcronymName( double V, char *AName ) - { - return ::gdxAcronymName( pgx, V, AName ); - } - - int gdxAcronymNextNr( int NV ) - { - return ::gdxAcronymNextNr( pgx, NV ); - } - - int gdxAcronymSetInfo( int N, const char *AName, const char *Txt, int AIndx ) - { - return ::gdxAcronymSetInfo( pgx, N, AName, Txt, AIndx ); - } - - double gdxAcronymValue( int AIndx ) const - { - return ::gdxAcronymValue( pgx, AIndx ); - } - - int gdxAddAlias( const char *Id1, const char *Id2 ) - { - return ::gdxAddAlias( pgx, Id1, Id2 ); - } - - int gdxAddSetText( const char *Txt, int &TxtNr ) - { - return ::gdxAddSetText( pgx, Txt, &TxtNr ); - } - - int gdxAutoConvert( int NV ) - { - return ::gdxAutoConvert( pgx, NV ); - } - - int gdxClose() - { - return ::gdxClose( pgx ); - } - - int gdxDataErrorCount() const - { - return ::gdxDataErrorCount( pgx ); - } - - int gdxDataErrorRecord( int RecNr, int *KeyInt, double *Values ) - { - return ::gdxDataErrorRecord( pgx, RecNr, KeyInt, Values ); - } - - int gdxDataErrorRecordX( int RecNr, int *KeyInt, double *Values ) - { - return ::gdxDataErrorRecordX( pgx, RecNr, KeyInt, Values ); - } - - int gdxDataReadDone() - { - return ::gdxDataReadDone( pgx ); - } - - int gdxDataReadFilteredStart( int SyNr, const int *FilterAction, int &NrRecs ) - { - return ::gdxDataReadFilteredStart( pgx, SyNr, FilterAction, &NrRecs ); - } - - int gdxDataReadMap( int RecNr, int *KeyInt, double *Values, int &DimFrst ) - { - return ::gdxDataReadMap( pgx, RecNr, KeyInt, Values, &DimFrst ); - } - - int gdxDataReadMapStart( int SyNr, int &NrRecs ) - { - return ::gdxDataReadMapStart( pgx, SyNr, &NrRecs ); - } - - int gdxDataReadRaw( int *KeyInt, double *Values, int &DimFrst ) - { - return ::gdxDataReadRaw( pgx, KeyInt, Values, &DimFrst ); - } - - int gdxDataReadRawFast( int SyNr, TDataStoreProc_t DP, int &NrRecs ) - { - return ::gdxDataReadRawFast( pgx, SyNr, DP, &NrRecs ); - } - - int gdxDataReadRawFastEx( int SyNr, TDataStoreExProc_t DP, int &NrRecs, void *Uptr ) - { - return ::gdxDataReadRawFastEx( pgx, SyNr, DP, &NrRecs, Uptr ); - } - - int gdxDataReadRawFastFilt( int SyNr, const char **UelFilterStr, TDataStoreFiltProc_t DP ) - { - return ::gdxDataReadRawFastFilt( pgx, SyNr, UelFilterStr, DP ); - } - - int gdxDataReadRawStart( int SyNr, int &NrRecs ) - { - return ::gdxDataReadRawStart( pgx, SyNr, &NrRecs ); - } - - int gdxDataReadSlice( const char **UelFilterStr, int &Dimen, TDataStoreProc_t DP ) - { - return ::gdxDataReadSlice( pgx, UelFilterStr, &Dimen, DP ); - } - - int gdxDataReadSliceStart( int SyNr, int *ElemCounts ) - { - return ::gdxDataReadSliceStart( pgx, SyNr, ElemCounts ); - } - - int gdxDataReadStr( char **KeyStr, double *Values, int &DimFrst ) - { - return ::gdxDataReadStr( pgx, KeyStr, Values, &DimFrst ); - } - - int gdxDataReadStrStart( int SyNr, int &NrRecs ) - { - return ::gdxDataReadStrStart( pgx, SyNr, &NrRecs ); - } - - int gdxDataSliceUELS( const int *SliceKeyInt, char **KeyStr ) - { - return ::gdxDataSliceUELS( pgx, SliceKeyInt, KeyStr ); - } - - int gdxDataWriteDone() - { - return ::gdxDataWriteDone( pgx ); - } - - int gdxDataWriteMap( const int *KeyInt, const double *Values ) - { - return ::gdxDataWriteMap( pgx, KeyInt, Values ); - } - - int gdxDataWriteMapStart( const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo ) - { - return ::gdxDataWriteMapStart( pgx, SyId, ExplTxt, Dimen, Typ, UserInfo ); - } - - int gdxDataWriteRaw( const int *KeyInt, const double *Values ) - { - return ::gdxDataWriteRaw( pgx, KeyInt, Values ); - } - - int gdxDataWriteRawStart( const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo ) - { - return ::gdxDataWriteRawStart( pgx, SyId, ExplTxt, Dimen, Typ, UserInfo ); - } - - int gdxDataWriteStr( const char **KeyStr, const double *Values ) - { - return ::gdxDataWriteStr( pgx, KeyStr, Values ); - } - - int gdxDataWriteStrStart( const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo ) - { - return ::gdxDataWriteStrStart( pgx, SyId, ExplTxt, Dimen, Typ, UserInfo ); - } - - int gdxGetDLLVersion( char *V ) - { - return ::gdxGetDLLVersion( pgx, V ); - } - - int gdxErrorCount() const - { - return ::gdxErrorCount( pgx ); - } - - static int gdxErrorStr( int ErrNr, char *ErrMsg ) - { - return ::gdxErrorStr( nullptr, ErrNr, ErrMsg ); - } - - int gdxFileInfo( int &FileVer, int &ComprLev ) const - { - return ::gdxFileInfo( pgx, &FileVer, &ComprLev ); - } - - int gdxFileVersion( char *FileStr, char *ProduceStr ) const - { - return ::gdxFileVersion( pgx, FileStr, ProduceStr ); - } - - int gdxFilterExists( int FilterNr ) - { - return ::gdxFilterExists( pgx, FilterNr ); - } - - int gdxFilterRegister( int UelMap ) - { - return ::gdxFilterRegister( pgx, UelMap ); - } - - int gdxFilterRegisterDone() - { - return ::gdxFilterRegisterDone( pgx ); - } - - int gdxFilterRegisterStart( int FilterNr ) - { - return ::gdxFilterRegisterStart( pgx, FilterNr ); - } - - int gdxFindSymbol( const char *SyId, int &SyNr ) - { - return ::gdxFindSymbol( pgx, SyId, &SyNr ); - } - - int gdxGetElemText( int TxtNr, char *Txt, int &Node ) - { - return ::gdxGetElemText( pgx, TxtNr, Txt, &Node ); - } - - int gdxGetLastError() - { - return ::gdxGetLastError( pgx ); - } - - int64_t gdxGetMemoryUsed() - { - return ::gdxGetMemoryUsed( pgx ); - } - - int gdxGetSpecialValues( double *AVals ) - { - return ::gdxGetSpecialValues( pgx, AVals ); - } - - int gdxGetUEL( int UelNr, char *Uel ) const - { - return ::gdxGetUEL( pgx, UelNr, Uel ); - } - - int gdxMapValue( double D, int &sv ) - { - return ::gdxMapValue( pgx, D, &sv ); - } - - int gdxOpenAppend( const char *FileName, const char *Producer, int &ErrNr ) - { - return ::gdxOpenAppend( pgx, FileName, Producer, &ErrNr ); - } - - int gdxOpenRead( const char *FileName, int &ErrNr ) - { - return ::gdxOpenRead( pgx, FileName, &ErrNr ); - } - - int gdxOpenReadEx( const char *FileName, int ReadMode, int &ErrNr ) - { - return ::gdxOpenReadEx( pgx, FileName, ReadMode, &ErrNr ); - } - - int gdxOpenWrite( const char *FileName, const char *Producer, int &ErrNr ) - { - return ::gdxOpenWrite( pgx, FileName, Producer, &ErrNr ); - } - - int gdxOpenWriteEx( const char *FileName, const char *Producer, int Compr, int &ErrNr ) - { - return ::gdxOpenWriteEx( pgx, FileName, Producer, Compr, &ErrNr ); - } - - int gdxResetSpecialValues() - { - return ::gdxResetSpecialValues( pgx ); - } - - int gdxSetHasText( int SyNr ) - { - return ::gdxSetHasText( pgx, SyNr ); - } - - int gdxSetReadSpecialValues( const double *AVals ) - { - return ::gdxSetReadSpecialValues( pgx, AVals ); - } - - int gdxSetSpecialValues( const double *AVals ) - { - return ::gdxSetSpecialValues( pgx, AVals ); - } - - int gdxSetTextNodeNr( int TxtNr, int Node ) - { - return ::gdxSetTextNodeNr( pgx, TxtNr, Node ); - } - - int gdxSetTraceLevel( int N, const char *s ) - { - return ::gdxSetTraceLevel( pgx, N, s ); - } - - int gdxSymbIndxMaxLength( int SyNr, int *LengthInfo ) - { - return ::gdxSymbIndxMaxLength( pgx, SyNr, LengthInfo ); - } - - int gdxSymbMaxLength() const - { - return ::gdxSymbMaxLength( pgx ); - } - - int gdxSymbolAddComment( int SyNr, const char *Txt ) - { - return ::gdxSymbolAddComment( pgx, SyNr, Txt ); - } - - int gdxSymbolGetComment( int SyNr, int N, char *Txt ) - { - return ::gdxSymbolGetComment( pgx, SyNr, N, Txt ); - } - - int gdxSymbolGetDomain( int SyNr, int *DomainSyNrs ) - { - return ::gdxSymbolGetDomain( pgx, SyNr, DomainSyNrs ); - } - - int gdxSymbolGetDomainX( int SyNr, char **DomainIDs ) - { - return ::gdxSymbolGetDomainX( pgx, SyNr, DomainIDs ); - } - - int gdxSymbolDim( int SyNr ) - { - return ::gdxSymbolDim( pgx, SyNr ); - } - - int gdxSymbolInfo( int SyNr, char *SyId, int &Dimen, int &Typ ) - { - return ::gdxSymbolInfo( pgx, SyNr, SyId, &Dimen, &Typ ); - } - - int gdxSymbolInfoX( int SyNr, int &RecCnt, int &UserInfo, char *ExplTxt ) - { - return ::gdxSymbolInfoX( pgx, SyNr, &RecCnt, &UserInfo, ExplTxt ); - } - - int gdxSymbolSetDomain( const char **DomainIDs ) - { - return ::gdxSymbolSetDomain( pgx, DomainIDs ); - } - - int gdxSymbolSetDomainX( int SyNr, const char **DomainIDs ) - { - return ::gdxSymbolSetDomainX( pgx, SyNr, DomainIDs ); - } - - int gdxSystemInfo( int &SyCnt, int &UelCnt ) const - { - return ::gdxSystemInfo( pgx, &SyCnt, &UelCnt ); - } - - int gdxUELMaxLength() const - { - return ::gdxUELMaxLength( pgx ); - } - - int gdxUELRegisterDone() - { - return ::gdxUELRegisterDone( pgx ); - } - - int gdxUELRegisterMap( int UMap, const char *Uel ) - { - return ::gdxUELRegisterMap( pgx, UMap, Uel ); - } - - int gdxUELRegisterMapStart() - { - return ::gdxUELRegisterMapStart( pgx ); - } - - int gdxUELRegisterRaw( const char *Uel ) - { - return ::gdxUELRegisterRaw( pgx, Uel ); - } - - int gdxUELRegisterRawStart() - { - return ::gdxUELRegisterRawStart( pgx ); - } - - int gdxUELRegisterStr( const char *Uel, int &UelNr ) - { - return ::gdxUELRegisterStr( pgx, Uel, &UelNr ); - } - - int gdxUELRegisterStrStart() - { - return ::gdxUELRegisterStrStart( pgx ); - } - - int gdxUMFindUEL( const char *Uel, int &UelNr, int &UelMap ) - { - return ::gdxUMFindUEL( pgx, Uel, &UelNr, &UelMap ); - } - - int gdxUMUelGet( int UelNr, char *Uel, int &UelMap ) - { - return ::gdxUMUelGet( pgx, UelNr, Uel, &UelMap ); - } - - int gdxUMUelInfo( int &UelCnt, int &HighMap ) const - { - return ::gdxUMUelInfo( pgx, &UelCnt, &HighMap ); - } - - int gdxGetDomainElements( int SyNr, int DimPos, int FilterNr, TDomainIndexProc_t DP, int &NrElem, void *Uptr ) - { - return ::gdxGetDomainElements( pgx, SyNr, DimPos, FilterNr, DP, &NrElem, Uptr ); - } - - int gdxCurrentDim() const - { - return ::gdxCurrentDim( pgx ); - } - - int gdxRenameUEL( const char *OldName, const char *NewName ) - { - return ::gdxRenameUEL( pgx, OldName, NewName ); - } + [[nodiscard]] int gdxStoreDomainSets() const + { + return ::gdxStoreDomainSets( pgx ); + } + + void gdxStoreDomainSetsSet(int flag) + { + ::gdxStoreDomainSetsSet( pgx, flag ); + } + + [[nodiscard]] int gdxAllowBogusDomains() const + { + return ::gdxAllowBogusDomains( pgx ); + } + + void gdxAllowBogusDomainsSet(int flag) + { + ::gdxAllowBogusDomainsSet( pgx, flag ); + } + + [[nodiscard]] int gdxMapAcronymsToNaN() const + { + return ::gdxMapAcronymsToNaN( pgx ); + } + + void gdxMapAcronymsToNaNSet(int flag) + { + ::gdxMapAcronymsToNaNSet( pgx, flag ); + } + + int gdxAcronymAdd( const char *AName, const char *Txt, int AIndx ) + { + return ::gdxAcronymAdd( pgx, AName, Txt, AIndx ); + } + + int gdxAcronymCount() const + { + return ::gdxAcronymCount( pgx ); + } + + int gdxAcronymGetInfo( int N, char *AName, char *Txt, int &AIndx ) const + { + return ::gdxAcronymGetInfo( pgx, N, AName, Txt, &AIndx ); + } + + int gdxAcronymGetMapping( int N, int &orgIndx, int &newIndx, int &autoIndex ) + { + return ::gdxAcronymGetMapping( pgx, N, &orgIndx, &newIndx, &autoIndex ); + } + + int gdxAcronymIndex( double V ) const + { + return ::gdxAcronymIndex( pgx, V ); + } + + int gdxAcronymName( double V, char *AName ) + { + return ::gdxAcronymName( pgx, V, AName ); + } + + int gdxAcronymNextNr( int NV ) + { + return ::gdxAcronymNextNr( pgx, NV ); + } + + int gdxAcronymSetInfo( int N, const char *AName, const char *Txt, int AIndx ) + { + return ::gdxAcronymSetInfo( pgx, N, AName, Txt, AIndx ); + } + + double gdxAcronymValue( int AIndx ) const + { + return ::gdxAcronymValue( pgx, AIndx ); + } + + int gdxAddAlias( const char *Id1, const char *Id2 ) + { + return ::gdxAddAlias( pgx, Id1, Id2 ); + } + + int gdxAddSetText( const char *Txt, int &TxtNr ) + { + return ::gdxAddSetText( pgx, Txt, &TxtNr ); + } + + int gdxAutoConvert( int NV ) + { + return ::gdxAutoConvert( pgx, NV ); + } + + int gdxClose() + { + return ::gdxClose( pgx ); + } + + int gdxDataErrorCount() const + { + return ::gdxDataErrorCount( pgx ); + } + + int gdxDataErrorRecord( int RecNr, int *KeyInt, double *Values ) + { + return ::gdxDataErrorRecord( pgx, RecNr, KeyInt, Values ); + } + + int gdxDataErrorRecordX( int RecNr, int *KeyInt, double *Values ) + { + return ::gdxDataErrorRecordX( pgx, RecNr, KeyInt, Values ); + } + + int gdxDataReadDone() + { + return ::gdxDataReadDone( pgx ); + } + + int gdxDataReadFilteredStart( int SyNr, const int *FilterAction, int &NrRecs ) + { + return ::gdxDataReadFilteredStart( pgx, SyNr, FilterAction, &NrRecs ); + } + + int gdxDataReadMap( int RecNr, int *KeyInt, double *Values, int &DimFrst ) + { + return ::gdxDataReadMap( pgx, RecNr, KeyInt, Values, &DimFrst ); + } + + int gdxDataReadMapStart( int SyNr, int &NrRecs ) + { + return ::gdxDataReadMapStart( pgx, SyNr, &NrRecs ); + } + + int gdxDataReadRaw( int *KeyInt, double *Values, int &DimFrst ) + { + return ::gdxDataReadRaw( pgx, KeyInt, Values, &DimFrst ); + } + + int gdxDataReadRawFast( int SyNr, TDataStoreProc_t DP, int &NrRecs ) + { + return ::gdxDataReadRawFast( pgx, SyNr, DP, &NrRecs ); + } + + int gdxDataReadRawFastEx( int SyNr, TDataStoreExProc_t DP, int &NrRecs, void *Uptr ) + { + return ::gdxDataReadRawFastEx( pgx, SyNr, DP, &NrRecs, Uptr ); + } + + int gdxDataReadRawFastFilt( int SyNr, const char **UelFilterStr, TDataStoreFiltProc_t DP ) + { + return ::gdxDataReadRawFastFilt( pgx, SyNr, UelFilterStr, DP ); + } + + int gdxDataReadRawStart( int SyNr, int &NrRecs ) + { + return ::gdxDataReadRawStart( pgx, SyNr, &NrRecs ); + } + + int gdxDataReadSlice( const char **UelFilterStr, int &Dimen, TDataStoreProc_t DP ) + { + return ::gdxDataReadSlice( pgx, UelFilterStr, &Dimen, DP ); + } + + int gdxDataReadSliceStart( int SyNr, int *ElemCounts ) + { + return ::gdxDataReadSliceStart( pgx, SyNr, ElemCounts ); + } + + int gdxDataReadStr( char **KeyStr, double *Values, int &DimFrst ) + { + return ::gdxDataReadStr( pgx, KeyStr, Values, &DimFrst ); + } + + int gdxDataReadStrStart( int SyNr, int &NrRecs ) + { + return ::gdxDataReadStrStart( pgx, SyNr, &NrRecs ); + } + + int gdxDataSliceUELS( const int *SliceKeyInt, char **KeyStr ) + { + return ::gdxDataSliceUELS( pgx, SliceKeyInt, KeyStr ); + } + + int gdxDataWriteDone() + { + return ::gdxDataWriteDone( pgx ); + } + + int gdxDataWriteMap( const int *KeyInt, const double *Values ) + { + return ::gdxDataWriteMap( pgx, KeyInt, Values ); + } + + int gdxDataWriteMapStart( const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo ) + { + return ::gdxDataWriteMapStart( pgx, SyId, ExplTxt, Dimen, Typ, UserInfo ); + } + + int gdxDataWriteRaw( const int *KeyInt, const double *Values ) + { + return ::gdxDataWriteRaw( pgx, KeyInt, Values ); + } + + int gdxDataWriteRawStart( const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo ) + { + return ::gdxDataWriteRawStart( pgx, SyId, ExplTxt, Dimen, Typ, UserInfo ); + } + + int gdxDataWriteStr( const char **KeyStr, const double *Values ) + { + return ::gdxDataWriteStr( pgx, KeyStr, Values ); + } + + int gdxDataWriteStrStart( const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo ) + { + return ::gdxDataWriteStrStart( pgx, SyId, ExplTxt, Dimen, Typ, UserInfo ); + } + + int gdxGetDLLVersion( char *V ) + { + return ::gdxGetDLLVersion( pgx, V ); + } + + int gdxErrorCount() const + { + return ::gdxErrorCount( pgx ); + } + + static int gdxErrorStr( int ErrNr, char *ErrMsg ) + { + return ::gdxErrorStr( nullptr, ErrNr, ErrMsg ); + } + + int gdxFileInfo( int &FileVer, int &ComprLev ) const + { + return ::gdxFileInfo( pgx, &FileVer, &ComprLev ); + } + + int gdxFileVersion( char *FileStr, char *ProduceStr ) const + { + return ::gdxFileVersion( pgx, FileStr, ProduceStr ); + } + + int gdxFilterExists( int FilterNr ) + { + return ::gdxFilterExists( pgx, FilterNr ); + } + + int gdxFilterRegister( int UelMap ) + { + return ::gdxFilterRegister( pgx, UelMap ); + } + + int gdxFilterRegisterDone() + { + return ::gdxFilterRegisterDone( pgx ); + } + + int gdxFilterRegisterStart( int FilterNr ) + { + return ::gdxFilterRegisterStart( pgx, FilterNr ); + } + + int gdxFindSymbol( const char *SyId, int &SyNr ) + { + return ::gdxFindSymbol( pgx, SyId, &SyNr ); + } + + int gdxGetElemText( int TxtNr, char *Txt, int &Node ) + { + return ::gdxGetElemText( pgx, TxtNr, Txt, &Node ); + } + + int gdxGetLastError() + { + return ::gdxGetLastError( pgx ); + } + + int64_t gdxGetMemoryUsed() + { + return ::gdxGetMemoryUsed( pgx ); + } + + int gdxGetSpecialValues( double *AVals ) + { + return ::gdxGetSpecialValues( pgx, AVals ); + } + + int gdxGetUEL( int UelNr, char *Uel ) const + { + return ::gdxGetUEL( pgx, UelNr, Uel ); + } + + int gdxMapValue( double D, int &sv ) + { + return ::gdxMapValue( pgx, D, &sv ); + } + + int gdxOpenAppend( const char *FileName, const char *Producer, int &ErrNr ) + { + return ::gdxOpenAppend( pgx, FileName, Producer, &ErrNr ); + } + + int gdxOpenRead( const char *FileName, int &ErrNr ) + { + return ::gdxOpenRead( pgx, FileName, &ErrNr ); + } + + int gdxOpenReadEx( const char *FileName, int ReadMode, int &ErrNr ) + { + return ::gdxOpenReadEx( pgx, FileName, ReadMode, &ErrNr ); + } + + int gdxOpenWrite( const char *FileName, const char *Producer, int &ErrNr ) + { + return ::gdxOpenWrite( pgx, FileName, Producer, &ErrNr ); + } + + int gdxOpenWriteEx( const char *FileName, const char *Producer, int Compr, int &ErrNr ) + { + return ::gdxOpenWriteEx( pgx, FileName, Producer, Compr, &ErrNr ); + } + + int gdxResetSpecialValues() + { + return ::gdxResetSpecialValues( pgx ); + } + + int gdxSetHasText( int SyNr ) + { + return ::gdxSetHasText( pgx, SyNr ); + } + + int gdxSetReadSpecialValues( const double *AVals ) + { + return ::gdxSetReadSpecialValues( pgx, AVals ); + } + + int gdxSetSpecialValues( const double *AVals ) + { + return ::gdxSetSpecialValues( pgx, AVals ); + } + + int gdxSetTextNodeNr( int TxtNr, int Node ) + { + return ::gdxSetTextNodeNr( pgx, TxtNr, Node ); + } + + int gdxSetTraceLevel( int N, const char *s ) + { + return ::gdxSetTraceLevel( pgx, N, s ); + } + + int gdxSymbIndxMaxLength( int SyNr, int *LengthInfo ) + { + return ::gdxSymbIndxMaxLength( pgx, SyNr, LengthInfo ); + } + + int gdxSymbMaxLength() const + { + return ::gdxSymbMaxLength( pgx ); + } + + int gdxSymbolAddComment( int SyNr, const char *Txt ) + { + return ::gdxSymbolAddComment( pgx, SyNr, Txt ); + } + + int gdxSymbolGetComment( int SyNr, int N, char *Txt ) + { + return ::gdxSymbolGetComment( pgx, SyNr, N, Txt ); + } + + int gdxSymbolGetDomain( int SyNr, int *DomainSyNrs ) + { + return ::gdxSymbolGetDomain( pgx, SyNr, DomainSyNrs ); + } + + int gdxSymbolGetDomainX( int SyNr, char **DomainIDs ) + { + return ::gdxSymbolGetDomainX( pgx, SyNr, DomainIDs ); + } + + int gdxSymbolDim( int SyNr ) + { + return ::gdxSymbolDim( pgx, SyNr ); + } + + int gdxSymbolInfo( int SyNr, char *SyId, int &Dimen, int &Typ ) + { + return ::gdxSymbolInfo( pgx, SyNr, SyId, &Dimen, &Typ ); + } + + int gdxSymbolInfoX( int SyNr, int &RecCnt, int &UserInfo, char *ExplTxt ) + { + return ::gdxSymbolInfoX( pgx, SyNr, &RecCnt, &UserInfo, ExplTxt ); + } + + int gdxSymbolSetDomain( const char **DomainIDs ) + { + return ::gdxSymbolSetDomain( pgx, DomainIDs ); + } + + int gdxSymbolSetDomainX( int SyNr, const char **DomainIDs ) + { + return ::gdxSymbolSetDomainX( pgx, SyNr, DomainIDs ); + } + + int gdxSystemInfo( int &SyCnt, int &UelCnt ) const + { + return ::gdxSystemInfo( pgx, &SyCnt, &UelCnt ); + } + + int gdxUELMaxLength() const + { + return ::gdxUELMaxLength( pgx ); + } + + int gdxUELRegisterDone() + { + return ::gdxUELRegisterDone( pgx ); + } + + int gdxUELRegisterMap( int UMap, const char *Uel ) + { + return ::gdxUELRegisterMap( pgx, UMap, Uel ); + } + + int gdxUELRegisterMapStart() + { + return ::gdxUELRegisterMapStart( pgx ); + } + + int gdxUELRegisterRaw( const char *Uel ) + { + return ::gdxUELRegisterRaw( pgx, Uel ); + } + + int gdxUELRegisterRawStart() + { + return ::gdxUELRegisterRawStart( pgx ); + } + + int gdxUELRegisterStr( const char *Uel, int &UelNr ) + { + return ::gdxUELRegisterStr( pgx, Uel, &UelNr ); + } + + int gdxUELRegisterStrStart() + { + return ::gdxUELRegisterStrStart( pgx ); + } + + int gdxUMFindUEL( const char *Uel, int &UelNr, int &UelMap ) + { + return ::gdxUMFindUEL( pgx, Uel, &UelNr, &UelMap ); + } + + int gdxUMUelGet( int UelNr, char *Uel, int &UelMap ) + { + return ::gdxUMUelGet( pgx, UelNr, Uel, &UelMap ); + } + + int gdxUMUelInfo( int &UelCnt, int &HighMap ) const + { + return ::gdxUMUelInfo( pgx, &UelCnt, &HighMap ); + } + int gdxGetDomainElements( int SyNr, int DimPos, int FilterNr, TDomainIndexProc_t DP, int &NrElem, void *Uptr ) + { + return ::gdxGetDomainElements( pgx, SyNr, DimPos, FilterNr, DP, &NrElem, Uptr ); + } + + int gdxCurrentDim() const + { + return ::gdxCurrentDim( pgx ); + } + + int gdxRenameUEL( const char *OldName, const char *NewName ) + { + return ::gdxRenameUEL( pgx, OldName, NewName ); + } int gdxUELMaxLength() { diff --git a/src/gdx.h b/src/gdx.h index 06fe23bb..661582a4 100644 --- a/src/gdx.h +++ b/src/gdx.h @@ -100,6 +100,18 @@ class TGXFileObj */ void gdxAllowBogusDomainsSet(int flag); + /** + * @brief Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default. + * @return 1 (true) iff. flag is set, 0 (false) otherwise. + */ + [[nodiscard]] int gdxMapAcronymsToNaN() const; + + /** + * @brief Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default. + * @param flag 1 (true) to enable and 0 (false) to disable flag. + */ + void gdxMapAcronymsToNaNSet(int flag); + /** * @brief Add an alias for a set to the symbol table. One of the two identifiers has to be a known set, an * alias or "*" (universe); the other identifier is used as the new alias for the given set. The @@ -1688,7 +1700,7 @@ int LastError {}, LastRepError {}; std::unique_ptr FilterList; TDFilter *CurFilter {}; TDomainList DomainList {}; -bool StoreDomainSets { true }, AllowBogusDomain { true }; +bool StoreDomainSets { true }, AllowBogusDomain { true }, MapAcrToNaN {}; TIntlValueMapDbl intlValueMapDbl {}, readIntlValueMapDbl {}; TIntlValueMapI64 intlValueMapI64 {}; TraceLevels TraceLevel { TraceLevels::trl_all }; diff --git a/src/gdxapi.yaml b/src/gdxapi.yaml index 4d5c37e5..cd14734f 100644 --- a/src/gdxapi.yaml +++ b/src/gdxapi.yaml @@ -1419,6 +1419,16 @@ properties: disables it, e.g. via `gdxAllowBogusDomainsSet(false)`, then using a one dimensional set as domain will cause a GDX error (ERR_NODOMAINDATA). Param flag 1 (true) iff. using a 1-dim set as domain (when store domain sets option is disabled) should be ignored. Otherwise an error is raised (ERR_NODOMAINDATA). + - gdxMapAcronymsToNaN: + type : bool + action : r + function : MapAcronymsToNaN + description : Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default. + - gdxMapAcronymsToNaN: + type : bool + action : w + function : MapAcronymsToNaN + description : Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default. #function pointer definitions functionpointers: diff --git a/src/gxfile.cpp b/src/gxfile.cpp index 15e7441d..81e1854e 100644 --- a/src/gxfile.cpp +++ b/src/gxfile.cpp @@ -1465,6 +1465,9 @@ bool TGXFileObj::DoRead( double *AVals, int &AFDim ) double TGXFileObj::AcronymRemap( double V ) { auto GetAsAcronym = [&]( double v ) { + if(MapAcrToNaN) + return intlValueMapDbl[GMS_SVIDX_NA]; + int orgIndx { static_cast( std::round( v / Zvalacr ) ) }, N { AcronymList->FindEntry( orgIndx ) }, newIndx {}; @@ -3569,6 +3572,16 @@ void TGXFileObj::gdxAllowBogusDomainsSet( int flag ) AllowBogusDomain = flag; } +int TGXFileObj::gdxMapAcronymsToNaN() const +{ + return MapAcrToNaN; +} + +void TGXFileObj::gdxMapAcronymsToNaNSet( int flag ) +{ + MapAcrToNaN = flag; +} + int TGXFileObj::gdxDataReadRawFastFilt( int SyNr, const char **UelFilterStr, TDataStoreFiltProc_t DP ) { gdxDataReadRawFastFilt_DP = DP; diff --git a/src/templates/gdxcppwrap.template.j2 b/src/templates/gdxcppwrap.template.j2 index c9cb35d5..37761bd7 100644 --- a/src/templates/gdxcppwrap.template.j2 +++ b/src/templates/gdxcppwrap.template.j2 @@ -101,30 +101,29 @@ public: {% for property in properties -%} {%- set isread = property.action == 'r' %} - {% if isread -%}[[nodiscard]] int {% else %}void {% endif -%} + {% if isread -%}[[nodiscard]] int {% else %}void {% endif -%} {{property.name}}{% if not isread %}Set{% endif %}({% if not isread %}int flag{%endif%}){% if isread %} const{% endif %} - { - {% if isread %}return ::{{property.name}}( pgx );{% else %}::{{property.name}}Set( pgx, flag );{% endif %} - } + { + {% if isread %}return ::{{property.name}}( pgx );{% else %}::{{property.name}}Set( pgx, flag );{% endif %} + } {% endfor -%} {% for function in obj.functions -%} {%- set fobj = function.items()|first -%} {%- set fvals = fobj|last -%} - {% set is_static = fvals.static and fobj|first == 'gdxErrorStr' %} - {% if is_static %}static {% endif %}{{ map_type(fobj|first, fvals.type) }}{{ fobj|first }}({% if fvals.parameters %}{{' '}}{% endif %} - {%- for parm in fvals.parameters -%} - {%- set parm_vals = parm.values()|first -%} - {{map_type(fobj|first, parm_vals.type)}}{{parm|first}}{% if not loop.last %}, {% endif %}{% endfor -%} - {%- if fvals.parameters %}{{' '}}{% endif %}){%- if fvals.const %} const{%- endif %} - { - return ::{{fobj|first}}( {% if is_static %}nullptr{% else %}pgx{% endif %}{% if fvals.parameters %},{% endif %} {% for parm in fvals.parameters -%} - {%- set parm_vals = parm.values()|first -%} - {{maybe_deref(parm|first,parm_vals.type,'&')}}{% if not loop.last %}, {% endif %}{% endfor -%} - {%- if fvals.parameters %}{{' '}}{% endif %}); - } + {% set is_static = fvals.static and fobj|first == 'gdxErrorStr' %} + {% if is_static %}static {% endif %}{{ map_type(fobj|first, fvals.type) }}{{ fobj|first }}({% if fvals.parameters %}{{' '}}{% endif %} + {%- for parm in fvals.parameters -%} + {%- set parm_vals = parm.values()|first -%} + {{map_type(fobj|first, parm_vals.type)}}{{parm|first}}{% if not loop.last %}, {% endif %}{% endfor -%} + {%- if fvals.parameters %}{{' '}}{% endif %}){%- if fvals.const %} const{%- endif %} + { + return ::{{fobj|first}}( {% if is_static %}nullptr{% else %}pgx{% endif %}{% if fvals.parameters %},{% endif %} {% for parm in fvals.parameters -%} + {%- set parm_vals = parm.values()|first -%} + {{maybe_deref(parm|first,parm_vals.type,'&')}}{% if not loop.last %}, {% endif %}{% endfor -%} + {%- if fvals.parameters %}{{' '}}{% endif %}); + } {% endfor %} - int gdxUELMaxLength() { return ::gdxUELMaxLength( pgx ); diff --git a/src/templates/gdxheader.template.j2 b/src/templates/gdxheader.template.j2 index 1a7b1db1..91e86ef6 100644 --- a/src/templates/gdxheader.template.j2 +++ b/src/templates/gdxheader.template.j2 @@ -149,7 +149,7 @@ int LastError {}, LastRepError {}; std::unique_ptr FilterList; TDFilter *CurFilter {}; TDomainList DomainList {}; -bool StoreDomainSets { true }, AllowBogusDomain { true }; +bool StoreDomainSets { true }, AllowBogusDomain { true }, MapAcrToNaN {}; TIntlValueMapDbl intlValueMapDbl {}, readIntlValueMapDbl {}; TIntlValueMapI64 intlValueMapI64 {}; TraceLevels TraceLevel { TraceLevels::trl_all }; diff --git a/src/tests/gdxtests.cpp b/src/tests/gdxtests.cpp index 16ef2236..79b6df36 100644 --- a/src/tests/gdxtests.cpp +++ b/src/tests/gdxtests.cpp @@ -2500,7 +2500,7 @@ TEST_CASE( "Test correct behavior of allow bogus domain flag" ) { obj.gdxDataWriteRawStart("k", "derived set 2", 1, dt_set, 0); // Now it is *not* okay anymore as the "allow bogus flag" is disabled REQUIRE_FALSE(obj.gdxSymbolSetDomain(domainNames.cptrs())); - const int ERR_NODOMAINDATA {-100054}; + constexpr int ERR_NODOMAINDATA {-100054}; REQUIRE_EQ(ERR_NODOMAINDATA, obj.gdxGetLastError()); obj.gdxDataWriteDone(); @@ -2512,11 +2512,45 @@ TEST_CASE( "Test correct behavior of allow bogus domain flag" ) { // This should be okay again as the base set now has records tracked for domain check domainNames[0] = "l"s; REQUIRE(obj.gdxSymbolSetDomain(domainNames.cptrs())); - const int ERR_NOERROR {0}; + constexpr int ERR_NOERROR {0}; REQUIRE_EQ(ERR_NOERROR, obj.gdxGetLastError()); obj.gdxDataWriteDone(); }); std::filesystem::remove( fn ); } +TEST_CASE( "Test option to map acronym indices to NaN" ) +{ + constexpr int acroVal {23}; + const std::string fn {"mapAcrToNaN.gdx"}; + TgdxValues values {}; + StrIndexBuffers keys; + testWrite( fn, [&]( TGXFileObj &pgx ) { + REQUIRE( pgx.gdxAcronymAdd( "myacr", "my acronym", acroVal ) ); + REQUIRE(pgx.gdxDataWriteStrStart( "i", "", 1, dt_set, 0 )); + keys.front() = "i1"s; + values[GMS_VAL_LEVEL] = pgx.gdxAcronymValue( acroVal ); + REQUIRE(pgx.gdxDataWriteStr( keys.cptrs(), values.data() )); + REQUIRE(pgx.gdxDataWriteDone()); + }); + testRead( fn, [&]( TGXFileObj &pgx ) { + std::array specVals{}; + pgx.gdxGetSpecialValues( specVals.data() ); + double NaN { specVals[sv_valna] }; + int numRecords; + REQUIRE(pgx.gdxDataReadStrStart( 1, numRecords )); + REQUIRE_EQ(1, numRecords); + int dimFrst; + REQUIRE(pgx.gdxDataReadStr( keys.ptrs(), values.data(), dimFrst )); + REQUIRE_EQ(acroVal, pgx.gdxAcronymIndex(values[GMS_VAL_LEVEL])); + REQUIRE(pgx.gdxDataReadDone()); + pgx.gdxMapAcronymsToNaNSet(true); + REQUIRE(pgx.gdxDataReadStrStart( 1, numRecords )); + REQUIRE(pgx.gdxDataReadStr( keys.ptrs(), values.data(), dimFrst )); + REQUIRE_EQ(NaN, values[GMS_VAL_LEVEL]); + REQUIRE(pgx.gdxDataReadDone()); + }); + std::filesystem::remove(fn); +} + }// namespace gdx::tests::gdxtests From 97059de96c3d566e4bcc01e2baa9a4eb58622446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schnabel?= Date: Tue, 14 Nov 2023 13:28:04 +0100 Subject: [PATCH 5/5] All changes since last GAMS release (45) must be API version 10 as new gdx* functions were added --- changelog.yaml | 12 +++++------- src/gdxapi.yaml | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/changelog.yaml b/changelog.yaml index 875109a0..334f4325 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1,12 +1,10 @@ --- -- 7.10.0: +- 7.10.1: + - First open source release of GDX eXPert-level API. Compatible with GAMS 45. + - Added gdxAllowBogusDomains to get flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomainSets). + - Added script to automatically generate C-wrapper from API definition YAML file. - Added boolean property gdxMapAcronymsToNaN (disabled by default) that maps all acronym values to special value "Not a Number" (NaN). - Removed XCode project file for unit test suite as it is not maintained anymore. - > Entries for property setters and getters in main header and wrappers are now automatically generated from API - definition YAML via Jinja2 templates and not handwritten. - - ... -- 7.9.1: - - First open source technical release of GDX eXPert-level API. - - Added gdxAllowBogusDomains to get flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomainSets). - - Added script to automatically generate C-wrapper from API definition YAML file. + definition YAML via Jinja2 templates and not handwritten. \ No newline at end of file diff --git a/src/gdxapi.yaml b/src/gdxapi.yaml index cd14734f..97f714f0 100644 --- a/src/gdxapi.yaml +++ b/src/gdxapi.yaml @@ -1,8 +1,8 @@ --- title : GAMS Data Exchange API prefix : gdx -apiversion : 9 -compatibleversion : [9,8,7] +apiversion : 10 +compatibleversion : [10,9,8,7] DObject : TGXFile DUnit : gxfile