From 38ce673ced0f64a03b39f97131e2b6de6d2510b4 Mon Sep 17 00:00:00 2001 From: "J. Daniel Smith" Date: Wed, 9 Aug 2023 10:58:30 -0400 Subject: [PATCH] Finish using XsElement for new XML (#684) * cphd::Version enum * Squashed commit of the following: commit 67d0bc78b1a93d02fc496ec755fc794060ab5bb5 Merge: 42f479813 a2cb168ce Author: Dan Smith Date: Fri Jun 16 10:37:57 2023 -0400 Merge branch 'develop/complex_short' of github.com:ngageoint/six-library into develop/complex_short commit 42f479813d7b2d431753028cab5ff5c4874bb62c Author: Dan Smith Date: Fri Jun 16 10:37:43 2023 -0400 Parameter::operator==() must a member function for existing SWIG bindings commit a2cb168cebbf0b89348d106be8a878fb6746f155 Author: Dan Smith Date: Fri Jun 16 10:32:22 2023 -0400 renames from CODA-OSS commit 68d184a89f899a709c6c7e54f858e4a8a4ed2955 Author: Dan Smith Date: Fri Jun 16 10:15:28 2023 -0400 figure out ComplexInteger in SIX rather than CODA-OSS commit 802087c892ecc653c0cd0086ec888d622c9192f8 Author: Dan Smith Date: Fri Jun 16 10:01:05 2023 -0400 separate .H file for complex commit 4d24ae394a290e21f074614ee95f46a182c43e33 Author: Dan Smith Date: Fri Jun 16 09:54:05 2023 -0400 remove unneeded #include of types/Complex.h commit e021d71c2d25641afbfe7d6741f60b2c745bd12d Author: Dan Smith Date: Fri Jun 16 09:49:48 2023 -0400 zinteger -> ComplexInteger commit 91599f83e4a8d1e3e8fe77d54bca4cb6f85ea692 Author: Dan Smith Date: Fri Jun 16 09:38:53 2023 -0400 complex.h -> Complex.h from CODA-OSS commit b3653cc75b07fb0415e2a18303058e57c31718b8 Merge: 786223e8c 6e34e8717 Author: Dan Smith Date: Thu Jun 15 16:11:31 2023 -0400 Merge branch 'main' into develop/complex_short commit 786223e8c0ebc05ca46e7c55eac8a26678ff2bff Author: Dan Smith Date: Thu Jun 15 16:04:31 2023 -0400 use CODA_OSS_types_unique_zinteger commit f143d3a53c4cdce580958fae0ef5588bb12cbda5 Author: Dan Smith Date: Thu Jun 15 15:54:40 2023 -0400 Squashed commit of the following: commit 011ba83af6202c4a5358c366ac0e88edcbfd6986 Merge: 7390b8b19 4a21b2db5 Author: Dan Smith Date: Thu Jun 15 15:37:33 2023 -0400 Merge branch 'main' into develop/sync_externals commit 7390b8b19f4f9d21d0ffc34ae9906cea2227936d Merge: 7f79e6d6f b902f6c17 Author: Dan Smith Date: Thu Jun 15 14:21:10 2023 -0400 Merge commit 'b902f6c1743778d8fceeee5b3209ebca2370312a' into develop/sync_externals commit b902f6c1743778d8fceeee5b3209ebca2370312a Author: Dan Smith Date: Thu Jun 15 14:21:10 2023 -0400 Squashed 'externals/coda-oss/' changes from f4d42005f..704d6867f 704d6867f beef-up our complex type (#687) 47c1c1cd6 check is_absolute() for URLs (#686) c042373e1 be sure our Path::isAbolute() matches std::filesystem::path::absolute() (#684) ad10286bc volatile is about "special" memory, not threading (#685) git-subtree-dir: externals/coda-oss git-subtree-split: 704d6867f959f60e3e62c44681a3fb1f7abc99bf commit 7f79e6d6fb8972e5074e582aa4c3214e9a524459 Author: Dan Smith Date: Thu Jun 15 14:21:06 2023 -0400 latest from CODA-OSS commit 24678b33f4aab533af0d807d6706f8587bd1c103 Merge: 9eb95e3aa 35b59b9a0 Author: Dan Smith Date: Thu Jun 15 14:20:30 2023 -0400 Merge branch 'main' into develop/sync_externals commit 9eb95e3aad1562b0d7915cf48db1b61a337a3878 Author: Dan Smith Date: Tue Jun 13 17:51:55 2023 -0400 latest from CODA-OSS and NITRO commit 1bd99042ef18b76df9da27d946b5616d9dd254b1 Merge: ec161c5b3 c59d69c06 Author: Dan Smith Date: Tue Jun 13 17:51:40 2023 -0400 sync_externals commit c59d69c06eda40c7295ab607fdc8a5dad7d2c1b1 Author: Dan Smith Date: Tue Jun 13 17:51:34 2023 -0400 Squashed 'externals/nitro/' changes from c8ecbe9ae..3f01809fa 3f01809fa latest from coda-oss (#557) 471fb3fc1 Update test_j2k_loading++.cpp b12caf2fc latest from CODA-OSS (#556) 0cd432624 use sys::make_span (#555) 05dae18a3 patch to build other projects 8f974e995 NITRO-2.11.3 (#554) 870aa6afd update to coda-oss 2023-06-05 (#553) 2fd7a0bfa latest from coda-oss (#552) 0eecce004 invoke() utility to reduce code duplication (#550) 59fb02fe9 latest from coda-oss (#551) 9fbf2b7b8 Fill out adapter free block which is used for nitf decompression (#549) 089ba0b5b latest from coda-oss 3b52f0025 latest from coda-oss (#547) 90c6263e2 latest from coda-oss (#544) 90d513ac5 latest from coda-oss (#543) git-subtree-dir: externals/nitro git-subtree-split: 3f01809fae7d471aa0f1594fc5eec1e3111cd710 commit 272cae451cbe3ad6820d1221aafe375d77b1ba04 Author: Dan Smith Date: Tue Jun 13 17:51:29 2023 -0400 Squashed 'externals/coda-oss/' changes from e87c32b4d..f4d42005f f4d42005f fix build error in NITRO ff11a5557 keep using std::complex for now (#682) c88b9c053 types::complex (#681) d1244a080 don't need our own make_unique in C++14 (#680) aeec0131c assert()s for mem::CopyablePtr (#679) 72b0ebd60 add types::complex_short (#678) 932130a58 patch to build other projects c00c1f203 coda-oss release 2023-06-06 (#677) ef54bbcd5 remove more compiler warnings (#676) dadfc5ce6 distinguish between byte-swapping a buffer and single value (#674) 90187f6cd more xml.lite tweaks for SIDD-3.0/ISM (#675) eb9960772 stronger type-checking for byteSwap() (#673) ff4f820ed xml.lite tweaks to support SIDD 3.0 ISM (#672) b1de8c0e5 std::byte should be a unique type (#671) c05bf9a02 allow enums to be byte-swapped too 1f9fd88d6 remove spurious 47684c45b byteSwap now uses byte buffers (#670) cbc659db2 add swapBytes() utility from SIX (#669) 891481b64 simplify byte-swapping (#668) 540ae763e more byteSwap() tweaks 0774c03c4 threaded byteSwap() (#667) d156370d3 swapping a single-byte value makes no sense c120e3255 be sure parameter is used to avoid compiler warning e85ec9331 --output-on-failure for CTest (#666) e80376197 turn off "there is no warning number" warning c5f0a5d15 A C-string may not be NULL-terminated (#665) 0c5eb29ae use platform-specific routines for byteSwap() (#664) 0b7d581fa remove transform_async() (#663) f6489b6be Merge branch 'main' into feature/xml.lite_tweaks 836c426a2 use function-pointers so that isConsoleOutput is only checked once 56e3c45b1 move depthPrint() functionality into non-member function in preparation for future changes ddcd26d97 Merge branch 'main' into feature/xml.lite_tweaks 69cc0e506 use the more rigorous create_and_check_datatype() 9efb87558 Merge branch 'main' into feature/hdf5 4d2f2f417 more HighFive unittests (#662) 14191a844 HighFive::create_datatype() goes from C++ to HighFive 98583473f utility routines to read string attributes 1fa75ce81 use the C API to read a string attribute 71e7b69f5 still can't figure out how to read a string attribute :-( e96f37a69 test reading the file attributes a25244519 getAttribute() unittest 8f12a3000 getDataType() unittest 857ff0af3 HighFive utility routines (#661) 1d687db57 writeDataSet() utility overload 106aa6894 sigh ... H5Easy::dump() fill fails on Windows/WAF :-( 2641b60b2 Merge branch 'main' into feature/hdf5 35c19e7e8 change actions to @v3 (#660) 212bbd3a3 works on local machine, but not build server ... ? 7125118b0 dump of 1D vector doesn't work :-( c704db435 sigh ... WAF build still failing :-( 01aae4616 does dump() of a 1D vector work? 76a53c813 comment-out H5 writing :-( 0f0e19aff test_highfive_dump() cb8f73795 trying to get highfive_dump() unittest working w/Windows-WAF 6584a264a does test_highfive_create() work? cde6147ce tweak HighFive wrappers (#659) 316566854 Revert "trying HighFive "write" unittests again" a9ec24ca4 trying HighFive "write" unittests again 585ad49a5 tweak names of utility routines 4c91a4d97 make it easier to read a std::vector and std::vecotr 0217ffa26 readDataSet() now works for 1D data 95e8973f2 trying to get hdf5::lite::load() working 4d294611d "const" correctness 5e6305c3f fix load_complex() 4a134dc5f start work on utility routines to read complex data from HDF5 9d76a7f41 Merge branch 'main' into feature/hdf5 8f9667a24 whitepsace ebd3fc99e Merge branch 'main' into feature/hdf5 40091b069 comment-out writing tests for now ... need to figure our WAF bulid failure 935aa3459 be sure the dataset has real data 114b9bf33 update release notes bd9c0b26c tweak HighFive utility routines acda1ef57 turn off diagnostics around expected failures 22a748840 readDataSet() utility routine for HighFive bd88a8c25 HighFive writeDataSet() utility to work with our SpanRC 6142f5b33 use HighFive routines to write a HDF5 file 5bbf1abaf Use HiveFive routines to get info about the file 84fbc8378 duplicate unittests with H5Easy f1f054c03 Merge branch 'main' into feature/hdf5 9b63ca470 fix directory names f6f826689 fix directory names 7aeb82c33 Merge branch 'main' into feature/hdf5 d028baaeb hook up HighFive header-only library (#653) 3083b0a31 Revert "HighFive 2.6.2" 246985a7f Revert ""build" HighFive HDF5 library" a8b75a586 Revert "turn off HighFive Boost support" ec68d5f83 Revert "Add HighFive unittests" f1f85b9e7 Revert "get test_high_five_base more-or-less compiling" 5ea634ee1 Revert "more work on getting HighFive unittests to build" ecc45433c more work on getting HighFive unittests to build bb194788a get test_high_five_base more-or-less compiling d42bde000 Add HighFive unittests ddc86bb32 turn off HighFive Boost support b255122d4 "build" HighFive HDF5 library 396cc3ef2 HighFive 2.6.2 5e5f9d9c0 Merge branch 'main' into feature/hdf5 ee938b4a5 changes from SIX bb764df90 Merge branch 'main' into feature/xml.lite_tweaks de2a24380 make derived classes 'final' if possible 14e19bcd2 Change xml lite function to virtual (#645) 8f42ac8e9 Merge branch 'main' into feature/xml.lite_tweaks 18ad90645 hdf5Write unittest 3462e1179 createFile() and writeFile() overloads ecee81d53 fix typos 197eecfa6 sketch-out hdf5::lite::writeFile() bd2311795 use SpanRC for writeFile(), not yet implemented ea9af7510 simple SpanRC to hold a 2D-size and pointer 027c19ee8 createFile() unittest 1f9d07ecb hook up createFile() 8c7e4473f start hooking up HDF5 writing 146e0bea3 Merge branch 'main' into feature/hdf5 88ca9fcb7 Merge branch 'main' into feature/hdf5 42b604b46 Squashed commit of the following: 10ee602c2 Merge branch 'main' into feature/hdf5 67aa42b69 restore changes from "main" 8bbfcbfbf unittests can be simplified to match fewer "view" classes 126bb802e Merge branch 'main' into feature/hdf5 3f8ba7a42 again, don't need a class just to convert from std::vector<> to std::span<> 24c2b489c Squashed commit of the following: 2703c119d Squashed commit of the following: 9d5228a2b don't need an entire class just to convert a std::vector<> into std::span<> 51bc931dc Merge branch 'main' into feature/hdf5 a84f25816 Squashed commit of the following: c4d2ed696 add missing #include guards, fix type in existing #include guard d541525a0 use a single ComplexViewConstIterator for all views 86e6a459f CODA_OSS_disable_warning causes GCC errors :-( 5d4b9c2cb only need an custom iterator for ComplexSpansView d9f0fb128 hook up iterators b9329e4db initial pass at a ComplexViewConstIterator 635238873 remove compiler warning about unused "constexpr" variables b39f6096f use the casing from H5 to make copy/pasting code slightly easier 0887b13eb Merge branch 'main' into feature/hdf5 bd07df1ca Consistent casing for Dataset, Datatype, Dataspace 7acd30ee2 tweak hdf5.lite dependencies 38ab914df Jupyter notebook for creating H5 files 95a040e0b _small.h5 is now (correctly) FLOAT32 107e7c487 make a simple values() member function to avoid template magic e1feca919 use TEST_SPECIFIC_EXCEPTION macro instead of try/catch 738333688 readDatasetT() now throws for the wrong buffer type 6b2cc2529 Merge branch 'feature/hdf5' of github.com:mdaus/coda-oss into feature/hdf5 310f8fd3d can't get template magic right for copy_axis() 86b306d59 stepping through copy ctors in the debugger is annoying f243e92d6 trying to make wrong type of buffer fail 2b10d9652 read in new sample file a28e59d8c help the compiler with type deduction 49bf5e9bc nested_complex_float_data_small.h5 e029325fc utility routines to "deconstruct" and array of std::complex dede3bd39 Merge branch 'main' into feature/hdf5 904b1ef5e tweak class names, make_() and copy() utility routines 8237b9efb make it harder to pass the wrong types to ComplexViews 4d9aeda2c ComplexArrayView and ComplexParallelView utility classes f5e367dfa test std::span> a4a2844f2 read in the nested "i" and "r" data 115615265 sample file has subgroups 8e1b7869a Merge branch 'feature/hdf5' of github.com:mdaus/coda-oss into feature/hdf5 9f4232a1d update sample H5 file 8c55db73a walk through HDF5 sub-groups 7775ed9c4 Update 123_barfoo_catdog_cx.h5 677975d7c Matlab code to create sample H5 file a0e7dfe07 Update test_hdf5info.cpp 0b67e1602 pass __FILE__ and __LINE__ from calling site for a more accurate exception message 86a677321 skeleton for more sample data 85f79b099 Merge branch 'main' into feature/hdf5 18088e942 Merge branch 'main' into feature/hdf5 3a1d17692 Merge branch 'main' into feature/hdf5 1755c69d7 Merge branch 'main' into feature/hdf5 9ad015432 No more "11" suffix on exception names c20d96251 Squashed commit of the following: c88cee999 other values to be filled-in bca4a4ecd incorporation NamedObject from HDF5 docs 61fa68f72 groupInfo() 460e7d766 datasetInfo() 14eb9b764 start filling in DatasetInfo afe5f1c3a start to fill in DatasetInfo 77a968c72 start filling in GroupInfo d81bcdfd9 openGroup() to open groups (loc) a0cd29469 comment-out "dataset" unittest for now 86e006024 begin filling in FileInfo 366dda6ab a return_type_of utility is needed to deduce the return type e21928263 explicitly pass return type to template 4937ccd11 template to reduce boilerplate when calling try_catch_H5Exceptions b3b5ebde7 use new exception utility routines ea1c03ef0 put exception handling/conversion in a utility routine 819a99d39 utility routine for exception handling 6f34eea97 put utilities in a separate file for easier reuse fcbde4f24 break utility routines into smaller pieces for easier reuse 52358ea8a WIN32 no longer automatically defined? 5a4286472 Revert "build HDF5 with C89" 680e599e9 build HDF5 with C89 a87a07121 Merge branch 'main' into feature/hdf5 8447c1a90 Revert "sym-links instead of copying files" db3b5e12b Merge branch 'main' into feature/xml.lite_tweaks fb60b5696 Merge branch 'main' into feature/hdf5 5110a5cc8 Comments about _u and _q 1a937d32c Merge branch 'main' into feature/xml.lite_tweaks fa06f04d7 get ready for hdf5.lite enhancdements b040c7c43 sym-links instead of copying files aa431bb47 use _u for xml::lite::Uri 3d0c6d58c fix case-sensitive #include filename 93dcd0e52 operator() for getElementByName() 75a93af85 more operator[] overloads to make attribute management easier 4ab8216f8 user-defined string literals to remove some noise around xml::lite::QName f82f0b0fc Merge branch 'main' into feature/xml.lite_tweaks ae30e3644 Merge branch 'feature/xml.lite_tweaks' of github.com:mdaus/coda-oss into feature/xml.lite_tweaks ffdd9beb0 simplify attribute creation 9bf5414f5 simplify attribute creation 82d7a4e95 SWIG gets confused about namespaces 7a61d0741 fix bug on Element ctor uncovered by unittest fdd7e58c1 QName is also in the xerces namespace which confuses SWIG bindings a325b7053 operator+=() overload for addChild daf30e6c0 Merge branch 'feature/xml.lite_tweaks' of github.com:mdaus/coda-oss into feature/xml.lite_tweaks b887d2b47 provide overloads for Element& rather than creating new "reference" types 1fa6bba38 rename test_xmleasy.cpp 7c8c9e0f1 += overload 850da6f63 overload for std::string 4547fc5a7 use UIT-8 strings for characterData 4723462a3 convenient addChild() overloads e48720753 copy over ElementReference from xml.easy a4ca30a0d Merge branch 'main' into feature/xml.lite_tweaks 6ae9f0b71 Revert "check-in of new xml.easy (to move code between computers)" f7466a6d7 Revert "simple routines for single element" a5490230d Revert "make some operators simplier ways of calling functions" c9a25630a Revert "get document creation working" 8af8710b0 Revert "free functions instead of member functions" 16c3847cb Revert "ElementReference distinct from Element" 7d68e156f Revert "ElementMutableReference" 00eb2a282 Merge branch 'main' into feature/xml.lite_tweaks a42969c1f ElementMutableReference a20ae9355 ElementReference distinct from Element 14eeeea0b free functions instead of member functions 4aae014b3 get document creation working 883569269 make some operators simplier ways of calling functions 053bd1212 simple routines for single element 8bf701a2e check-in of new xml.easy (to move code between computers) 41f959051 unittests for creating XML documents from scratch 9752d50ae Merge branch 'main' into feature/xml.lite_tweaks 1531d5709 by default, don't validate strings passed to Uri() 46d13d4bf Merge branch 'master' into feature/xml.lite_tweaks 39b547d32 remove more vestiges of Expat and LibXML ec8274d52 remove LibXML and Expat as they're no longer used/supported. 20eeefeef Merge branch 'master' into feature/xml.lite_tweaks 95074b9b1 update for newer Intel compiler 7024f71e1 Merge branch 'master' into feature/xml.lite_tweaks 57b1cbc83 Merge branch 'master' into feature/xml.lite_tweaks 4b67561c3 remove validate() overload that nobody is using fa15f1e5d Squashed commit of the following: 1484a9090 test the new validate() API 470da70fb hookup StringStreamT routines 2cddf2504 begin hooking up validate() overloads 1b5d910f3 overload validate() for UTF-8 and Windows-1252 03309b8c9 Squashed commit of the following: b72c6c5bf older compiler doesn't like our make_unique af8f00307 validate UTF-8 XML on Linux 211188613 unit-test for LEGACY XML validation 3c1169d2b Squashed commit of the following: 3afff19ca std::filesystem::path for FileInputStreamOS 908d452f8 WIP: validate all of our sample XML files 00f9bb16b validate against a XML schema 243d8c356 Merge branch 'master' into feature/xml.lite_tweaks 2815d707d fix to work with SWIG bindings. :-( 460862132 trying (again) to remove vestiages of old code e3c83a858 Revert "new code should use UTF-8" 811207c92 new code should use UTF-8 0ffd835f9 Squashed commit of the following: 1e7e03ded Merge branch 'master' into feature/xml.lite_tweaks c1d806aff Merge branch 'master' into feature/xml.lite_tweaks 850d3c811 str::strip() that can be easier to use than str::trim() 580ba9c8c explicitly =delete move 2b39831a8 Squashed commit of the following: 39eebdc23 Merge branch 'master' into feature/xml.lite_tweaks 9adf86cba force calling new UTF-8 write() routines ea61b6204 Merge branch 'master' into feature/xml.lite_tweaks 8a34583fa overload to take schemaPaths as filesystem::path 8671b442f parse XML embedded in a binary file ec4a902f1 updates from xerces.lite 80dc4d963 updates from xerces.lite 549766d6c Attributes::contains() no longer catches an exception 8a645ceac need "sys/" when building in other environments 36af08269 super-simple URI validation 78ef28a3e SWIG bindings are a PITA! :-( e9cba8491 SWIG needs help with Uri 8a8d8dc07 another routines used by pre-build SWIG bindings 818e1ec5d pre-build SWIG bindings use getElementByTagName() member function 067cac5d8 old compiler gets confused on unadorned QName ba92c0ae7 more use of Uri and QName 446c7d17a use QName in new code d6f8b0c83 more direct use of QName 90fff1c73 use xml::lite::QName instead of tuple 646cbb5ed more direct use of QName and Uri ba589ea3b make QName more robust bab0ee8b5 createElement() -> addNewElement() e3a145747 grab changes from six-library 32285e95c Merge branch 'master' into feature/xml.lite_tweaks 9f79f0bf6 Merge branch 'master' into feature/xml.lite_tweaks a12bbc32c make it easier to create new Elements with a value fc9967f98 make it easy for callers to addChild() keep a reference to the Element 4627766b7 be sure test_xmlparser works in "externals" of other projects bf2276396 "private" is part of the name-mangling fad92bcc8 making sure copy-ctor is implemented f90fdcead consolidate common XML test code 9fc53f2d5 use str:: utility for casting 6da6f794b still trying to find the right macro for SWIG 0c1b86c56 still trying to fix SWIG fdc6fc9bd trying to fix SWIG build error 7835e8c27 SWIG needs copy-ctor 585695942 disable copy/assignment for Element, it's probably almost always wrong 391fed613 fix double-delete caused by copying 61790fe69 retry parsing XML with Windows-1252 if first parse() fails 63cffac59 change string_encoding to match coda-oss style of PascalCase 010479bbe read an XML file we know is wrongly encoded as Windows-1252 9a0505062 more references instead of pointers 2d44b6951 Reading Windows-1252 w/o "encoding" fails 63dc7b076 read Windows-1252 too c9434c9cb test as UIT-8 too f310ccf0c get reading from UTF-8 XML working on Windows 1fa39c2be get testReadUtf8XmlFile working on Linux 1a83cd815 sys::Path is too much trouble right now ed60aa22c unit-test to read XML from a file a9336db7c Squashed commit of the following: 0825beb0d Merge branch 'master' into feature/xml.lite_tweaks c618489be Merge branch 'master' into feature/xml.lite_tweaks e8e4b8fe1 determine string_encoding based on platform 1f43bcfc2 create a new Element by using the platform to determine "characterData" encoding 961bef66b Merge branch 'master' into feature/xml.lite_tweaks e9798a5cb fix static_assert() 6f7772874 Merge branch 'master' into feature/xml.lite_tweaks b98d4f5a9 Merge branch 'master' into feature/xml.lite_tweaks 1b5abba2a The (old) version of SWIG we're using doesn't like certain C++11 features. 53bdeabaf Merge branch 'master' into feature/xml.lite_tweaks 60cf8ae80 "" doesn't work with decltype() in older C++ 97e72477a reduce getValue() overloads by making "key" a template argument 5e6373e55 reduce code duplication f9e7cfeee provide castValue instead of getValue(T&) cbd0bd8f2 castValue throws instead of returning a bool like getValue(T&) 87c7514fc Merge branch 'master' into feature/xml.lite_tweaks 10cc61223 make getElement*() consistent for zero or >1 results f5b137e3c Merge branch 'master' into feature/xml.lite_tweaks 1765efc62 allow clients to specify toType() and toString() for getValue() and setValue() df8b746e1 allow clients to specify their own toType/toString routines 66702726a Merge branch 'master' into feature/xml.lite_tweaks 6956311f1 Merge branch 'master' into feature/xml.lite_tweaks d505f3593 Merge branch 'master' into feature/xml.lite_tweaks fbd106115 catch a BadCastException and return false from getValue() 3a78377b5 use a template to reduce duplicated code 0ad4b8606 Merge branch 'master' into feature/xml.lite_tweaks a848aa3a2 get & set the characer data as a type f3ee1ee12 utility routines to set an attribute value 595227683 templates to get an attribute value convert to a specific type 06639227b miised a change in last commit 1aa458ef8 add getValue() overloads that return true/false rather than throwing faa6d3075 added getElementByTagName() overloads as that's a very common use-case git-subtree-dir: externals/coda-oss git-subtree-split: f4d42005fa477ae59da193422aa2cb14b877cf0c commit ec161c5b334ea8133777a78ce94181807e591642 Merge: d2d594b9f 272cae451 Author: Dan Smith Date: Tue Jun 13 17:51:29 2023 -0400 Merge commit '272cae451cbe3ad6820d1221aafe375d77b1ba04' into develop/sync_externals commit d2d594b9ff50bc00c15a4228927ea1ec0449381b Author: Dan Smith Date: Tue Jun 13 17:51:25 2023 -0400 latest from CODA-OSS and NITRO commit 09ec30cc503ffd74daa401514ab9b674c6e4a3cf Merge: 28a4b2bd1 4a21b2db5 Author: Dan Smith Date: Thu Jun 15 15:54:31 2023 -0400 Merge branch 'main' into develop/complex_short commit 28a4b2bd17daabbb9ba94aae53a58986acd58a9b Author: Dan Smith Date: Thu Jun 15 14:58:55 2023 -0400 restore "old" CODA-OSS to minimize differences commit f41c086967d2e5b05ee8988272ab8ca8c0014f85 Author: Dan Smith Date: Thu Jun 15 14:40:31 2023 -0400 keep using std::complex<> everywhere commit bc1704c8cb985f1987a7d3ff2b37c2e48286a8fd Author: Dan Smith Date: Thu Jun 15 14:22:47 2023 -0400 latest from CODA-OSS commit 4ec782e6c9409f1985628c36a88577b286af61e7 Author: Dan Smith Date: Thu Jun 15 13:56:24 2023 -0400 build against "old" CODA-OSS commit bffd6a985d8dc8e08b42aed78bbe7a162ac45bf6 Author: Dan Smith Date: Thu Jun 15 13:56:08 2023 -0400 restore CODA-OSS changes to minimize merge differences commit d93e0e80c94013e1b957eb2c33ba112643c306c3 Author: Dan Smith Date: Thu Jun 15 13:39:37 2023 -0400 more passing the entire complex type as a template parameter commit 0872159268ff8f38e3c3d42788598725ce142616 Author: Dan Smith Date: Thu Jun 15 13:25:14 2023 -0400 no more types::complex commit 379a89312f55c86f1de95f6ff14e7aeca72df32c Author: Dan Smith Date: Thu Jun 15 12:36:06 2023 -0400 use CODA_OSS_types_unique_zinteger commit 2b9b396c4d460233418f293d6ebdf157231b8757 Author: Dan Smith Date: Thu Jun 15 11:58:00 2023 -0400 latest from CODA-OSS commit 5d19ea2946556ab9f7e2e1ec98e0d07fecf578e2 Merge: 0dab1a156 7e99024da Author: Dan Smith Date: Thu Jun 15 11:07:26 2023 -0400 Merge branch 'develop/complex' into develop/complex_short commit 7e99024da866660e7e4da621b75f4561e638044b Author: Dan Smith Date: Thu Jun 15 11:06:20 2023 -0400 unittest changes from develop/complex_short branch commit e5c0f6d52e05bf50741a6bc086eae9ce53a89e9e Author: Dan Smith Date: Thu Jun 15 11:00:34 2023 -0400 more changes from CODA-OSS commit ca7cb60f6b39a2f1a03dd1497bb20a4da5925c24 Author: Dan Smith Date: Thu Jun 15 10:34:57 2023 -0400 no more types::complex commit 6048da55638d0283cf789347740871aa2d07fba1 Author: Dan Smith Date: Thu Jun 15 10:18:44 2023 -0400 latest from CODA-OSS commit 16c99ed82bb9b57edc1ea5e28d68f89b63519664 Author: Dan Smith Date: Thu Jun 15 08:13:27 2023 -0400 pass the entire complex type and use value_type commit 4d9d2a764319f3177b427b3a03ae95c99ef02494 Author: Dan Smith Date: Thu Jun 15 09:24:49 2023 -0400 pass entire complex type as template parameter commit 0dab1a15681e51a5464b363baa0f263e25521c4a Author: Dan Smith Date: Thu Jun 15 09:24:49 2023 -0400 pass entire complex type as template parameter commit e4c29f670785b3312dda1d6b6da30847fa798b89 Author: Dan Smith Date: Thu Jun 15 09:14:37 2023 -0400 Update PVPBlock.cpp commit 7133f7f4b4752d0e049ef48241a4e1b707a5c4ec Author: Dan Smith Date: Thu Jun 15 09:09:11 2023 -0400 restore types::z* overloads commit 9a0c890090d5501bb2c563e0b36a787cfad70af6 Merge: a3a71ba35 fc8ba82bd Author: Dan Smith Date: Thu Jun 15 09:01:31 2023 -0400 Merge branch 'develop/complex' into develop/complex_short commit fc8ba82bd5357454d02276c1605ddcd5973322d1 Author: Dan Smith Date: Thu Jun 15 08:59:58 2023 -0400 findComplex() utility commit 8b762374c282458c469ad6e4502aaee7aa695079 Author: Dan Smith Date: Thu Jun 15 08:47:56 2023 -0400 const& for Parameter arguments commit a3a71ba351b9b790c20bb80e4fac861592758164 Author: Dan Smith Date: Thu Jun 15 08:26:00 2023 -0400 getComplex() overloads commit 6fc1ee4b96b722b81042f79ed476c481af13aadd Author: Dan Smith Date: Thu Jun 15 08:13:27 2023 -0400 pass the entire complex type and use value_type commit 13e44351a9e912c91fd79ada8b09a544c482874a Author: J. Daniel Smith Date: Wed Jun 14 21:47:37 2023 -0400 more progress on types::complex commit 5e72ecca7037861e87f311339c61bc2cf77305fe Author: Dan Smith Date: Wed Jun 14 17:43:52 2023 -0400 use our own type for complex commit 9bfc4f9799df5261bbc0c7afb1ffa08abc060ba1 Author: Dan Smith Date: Wed Jun 14 17:42:58 2023 -0400 latest from CODA-OSS commit 39153f274d56de88a28b526978dd4ad832e767f9 Author: Dan Smith Date: Wed Jun 14 16:45:05 2023 -0400 fix Parameter::setValue() overloads commit b8007fbad15e529eb503bbfd692c85ce6d34a0a6 Author: Dan Smith Date: Wed Jun 14 16:37:10 2023 -0400 latest from coda-oss commit 27f080ec628c4497709cfc85183f3a1ceaad11cb Author: Dan Smith Date: Wed Jun 14 16:22:29 2023 -0400 move is implicitly deleted because of =delete for copy commit bd69591ff8c93d1aaa9f184346eac2aca83b3272 Merge: 71d519492 35b59b9a0 Author: Dan Smith Date: Wed Jun 14 16:09:16 2023 -0400 Merge branch 'main' into develop/complex_short commit 71d519492046c4c61986f181f6ec7aa18cb4c0c6 Author: Dan Smith Date: Tue Jun 13 15:25:54 2023 -0400 std::complex -> six::zfloat commit a3eee8257746732f61b959c9b31442511d81b590 Merge: d0bb8c181 e13c3da4f Author: Dan Smith Date: Tue Jun 13 15:17:07 2023 -0400 Merge branch 'main' into develop/complex_short commit d0bb8c1819da2ade60c4ce3349ff40f32fe31301 Author: Dan Smith Date: Tue Jun 13 15:15:46 2023 -0400 finish (almost) switching to types::complex for integers commit bbe1320e33768a0a0f151feb138643c80a8bdfbd Author: Dan Smith Date: Tue Jun 13 14:57:21 2023 -0400 types::complex is std::complex for now commit 00047f57ea462c610d249d25fcd2f0105a7c0f41 Author: Dan Smith Date: Tue Jun 13 14:36:27 2023 -0400 latest from coda-oss commit ac376dcf72763892e9e9b9c03fb14bc34fd04630 Author: Dan Smith Date: Tue Jun 13 14:13:42 2023 -0400 Update test_dump_images.cpp commit 2907efbcfdb33f154138944831a94a2c508b5a68 Author: Dan Smith Date: Mon Jun 12 16:39:29 2023 -0400 use types::complex for TInteger commit 2580312337bf1b7ee20d5ba9eed83c8e65e06e6f Author: Dan Smith Date: Mon Jun 12 16:26:16 2023 -0400 CPHD aliaes for std::complex commit d177963c782c08c137d14b9608207d40754db568 Author: Dan Smith Date: Mon Jun 12 16:17:38 2023 -0400 latest from coda-oss commit e05937c9b568f52fa9f41b279e2c8ecfa63e5fc0 Author: Dan Smith Date: Mon Jun 12 15:41:34 2023 -0400 use types::z* aliases for complex commit 2b61dcc4974b7326db762f6f6fd60dc263bb87e6 Author: Dan Smith Date: Mon Jun 12 15:05:41 2023 -0400 begin switching to types::complex for integral T commit b4e625673c3d270896eed26b4c83bc827befc538 Author: Dan Smith Date: Mon Jun 12 14:59:30 2023 -0400 turn off _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING commit 9bd683bc8858d07378c390c3cd4fcaed4a490a21 Author: Dan Smith Date: Mon Jun 12 14:54:22 2023 -0400 std::complex -> zfloat commit 47aa0e8994af5b31602f63adaac3b3415cb769c2 Author: Dan Smith Date: Mon Jun 12 14:45:00 2023 -0400 std::complex -> zfloat commit 3785ed2c8e0f812ae43e1e81971bce6777eb91a1 Author: Dan Smith Date: Mon Jun 12 14:38:18 2023 -0400 aliases for std::complex and std::complex commit d5db375ba08737551023d9b21455f3d5cd71faf0 Author: Dan Smith Date: Mon Jun 12 14:20:01 2023 -0400 Squashed commit of the following: commit bb2bb5aaf944040ea5bc42168b846324287dcad8 Merge: bbba5a210 4c146e7d0 Author: Dan Smith Date: Mon Jun 12 13:04:09 2023 -0400 Merge commit '4c146e7d01b14cf408b0e398cba96705df69090c' into develop/sync_externals commit 4c146e7d01b14cf408b0e398cba96705df69090c Author: Dan Smith Date: Mon Jun 12 13:04:09 2023 -0400 Squashed 'externals/coda-oss/' changes from aeec0131c..c88b9c053 c88b9c053 types::complex (#681) d1244a080 don't need our own make_unique in C++14 (#680) git-subtree-dir: externals/coda-oss git-subtree-split: c88b9c05325c802f88a85ddcebb498be4afacad0 commit bbba5a210c0257f622781914e9d228eeca23341c Author: Dan Smith Date: Mon Jun 12 13:04:06 2023 -0400 latest from CODA-OSS commit 370dd8876136755230624ebc955bc67642b1482b Merge: 58ff5a537 ffe1caafd Author: Dan Smith Date: Mon Jun 12 13:03:25 2023 -0400 Merge branch 'main' into develop/sync_externals commit 58ff5a5371d9158910e99613f4ce6e6fc36e543e Author: Dan Smith Date: Thu Jun 8 16:23:08 2023 -0400 latest from CODA-OSS commit 3bfc33a40274fa7a073983d4e4ddd907e45730d2 Author: Dan Smith Date: Thu Jun 8 14:34:45 2023 -0400 latest from CODA-OSS and NITRO commit 389417a983778ba2a07af9c6dbfea80484324b97 Merge: bce7ba0b1 4ad490fe4 Author: Dan Smith Date: Thu Jun 8 14:34:28 2023 -0400 latest from CODA-OSS and NITRO commit 4ad490fe4224df18ce4a437c40a257af0686140e Author: Dan Smith Date: Thu Jun 8 14:34:22 2023 -0400 Squashed 'externals/nitro/' changes from c8ecbe9ae..05dae18a3 05dae18a3 patch to build other projects 8f974e995 NITRO-2.11.3 (#554) 870aa6afd update to coda-oss 2023-06-05 (#553) 2fd7a0bfa latest from coda-oss (#552) 0eecce004 invoke() utility to reduce code duplication (#550) 59fb02fe9 latest from coda-oss (#551) 9fbf2b7b8 Fill out adapter free block which is used for nitf decompression (#549) 089ba0b5b latest from coda-oss 3b52f0025 latest from coda-oss (#547) 90c6263e2 latest from coda-oss (#544) 90d513ac5 latest from coda-oss (#543) git-subtree-dir: externals/nitro git-subtree-split: 05dae18a3a9c5ad70e1ce814c21ca8ec278829be commit 86929db19a438630d531ca0c34bdcd8e8c527ae9 Author: Dan Smith Date: Thu Jun 8 14:34:18 2023 -0400 Squashed 'externals/coda-oss/' changes from e87c32b4d..aeec0131c aeec0131c assert()s for mem::CopyablePtr (#679) 72b0ebd60 add types::complex_short (#678) 932130a58 patch to build other projects c00c1f203 coda-oss release 2023-06-06 (#677) ef54bbcd5 remove more compiler warnings (#676) dadfc5ce6 distinguish between byte-swapping a buffer and single value (#674) 90187f6cd more xml.lite tweaks for SIDD-3.0/ISM (#675) eb9960772 stronger type-checking for byteSwap() (#673) ff4f820ed xml.lite tweaks to support SIDD 3.0 ISM (#672) b1de8c0e5 std::byte should be a unique type (#671) c05bf9a02 allow enums to be byte-swapped too 1f9fd88d6 remove spurious 47684c45b byteSwap now uses byte buffers (#670) cbc659db2 add swapBytes() utility from SIX (#669) 891481b64 simplify byte-swapping (#668) 540ae763e more byteSwap() tweaks 0774c03c4 threaded byteSwap() (#667) d156370d3 swapping a single-byte value makes no sense c120e3255 be sure parameter is used to avoid compiler warning e85ec9331 --output-on-failure for CTest (#666) e80376197 turn off "there is no warning number" warning c5f0a5d15 A C-string may not be NULL-terminated (#665) 0c5eb29ae use platform-specific routines for byteSwap() (#664) 0b7d581fa remove transform_async() (#663) f6489b6be Merge branch 'main' into feature/xml.lite_tweaks 836c426a2 use function-pointers so that isConsoleOutput is only checked once 56e3c45b1 move depthPrint() functionality into non-member function in preparation for future changes ddcd26d97 Merge branch 'main' into feature/xml.lite_tweaks 69cc0e506 use the more rigorous create_and_check_datatype() 9efb87558 Merge branch 'main' into feature/hdf5 4d2f2f417 more HighFive unittests (#662) 14191a844 HighFive::create_datatype() goes from C++ to HighFive 98583473f utility routines to read string attributes 1fa75ce81 use the C API to read a string attribute 71e7b69f5 still can't figure out how to read a string attribute :-( e96f37a69 test reading the file attributes a25244519 getAttribute() unittest 8f12a3000 getDataType() unittest 857ff0af3 HighFive utility routines (#661) 1d687db57 writeDataSet() utility overload 106aa6894 sigh ... H5Easy::dump() fill fails on Windows/WAF :-( 2641b60b2 Merge branch 'main' into feature/hdf5 35c19e7e8 change actions to @v3 (#660) 212bbd3a3 works on local machine, but not build server ... ? 7125118b0 dump of 1D vector doesn't work :-( c704db435 sigh ... WAF build still failing :-( 01aae4616 does dump() of a 1D vector work? 76a53c813 comment-out H5 writing :-( 0f0e19aff test_highfive_dump() cb8f73795 trying to get highfive_dump() unittest working w/Windows-WAF 6584a264a does test_highfive_create() work? cde6147ce tweak HighFive wrappers (#659) 316566854 Revert "trying HighFive "write" unittests again" a9ec24ca4 trying HighFive "write" unittests again 585ad49a5 tweak names of utility routines 4c91a4d97 make it easier to read a std::vector and std::vecotr 0217ffa26 readDataSet() now works for 1D data 95e8973f2 trying to get hdf5::lite::load() working 4d294611d "const" correctness 5e6305c3f fix load_complex() 4a134dc5f start work on utility routines to read complex data from HDF5 9d76a7f41 Merge branch 'main' into feature/hdf5 8f9667a24 whitepsace ebd3fc99e Merge branch 'main' into feature/hdf5 40091b069 comment-out writing tests for now ... need to figure our WAF bulid failure 935aa3459 be sure the dataset has real data 114b9bf33 update release notes bd9c0b26c tweak HighFive utility routines acda1ef57 turn off diagnostics around expected failures 22a748840 readDataSet() utility routine for HighFive bd88a8c25 HighFive writeDataSet() utility to work with our SpanRC 6142f5b33 use HighFive routines to write a HDF5 file 5bbf1abaf Use HiveFive routines to get info about the file 84fbc8378 duplicate unittests with H5Easy f1f054c03 Merge branch 'main' into feature/hdf5 9b63ca470 fix directory names f6f826689 fix directory names 7aeb82c33 Merge branch 'main' into feature/hdf5 d028baaeb hook up HighFive header-only library (#653) 3083b0a31 Revert "HighFive 2.6.2" 246985a7f Revert ""build" HighFive HDF5 library" a8b75a586 Revert "turn off HighFive Boost support" ec68d5f83 Revert "Add HighFive unittests" f1f85b9e7 Revert "get test_high_five_base more-or-less compiling" 5ea634ee1 Revert "more work on getting HighFive unittests to build" ecc45433c more work on getting HighFive unittests to build bb194788a get test_high_five_base more-or-less compiling d42bde000 Add HighFive unittests ddc86bb32 turn off HighFive Boost support b255122d4 "build" HighFive HDF5 library 396cc3ef2 HighFive 2.6.2 5e5f9d9c0 Merge branch 'main' into feature/hdf5 ee938b4a5 changes from SIX bb764df90 Merge branch 'main' into feature/xml.lite_tweaks de2a24380 make derived classes 'final' if possible 14e19bcd2 Change xml lite function to virtual (#645) 8f42ac8e9 Merge branch 'main' into feature/xml.lite_tweaks 18ad90645 hdf5Write unittest 3462e1179 createFile() and writeFile() overloads ecee81d53 fix typos 197eecfa6 sketch-out hdf5::lite::writeFile() bd2311795 use SpanRC for writeFile(), not yet implemented ea9af7510 simple SpanRC to hold a 2D-size and pointer 027c19ee8 createFile() unittest 1f9d07ecb hook up createFile() 8c7e4473f start hooking up HDF5 writing 146e0bea3 Merge branch 'main' into feature/hdf5 88ca9fcb7 Merge branch 'main' into feature/hdf5 42b604b46 Squashed commit of the following: 10ee602c2 Merge branch 'main' into feature/hdf5 67aa42b69 restore changes from "main" 8bbfcbfbf unittests can be simplified to match fewer "view" classes 126bb802e Merge branch 'main' into feature/hdf5 3f8ba7a42 again, don't need a class just to convert from std::vector<> to std::span<> 24c2b489c Squashed commit of the following: 2703c119d Squashed commit of the following: 9d5228a2b don't need an entire class just to convert a std::vector<> into std::span<> 51bc931dc Merge branch 'main' into feature/hdf5 a84f25816 Squashed commit of the following: c4d2ed696 add missing #include guards, fix type in existing #include guard d541525a0 use a single ComplexViewConstIterator for all views 86e6a459f CODA_OSS_disable_warning causes GCC errors :-( 5d4b9c2cb only need an custom iterator for ComplexSpansView d9f0fb128 hook up iterators b9329e4db initial pass at a ComplexViewConstIterator 635238873 remove compiler warning about unused "constexpr" variables b39f6096f use the casing from H5 to make copy/pasting code slightly easier 0887b13eb Merge branch 'main' into feature/hdf5 bd07df1ca Consistent casing for Dataset, Datatype, Dataspace 7acd30ee2 tweak hdf5.lite dependencies 38ab914df Jupyter notebook for creating H5 files 95a040e0b _small.h5 is now (correctly) FLOAT32 107e7c487 make a simple values() member function to avoid template magic e1feca919 use TEST_SPECIFIC_EXCEPTION macro instead of try/catch 738333688 readDatasetT() now throws for the wrong buffer type 6b2cc2529 Merge branch 'feature/hdf5' of github.com:mdaus/coda-oss into feature/hdf5 310f8fd3d can't get template magic right for copy_axis() 86b306d59 stepping through copy ctors in the debugger is annoying f243e92d6 trying to make wrong type of buffer fail 2b10d9652 read in new sample file a28e59d8c help the compiler with type deduction 49bf5e9bc nested_complex_float_data_small.h5 e029325fc utility routines to "deconstruct" and array of std::complex dede3bd39 Merge branch 'main' into feature/hdf5 904b1ef5e tweak class names, make_() and copy() utility routines 8237b9efb make it harder to pass the wrong types to ComplexViews 4d9aeda2c ComplexArrayView and ComplexParallelView utility classes f5e367dfa test std::span> a4a2844f2 read in the nested "i" and "r" data 115615265 sample file has subgroups 8e1b7869a Merge branch 'feature/hdf5' of github.com:mdaus/coda-oss into feature/hdf5 9f4232a1d update sample H5 file 8c55db73a walk through HDF5 sub-groups 7775ed9c4 Update 123_barfoo_catdog_cx.h5 677975d7c Matlab code to create sample H5 file a0e7dfe07 Update test_hdf5info.cpp 0b67e1602 pass __FILE__ and __LINE__ from calling site for a more accurate exception message 86a677321 skeleton for more sample data 85f79b099 Merge branch 'main' into feature/hdf5 18088e942 Merge branch 'main' into feature/hdf5 3a1d17692 Merge branch 'main' into feature/hdf5 1755c69d7 Merge branch 'main' into feature/hdf5 9ad015432 No more "11" suffix on exception names c20d96251 Squashed commit of the following: c88cee999 other values to be filled-in bca4a4ecd incorporation NamedObject from HDF5 docs 61fa68f72 groupInfo() 460e7d766 datasetInfo() 14eb9b764 start filling in DatasetInfo afe5f1c3a start to fill in DatasetInfo 77a968c72 start filling in GroupInfo d81bcdfd9 openGroup() to open groups (loc) a0cd29469 comment-out "dataset" unittest for now 86e006024 begin filling in FileInfo 366dda6ab a return_type_of utility is needed to deduce the return type e21928263 explicitly pass return type to template 4937ccd11 template to reduce boilerplate when calling try_catch_H5Exceptions b3b5ebde7 use new exception utility routines ea1c03ef0 put exception handling/conversion in a utility routine 819a99d39 utility routine for exception handling 6f34eea97 put utilities in a separate file for easier reuse fcbde4f24 break utility routines into smaller pieces for easier reuse 52358ea8a WIN32 no longer automatically defined? 5a4286472 Revert "build HDF5 with C89" 680e599e9 build HDF5 with C89 a87a07121 Merge branch 'main' into feature/hdf5 8447c1a90 Revert "sym-links instead of copying files" db3b5e12b Merge branch 'main' into feature/xml.lite_tweaks fb60b5696 Merge branch 'main' into feature/hdf5 5110a5cc8 Comments about _u and _q 1a937d32c Merge branch 'main' into feature/xml.lite_tweaks fa06f04d7 get ready for hdf5.lite enhancdements b040c7c43 sym-links instead of copying files aa431bb47 use _u for xml::lite::Uri 3d0c6d58c fix case-sensitive #include filename 93dcd0e52 operator() for getElementByName() 75a93af85 more operator[] overloads to make attribute management easier 4ab8216f8 user-defined string literals to remove some noise around xml::lite::QName f82f0b0fc Merge branch 'main' into feature/xml.lite_tweaks ae30e3644 Merge branch 'feature/xml.lite_tweaks' of github.com:mdaus/coda-oss into feature/xml.lite_tweaks ffdd9beb0 simplify attribute creation 9bf5414f5 simplify attribute creation 82d7a4e95 SWIG gets confused about namespaces 7a61d0741 fix bug on Element ctor uncovered by unittest fdd7e58c1 QName is also in the xerces namespace which confuses SWIG bindings a325b7053 operator+=() overload for addChild daf30e6c0 Merge branch 'feature/xml.lite_tweaks' of github.com:mdaus/coda-oss into feature/xml.lite_tweaks b887d2b47 provide overloads for Element& rather than creating new "reference" types 1fa6bba38 rename test_xmleasy.cpp 7c8c9e0f1 += overload 850da6f63 overload for std::string 4547fc5a7 use UIT-8 strings for characterData 4723462a3 convenient addChild() overloads e48720753 copy over ElementReference from xml.easy a4ca30a0d Merge branch 'main' into feature/xml.lite_tweaks 6ae9f0b71 Revert "check-in of new xml.easy (to move code between computers)" f7466a6d7 Revert "simple routines for single element" a5490230d Revert "make some operators simplier ways of calling functions" c9a25630a Revert "get document creation working" 8af8710b0 Revert "free functions instead of member functions" 16c3847cb Revert "ElementReference distinct from Element" 7d68e156f Revert "ElementMutableReference" 00eb2a282 Merge branch 'main' into feature/xml.lite_tweaks a42969c1f ElementMutableReference a20ae9355 ElementReference distinct from Element 14eeeea0b free functions instead of member functions 4aae014b3 get document creation working 883569269 make some operators simplier ways of calling functions 053bd1212 simple routines for single element 8bf701a2e check-in of new xml.easy (to move code between computers) 41f959051 unittests for creating XML documents from scratch 9752d50ae Merge branch 'main' into feature/xml.lite_tweaks 1531d5709 by default, don't validate strings passed to Uri() 46d13d4bf Merge branch 'master' into feature/xml.lite_tweaks 39b547d32 remove more vestiges of Expat and LibXML ec8274d52 remove LibXML and Expat as they're no longer used/supported. 20eeefeef Merge branch 'master' into feature/xml.lite_tweaks 95074b9b1 update for newer Intel compiler 7024f71e1 Merge branch 'master' into feature/xml.lite_tweaks 57b1cbc83 Merge branch 'master' into feature/xml.lite_tweaks 4b67561c3 remove validate() overload that nobody is using fa15f1e5d Squashed commit of the following: 1484a9090 test the new validate() API 470da70fb hookup StringStreamT routines 2cddf2504 begin hooking up validate() overloads 1b5d910f3 overload validate() for UTF-8 and Windows-1252 03309b8c9 Squashed commit of the following: b72c6c5bf older compiler doesn't like our make_unique af8f00307 validate UTF-8 XML on Linux 211188613 unit-test for LEGACY XML validation 3c1169d2b Squashed commit of the following: 3afff19ca std::filesystem::path for FileInputStreamOS 908d452f8 WIP: validate all of our sample XML files 00f9bb16b validate against a XML schema 243d8c356 Merge branch 'master' into feature/xml.lite_tweaks 2815d707d fix to work with SWIG bindings. :-( 460862132 trying (again) to remove vestiages of old code e3c83a858 Revert "new code should use UTF-8" 811207c92 new code should use UTF-8 0ffd835f9 Squashed commit of the following: 1e7e03ded Merge branch 'master' into feature/xml.lite_tweaks c1d806aff Merge branch 'master' into feature/xml.lite_tweaks 850d3c811 str::strip() that can be easier to use than str::trim() 580ba9c8c explicitly =delete move 2b39831a8 Squashed commit of the following: 39eebdc23 Merge branch 'master' into feature/xml.lite_tweaks 9adf86cba force calling new UTF-8 write() routines ea61b6204 Merge branch 'master' into feature/xml.lite_tweaks 8a34583fa overload to take schemaPaths as filesystem::path 8671b442f parse XML embedded in a binary file ec4a902f1 updates from xerces.lite 80dc4d963 updates from xerces.lite 549766d6c Attributes::contains() no longer catches an exception 8a645ceac need "sys/" when building in other environments 36af08269 super-simple URI validation 78ef28a3e SWIG bindings are a PITA! :-( e9cba8491 SWIG needs help with Uri 8a8d8dc07 another routines used by pre-build SWIG bindings 818e1ec5d pre-build SWIG bindings use getElementByTagName() member function 067cac5d8 old compiler gets confused on unadorned QName ba92c0ae7 more use of Uri and QName 446c7d17a use QName in new code d6f8b0c83 more direct use of QName 90fff1c73 use xml::lite::QName instead of tuple 646cbb5ed more direct use of QName and Uri ba589ea3b make QName more robust bab0ee8b5 createElement() -> addNewElement() e3a145747 grab changes from six-library 32285e95c Merge branch 'master' into feature/xml.lite_tweaks 9f79f0bf6 Merge branch 'master' into feature/xml.lite_tweaks a12bbc32c make it easier to create new Elements with a value fc9967f98 make it easy for callers to addChild() keep a reference to the Element 4627766b7 be sure test_xmlparser works in "externals" of other projects bf2276396 "private" is part of the name-mangling fad92bcc8 making sure copy-ctor is implemented f90fdcead consolidate common XML test code 9fc53f2d5 use str:: utility for casting 6da6f794b still trying to find the right macro for SWIG 0c1b86c56 still trying to fix SWIG fdc6fc9bd trying to fix SWIG build error 7835e8c27 SWIG needs copy-ctor 585695942 disable copy/assignment for Element, it's probably almost always wrong 391fed613 fix double-delete caused by copying 61790fe69 retry parsing XML with Windows-1252 if first parse() fails 63cffac59 change string_encoding to match coda-oss style of PascalCase 010479bbe read an XML file we know is wrongly encoded as Windows-1252 9a0505062 more references instead of pointers 2d44b6951 Reading Windows-1252 w/o "encoding" fails 63dc7b076 read Windows-1252 too c9434c9cb test as UIT-8 too f310ccf0c get reading from UTF-8 XML working on Windows 1fa39c2be get testReadUtf8XmlFile working on Linux 1a83cd815 sys::Path is too much trouble right now ed60aa22c unit-test to read XML from a file a9336db7c Squashed commit of the following: 0825beb0d Merge branch 'master' into feature/xml.lite_tweaks c618489be Merge branch 'master' into feature/xml.lite_tweaks e8e4b8fe1 determine string_encoding based on platform 1f43bcfc2 create a new Element by using the platform to determine "characterData" encoding 961bef66b Merge branch 'master' into feature/xml.lite_tweaks e9798a5cb fix static_assert() 6f7772874 Merge branch 'master' into feature/xml.lite_tweaks b98d4f5a9 Merge branch 'master' into feature/xml.lite_tweaks 1b5abba2a The (old) version of SWIG we're using doesn't like certain C++11 features. 53bdeabaf Merge branch 'master' into feature/xml.lite_tweaks 60cf8ae80 "" doesn't work with decltype() in older C++ 97e72477a reduce getValue() overloads by making "key" a template argument 5e6373e55 reduce code duplication f9e7cfeee provide castValue instead of getValue(T&) cbd0bd8f2 castValue throws instead of returning a bool like getValue(T&) 87c7514fc Merge branch 'master' into feature/xml.lite_tweaks 10cc61223 make getElement*() consistent for zero or >1 results f5b137e3c Merge branch 'master' into feature/xml.lite_tweaks 1765efc62 allow clients to specify toType() and toString() for getValue() and setValue() df8b746e1 allow clients to specify their own toType/toString routines 66702726a Merge branch 'master' into feature/xml.lite_tweaks 6956311f1 Merge branch 'master' into feature/xml.lite_tweaks d505f3593 Merge branch 'master' into feature/xml.lite_tweaks fbd106115 catch a BadCastException and return false from getValue() 3a78377b5 use a template to reduce duplicated code 0ad4b8606 Merge branch 'master' into feature/xml.lite_tweaks a848aa3a2 get & set the characer data as a type f3ee1ee12 utility routines to set an attribute value 595227683 templates to get an attribute value convert to a specific type 06639227b miised a change in last commit 1aa458ef8 add getValue() overloads that return true/false rather than throwing faa6d3075 added getElementByTagName() overloads as that's a very common use-case git-subtree-dir: externals/coda-oss git-subtree-split: aeec0131c51497c5d448a39be0d2df608d93bc15 commit bce7ba0b1ae40e9ddcb4f24610e7e4d702272d54 Merge: 646b70e8d 86929db19 Author: Dan Smith Date: Thu Jun 8 14:34:18 2023 -0400 Merge commit '86929db19a438630d531ca0c34bdcd8e8c527ae9' into develop/sync_externals commit 646b70e8d47438211451493837e6b2d76db4e896 Author: Dan Smith Date: Thu Jun 8 14:34:13 2023 -0400 latest from CODA-OSS and NITRO * use cphd::Version enum rather than strings * use cphd::Version in more places instead of a string version * cphd::FileHeader::DEFAULT_VERSION has to be `const char*` for existing Python bindings * releaseInfo can be empty (but must exist) "... we found that the six library does a check when reading a CPHD file to ensure that the Release Info field not only exists, but that it is not an empty string. The CPHD spec does require that the field exists, but does not seem to prohibit it from being an empty string. We have gotten some vendor CPHDs with an empty field here and have failed reading the file due to this. I checked and SARPY is able to read (it must not implement the same check)." * Create CPHD_schema_V1.1.0_2021_11_30.xsd Download from https://nsgreg.nga.mil/registries/search/results.jsp?registryType=doc&searchTextField=cphd&searchOnField=name®isterField=any&itemTypeField=doc&itemTypeField=dst&statusNameField=2&nsgKeywordsField=any&disrServiceAreaField=any&stdStatusField=any&dayField=24&monthField=7&yearField=2023&tzOffset=240&searchButton= * tweak order to match spec * start adding new CPHD 1.1.0 types * Create NGA.STND.0068-1_1.1.0_CPHD_DIDD_FINAL.pdf * keep adding new CPHD 1.1.0 types * prepare to parse optional Polarization parameters added in CPHD 1.1.0 * serialize and parse new PolRefType * add new delayBias parameter * add the UseEBPVP parameter * Add the UseACFPVP parameter * put `ZeroToOne` and `NegHalfToHalf` typedefs in a common place * add AntGPId * use UTF-8 for newly added strings * add DTAId and UseDTA * XmlValueElement utility to minimize copy/paste errors * use six::XmlOptionalElement for more new fields * use XmlOptionalElement for newly added strings * using XmlLite directly, no need for forwarding routines * name() -> tag() * use XmlOptionalElement for newly added optional values * simple update to unittest some new values * Added AntPolRef * add EBFreqShiftSF and MLFreqDilationSF * operator=() instead of value() * remove a little bit of C++ noise * begin work on TxAntenna and RcvAntenna * fix bug in optional causing compile failure * fix optional * XmlValueElement -> XsElement * XmlOptionalElement -> XsElement_minOccurs0 * start hooking up TxAntenna * hook up PerVectorParameterXYZ and PerVectorParameterEB * XmlLite instances should be "const" * switch UnmodeledS to use new XsElement<> so there's more testing; also gets rid of some yucky macros * switch UnmodeledDecorr to XsElement_minOccurs0 * latest from CODA-OSS * XsElement now in xml::lite * use the QName to create an element * XsElement is only used in SIX and there's no test code in CODA-OSS * support existing get() from mem::ScopedCopyablePtr * use implicit casts to minimize differences to existing code * don't need make_XsElement() anymore * compare the QName()s rather than tags. * make it clear when we're accessing the std::optional * with implicit cast, calls to .value() can be reduced preserving existing code * begin adding overloads for QName * parseOptional() -> parse() overload * getFirstAndOnly() overload for QName * XsNonNegativeInteger and XsPositiveInteger_fixed2 aliases * DwellTimeArray * in the XSD, DwellTimeArrayType is almost the same as AntGainPhaseType * DwellTimeArray to the XML * convert new PolarizationType enum values to/from string * update ReleaseNotes.md * Squashed 'externals/coda-oss/' changes from e87c32b4d..065e86ddc 065e86ddc operator==() for QName (#710) 1c16380ce remove zint* typedefs; don't want to encourage use of types::Complex (#709) 6dd247991 our optional<> is now closer to C++17 (#708) 87ac61739 strict checking on `std::complex` is too much of a hassle for now 034d52c86 overloads to byte-swap type::Complex are too much trouble (#707) 42d449c33 sys::byteSwap overloads for types::Complex (#705) 4092fd8e7 remove work-around for NITRO bug (#704) e2472acfc build in NITRO and SIX (#703) 32ccf9105 Use same build paths as Visual Studio (#701) 366ac9f43 Another round of removing compiler warnings (#702) a7f8ef260 Fix compile warnings from building CODA (#700) f70b4202f account for coda-oss.vcxproj being in other SLNs af3faebfc Remove more compiler/code-analysis warnings (#699) 82be2a6db unittests should work w/o install (#698) dbb90a06d add msbuild for coda-oss.sln (#697) 5a417140a reduce compiler warnings (#696) 288619dfa all modules now part of coda-oss.vcxproj (#695) c2fc5fc66 add more projects to coda-oss-lite.vcxproj (#694) ceb86c186 support $(PlatformToolset) as a "special" environment variable (#693) d78a8595a OS::getSIMDInstructionSet() utility (#692) 2d2df467d fix `python3 waf dumplib` 54033e70e Merge branch 'main' into feature/complex_short 3c63f9f65 std::numbers from C++20 (#691) 892dd0e00 ComplexInteger and ComplexReal to better match existing naming conventions (#690) b3872181e match coda-oss naming conventions (#688) 704d6867f beef-up our complex type (#687) 47c1c1cd6 check is_absolute() for URLs (#686) c042373e1 be sure our Path::isAbolute() matches std::filesystem::path::absolute() (#684) ad10286bc volatile is about "special" memory, not threading (#685) f4d42005f fix build error in NITRO ff11a5557 keep using std::complex for now (#682) c88b9c053 types::complex (#681) d1244a080 don't need our own make_unique in C++14 (#680) aeec0131c assert()s for mem::CopyablePtr (#679) 72b0ebd60 add types::complex_short (#678) 932130a58 patch to build other projects c00c1f203 coda-oss release 2023-06-06 (#677) ef54bbcd5 remove more compiler warnings (#676) dadfc5ce6 distinguish between byte-swapping a buffer and single value (#674) 90187f6cd more xml.lite tweaks for SIDD-3.0/ISM (#675) eb9960772 stronger type-checking for byteSwap() (#673) ff4f820ed xml.lite tweaks to support SIDD 3.0 ISM (#672) b1de8c0e5 std::byte should be a unique type (#671) c05bf9a02 allow enums to be byte-swapped too 1f9fd88d6 remove spurious 47684c45b byteSwap now uses byte buffers (#670) cbc659db2 add swapBytes() utility from SIX (#669) 891481b64 simplify byte-swapping (#668) 540ae763e more byteSwap() tweaks 0774c03c4 threaded byteSwap() (#667) d156370d3 swapping a single-byte value makes no sense c120e3255 be sure parameter is used to avoid compiler warning e85ec9331 --output-on-failure for CTest (#666) e80376197 turn off "there is no warning number" warning c5f0a5d15 A C-string may not be NULL-terminated (#665) 0c5eb29ae use platform-specific routines for byteSwap() (#664) 0b7d581fa remove transform_async() (#663) f6489b6be Merge branch 'main' into feature/xml.lite_tweaks 836c426a2 use function-pointers so that isConsoleOutput is only checked once 56e3c45b1 move depthPrint() functionality into non-member function in preparation for future changes ddcd26d97 Merge branch 'main' into feature/xml.lite_tweaks 69cc0e506 use the more rigorous create_and_check_datatype() 9efb87558 Merge branch 'main' into feature/hdf5 4d2f2f417 more HighFive unittests (#662) 14191a844 HighFive::create_datatype() goes from C++ to HighFive 98583473f utility routines to read string attributes 1fa75ce81 use the C API to read a string attribute 71e7b69f5 still can't figure out how to read a string attribute :-( e96f37a69 test reading the file attributes a25244519 getAttribute() unittest 8f12a3000 getDataType() unittest 857ff0af3 HighFive utility routines (#661) 1d687db57 writeDataSet() utility overload 106aa6894 sigh ... H5Easy::dump() fill fails on Windows/WAF :-( 2641b60b2 Merge branch 'main' into feature/hdf5 35c19e7e8 change actions to @v3 (#660) 212bbd3a3 works on local machine, but not build server ... ? 7125118b0 dump of 1D vector doesn't work :-( c704db435 sigh ... WAF build still failing :-( 01aae4616 does dump() of a 1D vector work? 76a53c813 comment-out H5 writing :-( 0f0e19aff test_highfive_dump() cb8f73795 trying to get highfive_dump() unittest working w/Windows-WAF 6584a264a does test_highfive_create() work? cde6147ce tweak HighFive wrappers (#659) 316566854 Revert "trying HighFive "write" unittests again" a9ec24ca4 trying HighFive "write" unittests again 585ad49a5 tweak names of utility routines 4c91a4d97 make it easier to read a std::vector and std::vecotr 0217ffa26 readDataSet() now works for 1D data 95e8973f2 trying to get hdf5::lite::load() working 4d294611d "const" correctness 5e6305c3f fix load_complex() 4a134dc5f start work on utility routines to read complex data from HDF5 9d76a7f41 Merge branch 'main' into feature/hdf5 8f9667a24 whitepsace ebd3fc99e Merge branch 'main' into feature/hdf5 40091b069 comment-out writing tests for now ... need to figure our WAF bulid failure 935aa3459 be sure the dataset has real data 114b9bf33 update release notes bd9c0b26c tweak HighFive utility routines acda1ef57 turn off diagnostics around expected failures 22a748840 readDataSet() utility routine for HighFive bd88a8c25 HighFive writeDataSet() utility to work with our SpanRC 6142f5b33 use HighFive routines to write a HDF5 file 5bbf1abaf Use HiveFive routines to get info about the file 84fbc8378 duplicate unittests with H5Easy f1f054c03 Merge branch 'main' into feature/hdf5 9b63ca470 fix directory names f6f826689 fix directory names 7aeb82c33 Merge branch 'main' into feature/hdf5 d028baaeb hook up HighFive header-only library (#653) 3083b0a31 Revert "HighFive 2.6.2" 246985a7f Revert ""build" HighFive HDF5 library" a8b75a586 Revert "turn off HighFive Boost support" ec68d5f83 Revert "Add HighFive unittests" f1f85b9e7 Revert "get test_high_five_base more-or-less compiling" 5ea634ee1 Revert "more work on getting HighFive unittests to build" ecc45433c more work on getting HighFive unittests to build bb194788a get test_high_five_base more-or-less compiling d42bde000 Add HighFive unittests ddc86bb32 turn off HighFive Boost support b255122d4 "build" HighFive HDF5 library 396cc3ef2 HighFive 2.6.2 5e5f9d9c0 Merge branch 'main' into feature/hdf5 ee938b4a5 changes from SIX bb764df90 Merge branch 'main' into feature/xml.lite_tweaks de2a24380 make derived classes 'final' if possible 14e19bcd2 Change xml lite function to virtual (#645) 8f42ac8e9 Merge branch 'main' into feature/xml.lite_tweaks 18ad90645 hdf5Write unittest 3462e1179 createFile() and writeFile() overloads ecee81d53 fix typos 197eecfa6 sketch-out hdf5::lite::writeFile() bd2311795 use SpanRC for writeFile(), not yet implemented ea9af7510 simple SpanRC to hold a 2D-size and pointer 027c19ee8 createFile() unittest 1f9d07ecb hook up createFile() 8c7e4473f start hooking up HDF5 writing 146e0bea3 Merge branch 'main' into feature/hdf5 88ca9fcb7 Merge branch 'main' into feature/hdf5 42b604b46 Squashed commit of the following: 10ee602c2 Merge branch 'main' into feature/hdf5 67aa42b69 restore changes from "main" 8bbfcbfbf unittests can be simplified to match fewer "view" classes 126bb802e Merge branch 'main' into feature/hdf5 3f8ba7a42 again, don't need a class just to convert from std::vector<> to std::span<> 24c2b489c Squashed commit of the following: 2703c119d Squashed commit of the following: 9d5228a2b don't need an entire class just to convert a std::vector<> into std::span<> 51bc931dc Merge branch 'main' into feature/hdf5 a84f25816 Squashed commit of the following: c4d2ed696 add missing #include guards, fix type in existing #include guard d541525a0 use a single ComplexViewConstIterator for all views 86e6a459f CODA_OSS_disable_warning causes GCC errors :-( 5d4b9c2cb only need an custom iterator for ComplexSpansView d9f0fb128 hook up iterators b9329e4db initial pass at a ComplexViewConstIterator 635238873 remove compiler warning about unused "constexpr" variables b39f6096f use the casing from H5 to make copy/pasting code slightly easier 0887b13eb Merge branch 'main' into feature/hdf5 bd07df1ca Consistent casing for Dataset, Datatype, Dataspace 7acd30ee2 tweak hdf5.lite dependencies 38ab914df Jupyter notebook for creating H5 files 95a040e0b _small.h5 is now (correctly) FLOAT32 107e7c487 make a simple values() member function to avoid template magic e1feca919 use TEST_SPECIFIC_EXCEPTION macro instead of try/catch 738333688 readDatasetT() now throws for the wrong buffer type 6b2cc2529 Merge branch 'feature/hdf5' of github.com:mdaus/coda-oss into feature/hdf5 310f8fd3d can't get template magic right for copy_axis() 86b306d59 stepping through copy ctors in the debugger is annoying f243e92d6 trying to make wrong type of buffer fail 2b10d9652 read in new sample file a28e59d8c help the compiler with type deduction 49bf5e9bc nested_complex_float_data_small.h5 e029325fc utility routines to "deconstruct" and array of std::complex dede3bd39 Merge branch 'main' into feature/hdf5 904b1ef5e tweak class names, make_() and copy() utility routines 8237b9efb make it harder to pass the wrong types to ComplexViews 4d9aeda2c ComplexArrayView and ComplexParallelView utility classes f5e367dfa test std::span> a4a2844f2 read in the nested "i" and "r" data 115615265 sample file has subgroups 8e1b7869a Merge branch 'feature/hdf5' of github.com:mdaus/coda-oss into feature/hdf5 9f4232a1d update sample H5 file 8c55db73a walk through HDF5 sub-groups 7775ed9c4 Update 123_barfoo_catdog_cx.h5 677975d7c Matlab code to create sample H5 file a0e7dfe07 Update test_hdf5info.cpp 0b67e1602 pass __FILE__ and __LINE__ from calling site for a more accurate exception message 86a677321 skeleton for more sample data 85f79b099 Merge branch 'main' into feature/hdf5 18088e942 Merge branch 'main' into feature/hdf5 3a1d17692 Merge branch 'main' into feature/hdf5 1755c69d7 Merge branch 'main' into feature/hdf5 9ad015432 No more "11" suffix on exception names c20d96251 Squashed commit of the following: c88cee999 other values to be filled-in bca4a4ecd incorporation NamedObject from HDF5 docs 61fa68f72 groupInfo() 460e7d766 datasetInfo() 14eb9b764 start filling in DatasetInfo afe5f1c3a start to fill in DatasetInfo 77a968c72 start filling in GroupInfo d81bcdfd9 openGroup() to open groups (loc) a0cd29469 comment-out "dataset" unittest for now 86e006024 begin filling in FileInfo 366dda6ab a return_type_of utility is needed to deduce the return type e21928263 explicitly pass return type to template 4937ccd11 template to reduce boilerplate when calling try_catch_H5Exceptions b3b5ebde7 use new exception utility routines ea1c03ef0 put exception handling/conversion in a utility routine 819a99d39 utility routine for exception handling 6f34eea97 put utilities in a separate file for easier reuse fcbde4f24 break utility routines into smaller pieces for easier reuse 52358ea8a WIN32 no longer automatically defined? 5a4286472 Revert "build HDF5 with C89" 680e599e9 build HDF5 with C89 a87a07121 Merge branch 'main' into feature/hdf5 8447c1a90 Revert "sym-links instead of copying files" db3b5e12b Merge branch 'main' into feature/xml.lite_tweaks fb60b5696 Merge branch 'main' into feature/hdf5 5110a5cc8 Comments about _u and _q 1a937d32c Merge branch 'main' into feature/xml.lite_tweaks fa06f04d7 get ready for hdf5.lite enhancdements b040c7c43 sym-links instead of copying files aa431bb47 use _u for xml::lite::Uri 3d0c6d58c fix case-sensitive #include filename 93dcd0e52 operator() for getElementByName() 75a93af85 more operator[] overloads to make attribute management easier 4ab8216f8 user-defined string literals to remove some noise around xml::lite::QName f82f0b0fc Merge branch 'main' into feature/xml.lite_tweaks ae30e3644 Merge branch 'feature/xml.lite_tweaks' of github.com:mdaus/coda-oss into feature/xml.lite_tweaks ffdd9beb0 simplify attribute creation 9bf5414f5 simplify attribute creation 82d7a4e95 SWIG gets confused about namespaces 7a61d0741 fix bug on Element ctor uncovered by unittest fdd7e58c1 QName is also in the xerces namespace which confuses SWIG bindings a325b7053 operator+=() overload for addChild daf30e6c0 Merge branch 'feature/xml.lite_tweaks' of github.com:mdaus/coda-oss into feature/xml.lite_tweaks b887d2b47 provide overloads for Element& rather than creating new "reference" types 1fa6bba38 rename test_xmleasy.cpp 7c8c9e0f1 += overload 850da6f63 overload for std::string 4547fc5a7 use UIT-8 strings for characterData 4723462a3 convenient addChild() overloads e48720753 copy over ElementReference from xml.easy a4ca30a0d Merge branch 'main' into feature/xml.lite_tweaks 6ae9f0b71 Revert "check-in of new xml.easy (to move code between computers)" f7466a6d7 Revert "simple routines for single element" a5490230d Revert "make some operators simplier ways of calling functions" c9a25630a Revert "get document creation working" 8af8710b0 Revert "free functions instead of member functions" 16c3847cb Revert "ElementReference distinct from Element" 7d68e156f Revert "ElementMutableReference" 00eb2a282 Merge branch 'main' into feature/xml.lite_tweaks a42969c1f ElementMutableReference a20ae9355 ElementReference distinct from Element 14eeeea0b free functions instead of member functions 4aae014b3 get document creation working 883569269 make some operators simplier ways of calling functions 053bd1212 simple routines for single element 8bf701a2e check-in of new xml.easy (to move code between computers) 41f959051 unittests for creating XML documents from scratch 9752d50ae Merge branch 'main' into feature/xml.lite_tweaks 1531d5709 by default, don't validate strings passed to Uri() 46d13d4bf Merge branch 'master' into feature/xml.lite_tweaks 39b547d32 remove more vestiges of Expat and LibXML ec8274d52 remove LibXML and Expat as they're no longer used/supported. 20eeefeef Merge branch 'master' into feature/xml.lite_tweaks 95074b9b1 update for newer Intel compiler 7024f71e1 Merge branch 'master' into feature/xml.lite_tweaks 57b1cbc83 Merge branch 'master' into feature/xml.lite_tweaks 4b67561c3 remove validate() overload that nobody is using fa15f1e5d Squashed commit of the following: 1484a9090 test the new validate() API 470da70fb hookup StringStreamT routines 2cddf2504 begin hooking up validate() overloads 1b5d910f3 overload validate() for UTF-8 and Windows-1252 03309b8c9 Squashed commit of the following: b72c6c5bf older compiler doesn't like our make_unique af8f00307 validate UTF-8 XML on Linux 211188613 unit-test for LEGACY XML validation 3c1169d2b Squashed commit of the following: 3afff19ca std::filesystem::path for FileInputStreamOS 908d452f8 WIP: validate all of our sample XML files 00f9bb16b validate against a XML schema 243d8c356 Merge branch 'master' into feature/xml.lite_tweaks 2815d707d fix to work with SWIG bindings. :-( 460862132 trying (again) to remove vestiages of old code e3c83a858 Revert "new code should use UTF-8" 811207c92 new code should use UTF-8 0ffd835f9 Squashed commit of the following: 1e7e03ded Merge branch 'master' into feature/xml.lite_tweaks c1d806aff Merge branch 'master' into feature/xml.lite_tweaks 850d3c811 str::strip() that can be easier to use than str::trim() 580ba9c8c explicitly =delete move 2b39831a8 Squashed commit of the following: 39eebdc23 Merge branch 'master' into feature/xml.lite_tweaks 9adf86cba force calling new UTF-8 write() routines ea61b6204 Merge branch 'master' into feature/xml.lite_tweaks 8a34583fa overload to take schemaPaths as filesystem::path 8671b442f parse XML embedded in a binary file ec4a902f1 updates from xerces.lite 80dc4d963 updates from xerces.lite 549766d6c Attributes::contains() no longer catches an exception 8a645ceac need "sys/" when building in other environments 36af08269 super-simple URI validation 78ef28a3e SWIG bindings are a PITA! :-( e9cba8491 SWIG needs help with Uri 8a8d8dc07 another routines used by pre-build SWIG bindings 818e1ec5d pre-build SWIG bindings use getElementByTagName() member function 067cac5d8 old compiler gets confused on unadorned QName ba92c0ae7 more use of Uri and QName 446c7d17a use QName in new code d6f8b0c83 more direct use of QName 90fff1c73 use xml::lite::QName instead of tuple 646cbb5ed more direct use of QName and Uri ba589ea3b make QName more robust bab0ee8b5 createElement() -> addNewElement() e3a145747 grab changes from six-library 32285e95c Merge branch 'master' into feature/xml.lite_tweaks 9f79f0bf6 Merge branch 'master' into feature/xml.lite_tweaks a12bbc32c make it easier to create new Elements with a value fc9967f98 make it easy for callers to addChild() keep a reference to the Element 4627766b7 be sure test_xmlparser works in "externals" of other projects bf2276396 "private" is part of the name-mangling fad92bcc8 making sure copy-ctor is implemented f90fdcead consolidate common XML test code 9fc53f2d5 use str:: utility for casting 6da6f794b still trying to find the right macro for SWIG 0c1b86c56 still trying to fix SWIG fdc6fc9bd trying to fix SWIG build error 7835e8c27 SWIG needs copy-ctor 585695942 disable copy/assignment for Element, it's probably almost always wrong 391fed613 fix double-delete caused by copying 61790fe69 retry parsing XML with Windows-1252 if first parse() fails 63cffac59 change string_encoding to match coda-oss style of PascalCase 010479bbe read an XML file we know is wrongly encoded as Windows-1252 9a0505062 more references instead of pointers 2d44b6951 Reading Windows-1252 w/o "encoding" fails 63dc7b076 read Windows-1252 too c9434c9cb test as UIT-8 too f310ccf0c get reading from UTF-8 XML working on Windows 1fa39c2be get testReadUtf8XmlFile working on Linux 1a83cd815 sys::Path is too much trouble right now ed60aa22c unit-test to read XML from a file a9336db7c Squashed commit of the following: 0825beb0d Merge branch 'master' into feature/xml.lite_tweaks c618489be Merge branch 'master' into feature/xml.lite_tweaks e8e4b8fe1 determine string_encoding based on platform 1f43bcfc2 create a new Element by using the platform to determine "characterData" encoding 961bef66b Merge branch 'master' into feature/xml.lite_tweaks e9798a5cb fix static_assert() 6f7772874 Merge branch 'master' into feature/xml.lite_tweaks b98d4f5a9 Merge branch 'master' into feature/xml.lite_tweaks 1b5abba2a The (old) version of SWIG we're using doesn't like certain C++11 features. 53bdeabaf Merge branch 'master' into feature/xml.lite_tweaks 60cf8ae80 "" doesn't work with decltype() in older C++ 97e72477a reduce getValue() overloads by making "key" a template argument 5e6373e55 reduce code duplication f9e7cfeee provide castValue instead of getValue(T&) cbd0bd8f2 castValue throws instead of returning a bool like getValue(T&) 87c7514fc Merge branch 'master' into feature/xml.lite_tweaks 10cc61223 make getElement*() consistent for zero or >1 results f5b137e3c Merge branch 'master' into feature/xml.lite_tweaks 1765efc62 allow clients to specify toType() and toString() for getValue() and setValue() df8b746e1 allow clients to specify their own toType/toString routines 66702726a Merge branch 'master' into feature/xml.lite_tweaks 6956311f1 Merge branch 'master' into feature/xml.lite_tweaks d505f3593 Merge branch 'master' into feature/xml.lite_tweaks fbd106115 catch a BadCastException and return false from getValue() 3a78377b5 use a template to reduce duplicated code 0ad4b8606 Merge branch 'master' into feature/xml.lite_tweaks a848aa3a2 get & set the characer data as a type f3ee1ee12 utility routines to set an attribute value 595227683 templates to get an attribute value convert to a specific type 06639227b miised a change in last commit 1aa458ef8 add getValue() overloads that return true/false rather than throwing faa6d3075 added getElementByTagName() overloads as that's a very common use-case git-subtree-dir: externals/coda-oss git-subtree-split: 065e86ddcbd20a353efe5e0231503dd01c8343a8 * latest from CODA-OSS * Squashed 'externals/nitro/' changes from c8ecbe9ae..5724d8c18 5724d8c18 latest from CODA-OSS (#570) fb794f0fe latest from CODA-OSS (#569) 7a6132ba0 update files changes in cpp17 branch (#568) de91d4977 Fix bug creating NITFException (#567) 225273436 fix YAML for 'main' 5d1c83d11 single project for unittests (#566) 102a019db latest from CODA-OSS (known broken build) (#565) b4ae2d429 match YAML from coda-oss 176bcaf6d build NITRO.SLN using msbuild (#562) 85e9043b8 latest from CODA-OSS (#561) 49ec50325 use new "PlatformToolkit" special environment variable (#560) 6c06e3711 latest from CODA-OSS (#559) cee9feb42 latest from CODA-OSS (#558) 3f01809fa latest from coda-oss (#557) 471fb3fc1 Update test_j2k_loading++.cpp b12caf2fc latest from CODA-OSS (#556) 0cd432624 use sys::make_span (#555) 05dae18a3 patch to build other projects 8f974e995 NITRO-2.11.3 (#554) 870aa6afd update to coda-oss 2023-06-05 (#553) 2fd7a0bfa latest from coda-oss (#552) 0eecce004 invoke() utility to reduce code duplication (#550) 59fb02fe9 latest from coda-oss (#551) 9fbf2b7b8 Fill out adapter free block which is used for nitf decompression (#549) 089ba0b5b latest from coda-oss 3b52f0025 latest from coda-oss (#547) 90c6263e2 latest from coda-oss (#544) 90d513ac5 latest from coda-oss (#543) git-subtree-dir: externals/nitro git-subtree-split: 5724d8c185ec42159a0f68914f38cb161c2a8df8 * latest from CODA-OSS * build with C++17 * make sure we'll always be able to uniquely identify versions * remove more macros * `Unmodeled` -> `unmodeled` * utility routines to reduce copy/paste errors * switch CorrCoefZero and DecorrRate to use XsElement * switch unmodeled to new XsElement_minOccurs0 * Missed a Unmoded -> unmodeled somehow ... * v200 -> v2_0_0 * simplify Unmodeled processing: reduce use of get() * use XsElement for the remaining new SIDD 3.0 XML * make newFromElement() a template. * add missing test_valid_sixsicd unittest --- UnitTest/sicd.cpp | 6 +- six/modules/c++/cphd/include/cphd/Types.h | 6 +- .../c++/cphd/source/CPHDXMLControl.cpp | 12 +- six/modules/c++/cphd/source/FileHeader.cpp | 2 +- six/modules/c++/cphd/source/Metadata.cpp | 6 +- .../six.sicd/unittests/test_valid_sixsicd.cpp | 46 +++--- .../six.sidd/include/six/sidd/DerivedData.h | 8 +- .../c++/six.sidd/source/DerivedData.cpp | 10 +- .../c++/six.sidd/source/DerivedXMLControl.cpp | 18 +-- .../six.sidd/source/DerivedXMLParser100.cpp | 2 +- .../six.sidd/source/DerivedXMLParser200.cpp | 2 +- .../six.sidd/source/DerivedXMLParser300.cpp | 2 +- six/modules/c++/six.sidd/source/Utilities.cpp | 18 +-- .../six.sidd/unittests/test_valid_sixsidd.cpp | 49 ++++--- .../c++/six/include/six/ErrorStatistics.h | 34 +++-- .../c++/six/include/six/SICommonXMLParser.h | 5 + six/modules/c++/six/include/six/XMLParser.h | 6 + six/modules/c++/six/include/six/XmlLite.h | 10 ++ six/modules/c++/six/include/six/XsElement.h | 12 -- .../c++/six/source/SICommonXMLParser.cpp | 134 ++++++++---------- six/modules/c++/six/source/Utilities.cpp | 10 +- six/projects/csm/source/SIXSensorModel.cpp | 10 +- 22 files changed, 206 insertions(+), 202 deletions(-) diff --git a/UnitTest/sicd.cpp b/UnitTest/sicd.cpp index 6a141b7e12..e0b11986bd 100644 --- a/UnitTest/sicd.cpp +++ b/UnitTest/sicd.cpp @@ -79,4 +79,8 @@ TEST_CLASS(test_valid_six) { public: #include "six/modules/c++/six.sicd/unittests/test_valid_six.cpp" }; -} \ No newline at end of file +TEST_CLASS(test_valid_sixsicd) { public: +#include "six/modules/c++/six.sicd/unittests/test_valid_sixsicd.cpp" +}; + +} diff --git a/six/modules/c++/cphd/include/cphd/Types.h b/six/modules/c++/cphd/include/cphd/Types.h index 7dabacced7..51a53c1d4f 100644 --- a/six/modules/c++/cphd/include/cphd/Types.h +++ b/six/modules/c++/cphd/include/cphd/Types.h @@ -94,9 +94,9 @@ typedef six::MatchInformation MatchInformation; enum class Version { - v100, // {"1.0.0", xml::lite::Uri("urn:CPHD:1.0.0")}, - v101, // {"1.0.1", xml::lite::Uri("http://api.nsgreg.nga.mil/schema/cphd/1.0.1")}, - v110, // {"1.1.0", xml::lite::Uri("http://api.nsgreg.nga.mil/schema/cphd/1.1.0")} + v1_0_0, // {"1.0.0", xml::lite::Uri("urn:CPHD:1.0.0")}, + v1_0_1, // {"1.0.1", xml::lite::Uri("http://api.nsgreg.nga.mil/schema/cphd/1.0.1")}, + v1_1_0, // {"1.1.0", xml::lite::Uri("http://api.nsgreg.nga.mil/schema/cphd/1.1.0")} }; std::string to_string(Version); // "1.0.0", "1.0.1", "1.1.0" diff --git a/six/modules/c++/cphd/source/CPHDXMLControl.cpp b/six/modules/c++/cphd/source/CPHDXMLControl.cpp index c25350aa81..a6cc2628e7 100644 --- a/six/modules/c++/cphd/source/CPHDXMLControl.cpp +++ b/six/modules/c++/cphd/source/CPHDXMLControl.cpp @@ -124,9 +124,9 @@ std::unordered_map CPHDXMLControl::getVersionUriMap static std::map getVersionUriMap_() { static const std::map retval = { - {Version::v100, xml::lite::Uri("urn:CPHD:1.0.0")}, - {Version::v101, xml::lite::Uri("http://api.nsgreg.nga.mil/schema/cphd/1.0.1")}, - {Version::v110, xml::lite::Uri("http://api.nsgreg.nga.mil/schema/cphd/1.1.0")} + {Version::v1_0_0, xml::lite::Uri("urn:CPHD:1.0.0")}, + {Version::v1_0_1, xml::lite::Uri("http://api.nsgreg.nga.mil/schema/cphd/1.0.1")}, + {Version::v1_1_0, xml::lite::Uri("http://api.nsgreg.nga.mil/schema/cphd/1.1.0")} }; return retval; } @@ -231,9 +231,9 @@ std::string cphd::to_string(Version siddVersion) // Match existing version strings, see CPHDXMLControl::getVersionUriMap switch (siddVersion) { - case Version::v100: return "1.0.0"; - case Version::v101: return "1.0.1"; - case Version::v110: return "1.1.0"; + case Version::v1_0_0: return "1.0.0"; + case Version::v1_0_1: return "1.0.1"; + case Version::v1_1_0: return "1.1.0"; default: break; } throw std::logic_error("Unkown 'Version' value."); diff --git a/six/modules/c++/cphd/source/FileHeader.cpp b/six/modules/c++/cphd/source/FileHeader.cpp index bf7b716895..f818aaec15 100644 --- a/six/modules/c++/cphd/source/FileHeader.cpp +++ b/six/modules/c++/cphd/source/FileHeader.cpp @@ -34,7 +34,7 @@ namespace cphd static const char* getDefaultVersion() { - static const auto defaultVersion = to_string(Version::v101); + static const auto defaultVersion = to_string(Version::v1_0_1); return defaultVersion.c_str(); } const char* FileHeader::DEFAULT_VERSION = getDefaultVersion(); diff --git a/six/modules/c++/cphd/source/Metadata.cpp b/six/modules/c++/cphd/source/Metadata.cpp index 8b79b5835f..542f6407bd 100644 --- a/six/modules/c++/cphd/source/Metadata.cpp +++ b/six/modules/c++/cphd/source/Metadata.cpp @@ -80,15 +80,15 @@ void Metadata::setVersion(const std::string& version) { if (version == "1.0.0") { - setVersion(Version::v100); + setVersion(Version::v1_0_0); } else if (version == "1.0.1") { - setVersion(Version::v101); + setVersion(Version::v1_0_1); } else if (version == "1.1.0") { - setVersion(Version::v110); + setVersion(Version::v1_1_0); } else { diff --git a/six/modules/c++/six.sicd/unittests/test_valid_sixsicd.cpp b/six/modules/c++/six.sicd/unittests/test_valid_sixsicd.cpp index aabda2ff5f..b83d7c6aa7 100644 --- a/six/modules/c++/six.sicd/unittests/test_valid_sixsicd.cpp +++ b/six/modules/c++/six.sicd/unittests/test_valid_sixsicd.cpp @@ -23,7 +23,6 @@ #include -#include #include #include #include @@ -37,26 +36,27 @@ #include "TestCase.h" -namespace fs = std::filesystem; - static std::unique_ptr test_assert_round_trip(const std::string& testName, - const six::sicd::ComplexData& complexData, const std::vector* pSchemaPaths) + const six::sicd::ComplexData& complexData, const std::vector* pSchemaPaths) { auto strXML = six::sicd::Utilities::toXMLString(complexData, pSchemaPaths); TEST_ASSERT_FALSE(strXML.empty()); return six::sicd::Utilities::parseDataFromString(strXML, pSchemaPaths); } -inline static const six::UnmodeledS* get_Unmodeled(const six::sicd::ComplexData& complexData, const std::string& strVersion) +inline static const six::Unmodeled* get_Unmodeled(const six::sicd::ComplexData& complexData, const std::string& strVersion) { if (strVersion != "1.3.0") // Unmodeled added in SICD 1.3 { return nullptr; } - else + + if (has_value(complexData.errorStatistics->unmodeled)) { - return complexData.errorStatistics->Unmodeled.get(); + return &value(complexData.errorStatistics->unmodeled); } + + return nullptr; } static void test_createFakeComplexData_(const std::string& testName, const std::string& strVersion) @@ -83,18 +83,18 @@ TEST_CASE(test_createFakeComplexData) test_createFakeComplexData_(testName, "1.3.0"); } -static void test_assert_unmodeled_(const std::string& testName, const six::UnmodeledS& Unmodeled) +static void test_assert_unmodeled_(const std::string& testName, const six::Unmodeled& unmodeled) { - TEST_ASSERT_EQ(1.23, Unmodeled.Xrow); - TEST_ASSERT_EQ(4.56, Unmodeled.Ycol); - TEST_ASSERT_EQ(7.89, Unmodeled.XrowYcol); - - const auto& unmodeledDecor = Unmodeled.unmodeledDecorr; - TEST_ASSERT(has_value(unmodeledDecor)); - TEST_ASSERT_EQ(12.34, value(unmodeledDecor).Xrow.CorrCoefZero); - TEST_ASSERT_EQ(56.78, value(unmodeledDecor).Xrow.DecorrRate); - TEST_ASSERT_EQ(123.4, value(unmodeledDecor).Ycol.CorrCoefZero); - TEST_ASSERT_EQ(567.8, value(unmodeledDecor).Ycol.DecorrRate); + TEST_ASSERT_EQ(1.23, unmodeled.Xrow); + TEST_ASSERT_EQ(4.56, unmodeled.Ycol); + TEST_ASSERT_EQ(7.89, unmodeled.XrowYcol); + + TEST_ASSERT(has_value(unmodeled.unmodeledDecorr)); + auto&& unmodeledDecor = value(unmodeled.unmodeledDecorr); + TEST_ASSERT_EQ(12.34, value(unmodeledDecor.Xrow).corrCoefZero); + TEST_ASSERT_EQ(56.78, value(unmodeledDecor.Xrow).decorrRate); + TEST_ASSERT_EQ(123.4, value(unmodeledDecor.Ycol).corrCoefZero); + TEST_ASSERT_EQ(567.8, value(unmodeledDecor.Ycol).decorrRate); } static void test_assert(const std::string& testName, const six::sicd::ComplexData& complexData) { @@ -105,9 +105,9 @@ static void test_assert(const std::string& testName, const six::sicd::ComplexDat return; } TEST_ASSERT(errorStatistics.get() != nullptr); - auto Unmodeled = errorStatistics->Unmodeled; - TEST_ASSERT(Unmodeled.get() != nullptr); - test_assert_unmodeled_(testName, *Unmodeled); + auto&& unmodeled = errorStatistics->unmodeled; + TEST_ASSERT(has_value(unmodeled)); + test_assert_unmodeled_(testName, value(unmodeled)); // for SICD 1.3, also check the polarization type; this is set either in the fake data or scid130.xml const auto txRcvPolarizationProc = complexData.imageFormation->txRcvPolarizationProc; @@ -116,9 +116,9 @@ static void test_assert(const std::string& testName, const six::sicd::ComplexDat TEST_ASSERT_EQ(strTxRcvPolarizationProc,"OTHER_TxRcvPolarizationProc:OTHER_TxRcvPolarizationProc"); } -static void test_read_sicd_xml(const std::string& testName, const fs::path& path) +static void test_read_sicd_xml(const std::string& testName, const std::filesystem::path& path) { - const auto pathname = six::testing::getSampleXmlPath(fs::path("six.sicd") / "tests" / "sample_xml", path); + const auto pathname = six::testing::getSampleXmlPath(std::filesystem::path("six.sicd") / "tests" / "sample_xml", path); // NULL schemaPaths, no validation auto pComplexData = six::sicd::Utilities::parseDataFromFile(pathname, nullptr /*pSchemaPaths*/); diff --git a/six/modules/c++/six.sidd/include/six/sidd/DerivedData.h b/six/modules/c++/six.sidd/include/six/sidd/DerivedData.h index 4eee552631..ed4109a1a6 100644 --- a/six/modules/c++/six.sidd/include/six/sidd/DerivedData.h +++ b/six/modules/c++/six.sidd/include/six/sidd/DerivedData.h @@ -73,9 +73,9 @@ namespace sidd // SIDD 3.0.0 enum class Version { - v100, - v200, - v300, + v1_0_0, + v2_0_0, + v3_0_0, }; std::string to_string(Version); // "1.0.0", "2.0.0", "3.0.0" Version normalizeVersion(const std::string&); @@ -377,7 +377,7 @@ struct DerivedData : public Data static const char VENDOR_ID[]; bool equalTo(const Data& rhs) const override; - Version mVersion = Version::v100; // existing code + Version mVersion = Version::v1_0_0; // existing code six::sidd300::ISMVersion mISMVersion = six::sidd300::ISMVersion::current; // only for SIDD 3.0.0 }; } diff --git a/six/modules/c++/six.sidd/source/DerivedData.cpp b/six/modules/c++/six.sidd/source/DerivedData.cpp index 9e2930f358..7d07731b51 100644 --- a/six/modules/c++/six.sidd/source/DerivedData.cpp +++ b/six/modules/c++/six.sidd/source/DerivedData.cpp @@ -37,12 +37,12 @@ DerivedData::DerivedData(Version siddVersion, six::sidd300::ISMVersion ismVersio } DerivedData::DerivedData(Version siddVersion) : DerivedData(siddVersion, six::sidd300::get(six::sidd300::ISMVersion::current)) { - if (siddVersion == Version::v300) + if (siddVersion == Version::v3_0_0) { throw std::invalid_argument("Must use ISMVersion overload."); } } -DerivedData::DerivedData() : DerivedData(Version::v100) // existing code +DerivedData::DerivedData() : DerivedData(Version::v1_0_0) // existing code { } @@ -99,7 +99,7 @@ DateTime DerivedData::getCollectionStartDateTime() const const mem::ScopedCopyablePtr& DerivedData::getDisplayLUT() const { - if (mVersion == Version::v100) + if (mVersion == Version::v1_0_0) { if (display->remapInformation.get() == nullptr) { @@ -107,7 +107,7 @@ const mem::ScopedCopyablePtr& DerivedData::getDisplayLUT() const } return display->remapInformation->remapLUT; } - else if ((mVersion == Version::v200) || (mVersion == Version::v300)) + else if ((mVersion == Version::v2_0_0) || (mVersion == Version::v3_0_0)) { return nitfLUT; } @@ -191,7 +191,7 @@ void DerivedData::setSIDDVersion(Version siddVersion, six::sidd300::ISMVersion i } void DerivedData::setSIDDVersion(Version siddVersion) { - if (siddVersion == Version::v300) + if (siddVersion == Version::v3_0_0) { throw std::invalid_argument("Must use ISMVersion overload."); // TODO } diff --git a/six/modules/c++/six.sidd/source/DerivedXMLControl.cpp b/six/modules/c++/six.sidd/source/DerivedXMLControl.cpp index d6053ee705..1d843a6207 100644 --- a/six/modules/c++/six.sidd/source/DerivedXMLControl.cpp +++ b/six/modules/c++/six.sidd/source/DerivedXMLControl.cpp @@ -62,15 +62,15 @@ six::sidd::Version six::sidd::normalizeVersion(const std::string& strVersion) // SIDD 3.0.0 if (normalizedVersion == "100") { - return six::sidd::Version::v100; + return six::sidd::Version::v1_0_0; } if (normalizedVersion == "200") { - return six::sidd::Version::v200; + return six::sidd::Version::v2_0_0; } if (normalizedVersion == "300") { - return six::sidd::Version::v300; + return six::sidd::Version::v3_0_0; } if (normalizedVersion == "110") @@ -92,9 +92,9 @@ namespace sidd // Match "incoming" SIDD version strings; this is also what the XML expects, see normalizeVersion() switch (siddVersion) { - case Version::v100: return "1.0.0"; - case Version::v200: return "2.0.0"; - case Version::v300: return "3.0.0"; + case Version::v1_0_0: return "1.0.0"; + case Version::v2_0_0: return "2.0.0"; + case Version::v3_0_0: return "3.0.0"; default: break; } throw std::logic_error("Unkown 'Version' value."); @@ -330,15 +330,15 @@ DerivedXMLControl::getParser(Version normalizedVersion, std::optional(mLog); } - if (normalizedVersion == Version::v200) + if (normalizedVersion == Version::v2_0_0) { return std::make_unique(mLog); } - if (normalizedVersion == Version::v300) + if (normalizedVersion == Version::v3_0_0) { if (!ismVersion.has_value()) { diff --git a/six/modules/c++/six.sidd/source/DerivedXMLParser100.cpp b/six/modules/c++/six.sidd/source/DerivedXMLParser100.cpp index d9f5e4c6f7..afcd9aef95 100644 --- a/six/modules/c++/six.sidd/source/DerivedXMLParser100.cpp +++ b/six/modules/c++/six.sidd/source/DerivedXMLParser100.cpp @@ -34,7 +34,7 @@ namespace six { namespace sidd { -constexpr Version VERSION = Version::v100; +constexpr Version VERSION = Version::v1_0_0; const char SI_COMMON_URI[] = "urn:SICommon:0.1"; const char ISM_URI[] = "urn:us:gov:ic:ism"; inline static xml::lite::Uri getISMUri() diff --git a/six/modules/c++/six.sidd/source/DerivedXMLParser200.cpp b/six/modules/c++/six.sidd/source/DerivedXMLParser200.cpp index 9228dabd7d..e2b0fdc7e0 100644 --- a/six/modules/c++/six.sidd/source/DerivedXMLParser200.cpp +++ b/six/modules/c++/six.sidd/source/DerivedXMLParser200.cpp @@ -113,7 +113,7 @@ ProjectionType DerivedXMLParser200::getProjectionType(const xml::lite::Element& } -constexpr Version VERSION = Version::v200; +constexpr Version VERSION = Version::v2_0_0; const char SI_COMMON_URI[] = "urn:SICommon:1.0"; inline static xml::lite::Uri getISMUri() { diff --git a/six/modules/c++/six.sidd/source/DerivedXMLParser300.cpp b/six/modules/c++/six.sidd/source/DerivedXMLParser300.cpp index 7392a50d5d..c568e410ef 100644 --- a/six/modules/c++/six.sidd/source/DerivedXMLParser300.cpp +++ b/six/modules/c++/six.sidd/source/DerivedXMLParser300.cpp @@ -39,7 +39,7 @@ namespace six { namespace sidd { -constexpr Version VERSION = Version::v300; +constexpr Version VERSION = Version::v3_0_0; static const char SI_COMMON_URI[] = "urn:SICommon:1.0"; // There is a need to support two different versions of ISM with SIDD 3.0 :-( diff --git a/six/modules/c++/six.sidd/source/Utilities.cpp b/six/modules/c++/six.sidd/source/Utilities.cpp index c723af2dba..e4f4f1474b 100644 --- a/six/modules/c++/six.sidd/source/Utilities.cpp +++ b/six/modules/c++/six.sidd/source/Utilities.cpp @@ -690,7 +690,7 @@ static void initProductCreation(six::sidd::ProductCreation& productCreation, Ver productCreation.productCreationExtensions.push_back(parameter); productCreation.classification.securityExtensions.push_back(parameter); - if (siddVersion != Version::v300) + if (siddVersion != Version::v3_0_0) { productCreation.classification.desVersion = 234; // existing code } @@ -701,7 +701,7 @@ static void initProductCreation(six::sidd::ProductCreation& productCreation, Ver productCreation.classification.createDate = six::DateTime(); productCreation.classification.classification = "U"; - if (siddVersion == Version::v100) + if (siddVersion == Version::v1_0_0) { productCreation.classification.compliesWith.push_back("ICD-710"); } @@ -939,7 +939,7 @@ static void initExploitationFeatures(six::sidd::ExploitationFeatures& exFeatures polarization->txPolarization = six::PolarizationSequenceType::V; polarization->rcvPolarization = six::PolarizationSequenceType::OTHER; polarization->rcvPolarizationOffset = 1.37; - if (siddVersion == Version::v100) + if (siddVersion == Version::v1_0_0) { polarization->processed = six::BooleanType::IS_TRUE; } @@ -957,7 +957,7 @@ static void initExploitationFeatures(six::sidd::ExploitationFeatures& exFeatures collection.geometry->extensions.push_back(param); collection.phenomenology.reset(new six::sidd::Phenomenology()); - if (siddVersion != Version::v300) + if (siddVersion != Version::v3_0_0) { // [-180, 180) before SIDD 3.0 collection.phenomenology->shadow = six::AngleMagnitude(-1.5, 3.7); @@ -979,7 +979,7 @@ static void initExploitationFeatures(six::sidd::ExploitationFeatures& exFeatures exFeatures.product[0].north = 58.332; exFeatures.product[0].extensions.push_back(param); - if (siddVersion == Version::v200) + if (siddVersion == Version::v2_0_0) { exFeatures.product[0].ellipticity = 12.0; exFeatures.product[0].polarization.resize(1); @@ -1125,7 +1125,7 @@ static void populateData(six::sidd::DerivedData& siddData, const std::string& lu constexpr bool smallImage = true; const auto elementSize = static_cast(lutType == "Mono" ? 2 : 3); - if ((siddVersion == Version::v200) || (siddVersion == Version::v300)) + if ((siddVersion == Version::v2_0_0) || (siddVersion == Version::v3_0_0)) { // This will naturally get constructed in the course of 1.0.0 // Separate field in 2.0.0 @@ -1391,11 +1391,11 @@ static std::unique_ptr createFakeDerivedData_(const Version* pSiddV } std::unique_ptr Utilities::createFakeDerivedData(Version siddVersion) { - if (siddVersion == Version::v300) + if (siddVersion == Version::v3_0_0) { throw std::invalid_argument("Must use ISMVersion overload."); } - if (siddVersion == Version::v200) + if (siddVersion == Version::v2_0_0) { return createFakeDerivedData_(&siddVersion); } @@ -1403,7 +1403,7 @@ std::unique_ptr Utilities::createFakeDerivedData(Version siddVersio } std::unique_ptr Utilities::createFakeDerivedData(Version siddVersion, six::sidd300::ISMVersion ismVersion) { - if (siddVersion != Version::v300) + if (siddVersion != Version::v3_0_0) { return createFakeDerivedData(siddVersion); } diff --git a/six/modules/c++/six.sidd/unittests/test_valid_sixsidd.cpp b/six/modules/c++/six.sidd/unittests/test_valid_sixsidd.cpp index df4fc6b548..34a4cf8420 100644 --- a/six/modules/c++/six.sidd/unittests/test_valid_sixsidd.cpp +++ b/six/modules/c++/six.sidd/unittests/test_valid_sixsidd.cpp @@ -80,16 +80,19 @@ static std::unique_ptr test_assert_round_trip(const std: return six::sidd::Utilities::parseDataFromString(strXML, pSchemaPaths); } -inline static const six::UnmodeledS* get_Unmodeled(const six::sidd::DerivedData& derivedData, six::sidd::Version siddVersion) +inline static const six::Unmodeled* get_Unmodeled(const six::sidd::DerivedData& derivedData, six::sidd::Version siddVersion) { - if (siddVersion != six::sidd::Version::v300) // Unmodeled added in SIDD 3.0 + if (siddVersion != six::sidd::Version::v3_0_0) // Unmodeled added in SIDD 3.0 { return nullptr; } - else + + if (has_value(derivedData.errorStatistics->unmodeled)) { - return derivedData.errorStatistics->Unmodeled.get(); + return &value(derivedData.errorStatistics->unmodeled); } + + return nullptr; } static void test_createFakeDerivedData_(const std::string& testName, bool validate, @@ -108,17 +111,17 @@ static void test_createFakeDerivedData_(const std::string& testName, bool valida } TEST_CASE(test_createFakeDerivedData) { - test_createFakeDerivedData_(testName, false /*validate*/, six::sidd::Version::v200, six::sidd300::get(six::sidd300::ISMVersion::current)); + test_createFakeDerivedData_(testName, false /*validate*/, six::sidd::Version::v2_0_0, six::sidd300::get(six::sidd300::ISMVersion::current)); - test_createFakeDerivedData_(testName, false /*validate*/, six::sidd::Version::v300, six::sidd300::ISMVersion::v13); - test_createFakeDerivedData_(testName, false /*validate*/, six::sidd::Version::v300, six::sidd300::ISMVersion::v201609); + test_createFakeDerivedData_(testName, false /*validate*/, six::sidd::Version::v3_0_0, six::sidd300::ISMVersion::v13); + test_createFakeDerivedData_(testName, false /*validate*/, six::sidd::Version::v3_0_0, six::sidd300::ISMVersion::v201609); } TEST_CASE(test_createFakeDerivedData_validate) { - test_createFakeDerivedData_(testName, true /*validate*/, six::sidd::Version::v200, six::sidd300::get(six::sidd300::ISMVersion::current)); + test_createFakeDerivedData_(testName, true /*validate*/, six::sidd::Version::v2_0_0, six::sidd300::get(six::sidd300::ISMVersion::current)); - test_createFakeDerivedData_(testName, true /*validate*/, six::sidd::Version::v300, six::sidd300::ISMVersion::v13); - test_createFakeDerivedData_(testName, true /*validate*/, six::sidd::Version::v300, six::sidd300::ISMVersion::v201609); + test_createFakeDerivedData_(testName, true /*validate*/, six::sidd::Version::v3_0_0, six::sidd300::ISMVersion::v13); + test_createFakeDerivedData_(testName, true /*validate*/, six::sidd::Version::v3_0_0, six::sidd300::ISMVersion::v201609); } TEST_CASE(test_read_sidd200_no_LUT) @@ -134,18 +137,18 @@ TEST_CASE(test_read_sidd200_no_LUT) reader.load(pathname.string()); } -static void test_assert_unmodeled_(const std::string& testName, const six::UnmodeledS& Unmodeled) +static void test_assert_unmodeled_(const std::string& testName, const six::Unmodeled& unmodeled) { - TEST_ASSERT_EQ(1.23, Unmodeled.Xrow); - TEST_ASSERT_EQ(4.56, Unmodeled.Ycol); - TEST_ASSERT_EQ(7.89, Unmodeled.XrowYcol); + TEST_ASSERT_EQ(1.23, unmodeled.Xrow); + TEST_ASSERT_EQ(4.56, unmodeled.Ycol); + TEST_ASSERT_EQ(7.89, unmodeled.XrowYcol); - const auto& unmodeledDecor = Unmodeled.unmodeledDecorr; - TEST_ASSERT_TRUE(has_value(unmodeledDecor)); - TEST_ASSERT_EQ(12.34, value(unmodeledDecor).Xrow.CorrCoefZero); - TEST_ASSERT_EQ(56.78, value(unmodeledDecor).Xrow.DecorrRate); - TEST_ASSERT_EQ(123.4, value(unmodeledDecor).Ycol.CorrCoefZero); - TEST_ASSERT_EQ(567.8, value(unmodeledDecor).Ycol.DecorrRate); + TEST_ASSERT_TRUE(has_value(unmodeled.unmodeledDecorr)); + auto&& unmodeledDecor = value(unmodeled.unmodeledDecorr); + TEST_ASSERT_EQ(12.34, value(unmodeledDecor.Xrow).corrCoefZero); + TEST_ASSERT_EQ(56.78, value(unmodeledDecor.Xrow).decorrRate); + TEST_ASSERT_EQ(123.4, value(unmodeledDecor.Ycol).corrCoefZero); + TEST_ASSERT_EQ(567.8, value(unmodeledDecor.Ycol).decorrRate); } static void test_assert_unmodeled(const std::string& testName, const six::sidd::DerivedData& derivedData) { @@ -156,9 +159,9 @@ static void test_assert_unmodeled(const std::string& testName, const six::sidd:: return; } - auto Unmodeled = errorStatistics->Unmodeled; - TEST_ASSERT(Unmodeled.get() != nullptr); - test_assert_unmodeled_(testName, *Unmodeled); + auto unmodeled = errorStatistics->unmodeled; + TEST_ASSERT(has_value(unmodeled)); + test_assert_unmodeled_(testName, value(unmodeled)); } static void test_read_sidd_xml(const std::string& testName, const std::filesystem::path& path, diff --git a/six/modules/c++/six/include/six/ErrorStatistics.h b/six/modules/c++/six/include/six/ErrorStatistics.h index 86383dd1e2..beda61a7d5 100644 --- a/six/modules/c++/six/include/six/ErrorStatistics.h +++ b/six/modules/c++/six/include/six/ErrorStatistics.h @@ -255,7 +255,7 @@ struct IonoError * * Contains Unmodeled error statistics */ -struct UnmodeledS final +struct Unmodeled final { XsElement Xrow{ "Xrow" }; XsElement Ycol{ "Ycol" }; @@ -265,27 +265,31 @@ struct UnmodeledS final { struct Xrow_Ycol final { - double CorrCoefZero = 0.0; - double DecorrRate = 0.0; + XsElement corrCoefZero{ "CorrCoefZero" }; + XsElement decorrRate{ "DecorrRate" }; }; - Xrow_Ycol Xrow{}; - Xrow_Ycol Ycol{}; + XsElement Xrow{ "Xrow" }; + XsElement Ycol{ "Ycol" }; }; XsElement_minOccurs0 unmodeledDecorr{ "UnmodeledDecorr" }; }; -inline bool operator==(const UnmodeledS::Decorr& lhs, const UnmodeledS::Decorr& rhs) +inline bool operator==(const Unmodeled::Decorr& lhs, const Unmodeled::Decorr& rhs) { - return (lhs.Xrow.CorrCoefZero == rhs.Xrow.CorrCoefZero) - && (lhs.Xrow.DecorrRate == rhs.Xrow.DecorrRate) - && (lhs.Ycol.CorrCoefZero == rhs.Ycol.CorrCoefZero) - && (lhs.Ycol.DecorrRate == rhs.Ycol.DecorrRate) + auto&& lhs_Xrow = value(lhs.Xrow); + auto&& rhs_Xrow = value(rhs.Xrow); + auto&& lhs_Ycol = value(lhs.Ycol); + auto&& rhs_Ycol = value(rhs.Ycol); + return (lhs_Xrow.corrCoefZero == rhs_Xrow.corrCoefZero) + && (lhs_Xrow.decorrRate == rhs_Xrow.decorrRate) + && (lhs_Ycol.corrCoefZero == rhs_Ycol.corrCoefZero) + && (lhs_Ycol.decorrRate == rhs_Ycol.decorrRate) ; } -inline bool operator!=(const UnmodeledS::Decorr& lhs, const UnmodeledS::Decorr& rhs) +inline bool operator!=(const Unmodeled::Decorr& lhs, const Unmodeled::Decorr& rhs) { return !(lhs == rhs); } -inline bool operator==(const UnmodeledS& lhs, const UnmodeledS& rhs) +inline bool operator==(const Unmodeled& lhs, const Unmodeled& rhs) { return (lhs.Xrow == rhs.Xrow) && (lhs.Ycol == rhs.Ycol) @@ -293,7 +297,7 @@ inline bool operator==(const UnmodeledS& lhs, const UnmodeledS& rhs) && (lhs.unmodeledDecorr == rhs.unmodeledDecorr) ; } -inline bool operator!=(const UnmodeledS& lhs, const UnmodeledS& rhs) +inline bool operator!=(const Unmodeled& lhs, const Unmodeled& rhs) { return !(lhs == rhs); } @@ -406,7 +410,7 @@ struct ErrorStatistics * (Optional) Unmodeled * */ - mem::ScopedCopyablePtr Unmodeled; + XsElement_minOccurs0 unmodeled{ "Unmodeled" }; /*! * Additional parameters @@ -420,7 +424,7 @@ struct ErrorStatistics return (compositeSCP == rhs.compositeSCP) && (components == rhs.components) && (additionalParameters == rhs.additionalParameters) - && (Unmodeled == rhs.Unmodeled) + && (unmodeled == rhs.unmodeled) ; } bool operator!=(const ErrorStatistics& rhs) const diff --git a/six/modules/c++/six/include/six/SICommonXMLParser.h b/six/modules/c++/six/include/six/SICommonXMLParser.h index 4da3276e75..a332079814 100644 --- a/six/modules/c++/six/include/six/SICommonXMLParser.h +++ b/six/modules/c++/six/include/six/SICommonXMLParser.h @@ -224,6 +224,11 @@ struct SICommonXMLParser : public XMLParser // TODO: Can we combine this with parsePoly1D()? void parsePoly(const xml::lite::Element* polyXML, size_t xyzIdx, PolyXYZ& polyXYZ) const; + XMLElem createFromElement(const six::XsElement&, xml::lite::Element&) const; + + template + XMLElem newFromElement(const XsElement_minOccurs0& element, xml::lite::Element& parent) const; + private: const std::string mSICommonURI; }; diff --git a/six/modules/c++/six/include/six/XMLParser.h b/six/modules/c++/six/include/six/XMLParser.h index 647f551080..864da12432 100644 --- a/six/modules/c++/six/include/six/XMLParser.h +++ b/six/modules/c++/six/include/six/XMLParser.h @@ -311,6 +311,12 @@ struct XMLParser { return getOptional_reset(*parent, tag, obj); } + template + static XMLElem getOptional_reset(const xml::lite::Element& parent, XsElement_minOccurs0& obj) + { + return XmlLite::getOptional_reset(parent, obj); + } + static XMLElem getFirstAndOnly(const xml::lite::Element* parent, const std::string& tag); static xml::lite::Element& getFirstAndOnly(const xml::lite::Element& parent, const std::string& tag); diff --git a/six/modules/c++/six/include/six/XmlLite.h b/six/modules/c++/six/include/six/XmlLite.h index 033eaaf96c..8c898f1d01 100644 --- a/six/modules/c++/six/include/six/XmlLite.h +++ b/six/modules/c++/six/include/six/XmlLite.h @@ -274,6 +274,16 @@ struct XmlLite final } return retval; } + template + inline static xml::lite::Element* getOptional_reset(const xml::lite::Element& parent, XsElement_minOccurs0& obj) + { + auto retval = getOptional(parent, obj.tag()); + if (retval != nullptr) + { + obj = T{}; + } + return retval; + } static xml::lite::Element& getFirstAndOnly(const xml::lite::Element& parent, const std::string& tag); static xml::lite::Element& getFirstAndOnly(const xml::lite::Element& parent, const xml::lite::QName&); diff --git a/six/modules/c++/six/include/six/XsElement.h b/six/modules/c++/six/include/six/XsElement.h index 6601113966..26f3f7fa94 100644 --- a/six/modules/c++/six/include/six/XsElement.h +++ b/six/modules/c++/six/include/six/XsElement.h @@ -233,17 +233,5 @@ inline std::ostream& operator<<(std::ostream& os, const XsElement_minOccurs0& return os; } -// Existing code uses mem::ScopedCopyablePtr rather than std::optional -template -inline auto get(const XsElement_minOccurs0& o) -{ - return has_value(o) ? &(value(o)) : nullptr; -} -template -inline auto get(XsElement_minOccurs0& o) -{ - return has_value(o) ? &(value(o)) : nullptr; -} - } #endif // SIX_six_XsElement_h_INCLUDED_ diff --git a/six/modules/c++/six/source/SICommonXMLParser.cpp b/six/modules/c++/six/source/SICommonXMLParser.cpp index 3957d8d292..df319c8a1a 100644 --- a/six/modules/c++/six/source/SICommonXMLParser.cpp +++ b/six/modules/c++/six/source/SICommonXMLParser.cpp @@ -824,6 +824,21 @@ void SICommonXMLParser::parseRowColInts( } } +XMLElem SICommonXMLParser::createFromElement(const six::XsElement& elem, xml::lite::Element& parent) const +{ + return createDouble(elem.tag(), getSICommonURI(), elem.value(), &parent); +} + +template +XMLElem SICommonXMLParser::newFromElement(const XsElement_minOccurs0& elem, xml::lite::Element& parent) const +{ + if (!has_value(elem)) + { + return nullptr; + } + return newElement(&value(elem), elem.tag(), getSICommonURI(), &parent); +} + XMLElem SICommonXMLParser::convertErrorStatisticsToXML( const ErrorStatistics* errorStatistics, XMLElem parent) const @@ -936,33 +951,27 @@ XMLElem SICommonXMLParser::convertErrorStatisticsToXML( } } - #define xmlNewElement(name, uri, xml) auto name##XML = newElement(name, #name, uri, xml) - const auto Unmodeled = errorStatistics->Unmodeled.get(); - xmlNewElement(Unmodeled, getSICommonURI(), errorStatsXML); - if (UnmodeledXML != nullptr) + if (auto unmodeledXML = newFromElement(errorStatistics->unmodeled, *errorStatsXML)) { - #define xmlCreateElement_(name, xml) createDouble((name).tag(), getSICommonURI(), (name).value(), xml) - #define xmlCreateElement(name, elem) xmlCreateElement_(elem->name, elem ## XML); - xmlCreateElement(Xrow, Unmodeled); - xmlCreateElement(Ycol, Unmodeled); - xmlCreateElement(XrowYcol, Unmodeled); - - const auto pUnmodeledDecorr = get(Unmodeled->unmodeledDecorr); - auto UnmodeledDecorrXML = newElement(pUnmodeledDecorr, "UnmodeledDecorr", getSICommonURI(), UnmodeledXML); - if (UnmodeledDecorrXML != nullptr) + const auto& unmodeled = value(errorStatistics->unmodeled); + createFromElement(unmodeled.Xrow, *unmodeledXML); + createFromElement(unmodeled.Ycol, *unmodeledXML); + createFromElement(unmodeled.XrowYcol, *unmodeledXML); + + if (auto unmodeledDecorrXML = newFromElement(unmodeled.unmodeledDecorr, *unmodeledXML)) { - #define xmlCreateDouble_(name, value, elem) createDouble(#name, getSICommonURI(), (value).name, elem) - #define xmlCreateDouble(name, elem) xmlCreateDouble_(name, *elem, elem ## XML) - - const auto& Xrow = &(pUnmodeledDecorr->Xrow); - xmlNewElement(Xrow, getSICommonURI(), UnmodeledDecorrXML); - xmlCreateDouble(CorrCoefZero, Xrow); - xmlCreateDouble(DecorrRate, Xrow); - - const auto& Ycol = &(pUnmodeledDecorr->Ycol); - xmlNewElement(Ycol, getSICommonURI(), UnmodeledDecorrXML); - xmlCreateDouble(CorrCoefZero, Ycol); - xmlCreateDouble(DecorrRate, Ycol); + const auto new_Xrow_Ycol = [&](const XsElement& elem) + { + if (auto pXML = newElement(&elem, elem.tag(), getSICommonURI(), unmodeledDecorrXML)) + { + createFromElement(value(elem).corrCoefZero, *pXML); + createFromElement(value(elem).decorrRate, *pXML); + } + }; + + const auto& unmodeledDecorr = value(unmodeled.unmodeledDecorr); + new_Xrow_Ycol(unmodeledDecorr.Xrow); + new_Xrow_Ycol(unmodeledDecorr.Ycol); } } @@ -979,12 +988,12 @@ XMLElem SICommonXMLParser::convertErrorStatisticsToXML( } inline static XMLElem getOptionalUnmodeledDecorr(const xml::lite::Element& parent, - XsElement_minOccurs0& unmodeledDecorr) + XsElement_minOccurs0& unmodeledDecorr) { auto retval = XmlLite::getOptional(parent, unmodeledDecorr.tag()); if (retval != nullptr) { - unmodeledDecorr = UnmodeledS::Decorr{}; + unmodeledDecorr = Unmodeled::Decorr{}; } return retval; } @@ -1039,58 +1048,29 @@ void SICommonXMLParser::parseErrorStatisticsFromXML( } } - #define xml_getOptional_reset(xml, pRoot, name) getOptional_reset(xml, #name, (pRoot).name); - tmpElem = xml_getOptional_reset(errorStatsXML, errorStatistics, Unmodeled); // SIDD 3.0 - if (tmpElem != nullptr) - { - auto& Unmodeled = *(errorStatistics.Unmodeled); - - // macro to avoid copy/paste errors - #define parseDouble_getFirstAndOnly(elem, name, storage) parseDouble(getFirstAndOnly(elem, #name), (storage).name) - - six::getFirstAndOnly(parser(), *tmpElem, Unmodeled.Xrow); - six::getFirstAndOnly(parser(), *tmpElem, Unmodeled.Ycol); - six::getFirstAndOnly(parser(), *tmpElem, Unmodeled.XrowYcol); - - auto unmodeledDecorrXML = getOptionalUnmodeledDecorr(*tmpElem, Unmodeled.unmodeledDecorr); - if (unmodeledDecorrXML != nullptr) - { - auto& UnmodeledDecorr = *get(errorStatistics.Unmodeled->unmodeledDecorr); - - auto xrowXML = getFirstAndOnly(unmodeledDecorrXML, "Xrow"); - parseDouble_getFirstAndOnly(xrowXML, CorrCoefZero, UnmodeledDecorr.Xrow); - parseDouble_getFirstAndOnly(xrowXML, DecorrRate, UnmodeledDecorr.Xrow); - - auto ycolXML = getFirstAndOnly(unmodeledDecorrXML, "Ycol"); - parseDouble_getFirstAndOnly(ycolXML, CorrCoefZero, UnmodeledDecorr.Ycol); - parseDouble_getFirstAndOnly(ycolXML, DecorrRate, UnmodeledDecorr.Ycol); - } - } - - tmpElem = xml_getOptional_reset(errorStatsXML, errorStatistics, Unmodeled); // SIDD 3.0 - if (tmpElem != nullptr) + if (const auto pUnmodeledXML = getOptional_reset(errorStatsXML, (errorStatistics).unmodeled)) // SIDD 3.0 { - auto& Unmodeled = *(errorStatistics.Unmodeled); - - // macro to avoid copy/paste errors - #define parseDouble_getFirstAndOnly(elem, name, storage) parseDouble(getFirstAndOnly(elem, #name), (storage).name) - - six::getFirstAndOnly(parser(), *tmpElem, Unmodeled.Xrow); - six::getFirstAndOnly(parser(), *tmpElem, Unmodeled.Ycol); - six::getFirstAndOnly(parser(), *tmpElem, Unmodeled.XrowYcol); - - auto unmodeledDecorrXML = getOptionalUnmodeledDecorr(*tmpElem, Unmodeled.unmodeledDecorr); - if (unmodeledDecorrXML != nullptr) + auto&& unmodeledXML = *pUnmodeledXML; + + auto& unmodeled = value(errorStatistics.unmodeled); + six::getFirstAndOnly(parser(), unmodeledXML, unmodeled.Xrow); + six::getFirstAndOnly(parser(), unmodeledXML, unmodeled.Ycol); + six::getFirstAndOnly(parser(), unmodeledXML, unmodeled.XrowYcol); + + if (auto pUnmodeledDecorrXML = getOptionalUnmodeledDecorr(unmodeledXML, unmodeled.unmodeledDecorr)) { - auto& UnmodeledDecorr = *get(errorStatistics.Unmodeled->unmodeledDecorr); - - auto xrowXML = getFirstAndOnly(unmodeledDecorrXML, "Xrow"); - parseDouble_getFirstAndOnly(xrowXML, CorrCoefZero, UnmodeledDecorr.Xrow); - parseDouble_getFirstAndOnly(xrowXML, DecorrRate, UnmodeledDecorr.Xrow); - - auto ycolXML = getFirstAndOnly(unmodeledDecorrXML, "Ycol"); - parseDouble_getFirstAndOnly(ycolXML, CorrCoefZero, UnmodeledDecorr.Ycol); - parseDouble_getFirstAndOnly(ycolXML, DecorrRate, UnmodeledDecorr.Ycol); + const auto getFirstAndOnly_Xrow_Ycol = [&](XsElement& rc) + { + if (auto pXML = getFirstAndOnly(pUnmodeledDecorrXML, rc.tag())) + { + six::getFirstAndOnly(parser(), *pXML, value(rc).corrCoefZero); + six::getFirstAndOnly(parser(), *pXML, value(rc).decorrRate); + } + }; + + auto& unmodeledDecorr = value(unmodeled.unmodeledDecorr); + getFirstAndOnly_Xrow_Ycol(unmodeledDecorr.Xrow); + getFirstAndOnly_Xrow_Ycol(unmodeledDecorr.Ycol); } } diff --git a/six/modules/c++/six/source/Utilities.cpp b/six/modules/c++/six/source/Utilities.cpp index 0652332bae..3414e62017 100644 --- a/six/modules/c++/six/source/Utilities.cpp +++ b/six/modules/c++/six/source/Utilities.cpp @@ -837,12 +837,14 @@ void six::getErrors(const ErrorStatistics* errorStats, unmodeledErrorCovar(0, 1) = unmodeledErrorCovar(1, 0) = corr * (composite.rg * composite.az); } } - else if (const auto unmodeled = errorStats->Unmodeled.get()) + else if (has_value(errorStats->unmodeled)) { + const auto& unmodeled = value(errorStats->unmodeled); + auto& unmodeledErrorCovar = errors.mUnmodeledErrorCovar; - auto&& Xrow = unmodeled->Xrow; - auto&& Ycol = unmodeled->Ycol; - auto&& XrowYcol = unmodeled->XrowYcol; + auto&& Xrow = unmodeled.Xrow; + auto&& Ycol = unmodeled.Ycol; + auto&& XrowYcol = unmodeled.XrowYcol; // From Bill: Here is the mapping from the UnmodeledError to the 2x2 covariance matrix: // [0][0] = Xrow; [1][1] = Ycol; diff --git a/six/projects/csm/source/SIXSensorModel.cpp b/six/projects/csm/source/SIXSensorModel.cpp index 7ca6ed1c40..fef0c0547d 100644 --- a/six/projects/csm/source/SIXSensorModel.cpp +++ b/six/projects/csm/source/SIXSensorModel.cpp @@ -1176,11 +1176,13 @@ std::vector SIXSensorModel::getSIXUnmodeledError_(const six::ErrorStatis { if (pErrorStatistics != nullptr) { - if (auto pUnmodeled = pErrorStatistics->Unmodeled.get()) + if (has_value(pErrorStatistics->unmodeled)) { - auto&& Xrow = pUnmodeled->Xrow; - auto&& Ycol = pUnmodeled->Ycol; - auto&& XrowYcol = pUnmodeled->XrowYcol; + const auto& unmodeled = value(pErrorStatistics->unmodeled); + + auto&& Xrow = unmodeled.Xrow; + auto&& Ycol = unmodeled.Ycol; + auto&& XrowYcol = unmodeled.XrowYcol; // From Bill: Here is the mapping from the UnmodeledError to the 2x2 covariance matrix: // [0][0] = Xrow; [1][1] = Ycol;