Skip to content

Commit cf6f419

Browse files
J. Daniel SmithDan Smith
andauthored
update "coda-oss" and "nitro" (#434)
* add contact details * update .gitignore * not sure what to do with CMakeSettings.json * Create CMakeSettings.json * new/updated "docs" directory * update externals/nitro with latest from nitro repo * use in32_t, etc. instead of nitf::Int32_t * Revert "Merge branch 'feature/update_nitro' into develop/jdsmith" This reverts commit 52001ee, reversing changes made to aac9d2c. * Revert "Merge branch 'feature/use_standard_C_types' into develop/jdsmith" This reverts commit aac9d2c, reversing changes made to 89b7807. * use in32_t, etc. instead of nitf::Int32_t * update externals/nitro with latest from nitro repo * Revert "update externals/nitro with latest from nitro repo" This reverts commit 7eb2813. * update nitro/nrt * update "nitro" * nitf::Int8 -> int8_t * updates from coda-oss and nitro * update externals/nitro with latest from "main" * update externals/coda-oss with latest from "main" * don't want "docs" directory in externals/nitro * fix bad merge * ignore CMake-generated files * std::auto_ptr -> std::unique_ptr * need std::auto_ptr<> overloads for pre-generated Python wrapper code * provide std::auto_ptr "overloads" so that existing Python wrapper code continues to work w/o changes * impelement std::auto_ptr "overrides" * latest from nitro:main * update externals/nitro * update coda-oss * Create codeql-analysis.yml * update coda-oss with latest from "main" * update nitro with latest from "main" * Revert "Create codeql-analysis.yml" This reverts commit b261bbd. * fix nitf::Field to get rid of compiler errors * build externals/coda-oss by itself * build with Visual Studio 2019 (#358) * Revert "Create codeql-analysis.yml" This reverts commit 4388277. * build nitro projects in SIX solution * build "six" as a Visual Studio project * build "scene" with Visual Studio * build cphd with Visual Studio * build cphd03 with Visual Studio * build six.sicd with Visual Studio * build six.sidd with Visual Studio * buid six.convert with Visual Studio * add a GTest project * trying to get a unittest working * build XML_DATA_CONTENT * get a NITF unit-test working :-) * run all "six" unittests * fix dummy DEFAULT_SCHEMA_PATH * allow unit-tests to run in Visual Studio * run SIDD unit-tests from Visual Studio * set SIX_SCHEMA_PATH so unittest works * run SICD unittests in Visual Studio * build and run six.sicd unittests in Visual Studio * set NITF_PLUGIN_PATH for sicd_test_area_plane * build cphd03 unittests in Visual Studio * run remaining cphd03 unittests * fix build error introduced with VS2019 changes * build cphd unittests in Visual Studio * build & run remaining cphd unittests in Visual Studio * use c++11 (#359) * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * get rid of hard-coded paths with <filesystem> (#360) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * build crop_sicd in Visual Studio (#361) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * build crop_sicd * update coda-oss with latest from "main" * update coda-oss with latest from "main" (#362) * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from coda-oss "main" (#364) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * update coda-oss (#365) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * latest from coda-oss * another update to coda-oss (#366) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * latest from coda-oss * latest from coda-oss * Develop/update externals (#367) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * latest from coda-oss * latest from coda-oss * latest from coda-oss * latest from coda-oss (#368) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * latest from coda-oss * latest from coda-oss * latest from coda-oss * latest from "main" on coda-oss * latest from coda-oss (#369) * update coda-oss with latest from "main" * coda-oss updates to make TextEncoding part of the OutputStream * updates from coda-oss to make TextEncoding part of the OutputStream * fix StringStream() .ctor() * one more coda-oss update * latest from "main" on coda-oss: xml.lite updates for UTF-8 * restore changes lost in merge * latest from coda-oss * latest from coda-oss * latest from coda-oss * latest from "main" on coda-oss * use Filesystem.h from coda-oss instead of <filesystem> * use sys::Filesystem * update "nitro" and "coda-oss" (#370) * update "nitro" and "coda-oss" * Delete CMakeSettings.json * changeFileHeader() doesn't (yet) work in "externals" * preserve utf8 in XML text (#363) * pass io::Encoding::Utf8 to print() and prettyPrint() to preserve UTF-8 in output * store the value of xml::lite::MinidomParser::preserveCharacterData() so we can figure out the encoding * Don't want to set a dummy schema path to a directory that exists * add a unit-test for UTF-8 characters in "Classification" * fix isUnclassified() so it works for "NON CLASSIFIÉ / UNCLASSIFIED" * Revert "Merge branch 'main' into bugfix/preserve_UTF8_in_classified_field" This reverts commit 12534c9, reversing changes made to 02ce755. * account for coda-oss changes where TextEncoding is part of the OutputStream * get the right verson of Element.h * use new xml::lite to read/write XML in UTF-8 * be sure we can read-in and process UTF-8 from a NITF * assume UTF-8 on *ix and Windows-1252 on Windows * reduce "gratuatous" diffs for simpler merge request * one more unneeded diff * French -> Canada * latest from coda-oss * trying to get the test_valid_six unittest working on Linux * use .tar, not .tar.gz * add another unit-test (#371) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * remove some compiler warnings (#372) * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update externals (#373) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * use c++11 features (#374) * update "nitro" * update coda-oss and fix compiler errors * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest "nitro" (#375) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" (#376) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more use of C++11 (#377) * update "nitro" * update coda-oss and fix compiler errors * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * fix build errors from recent changes (#378) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * update "nitro" * update coda-oss and fix compiler errors * use "externals" from top-level "install" * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * build with simplified "externals" scheme * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * fix compiler errors from previous merge; mostly #include <thread> * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" * NULL -> nullptr (#379) * update "nitro" * update coda-oss and fix compiler errors * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * use filesystem::path and std::endian * less use of sys:: * NULL -> nullptr * latest from coda-oss (#381) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from develop/jdsmith (#382) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * update "nitro" * update coda-oss and fix compiler errors * use "externals" from top-level "install" * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * build with simplified "externals" scheme * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * fix compiler errors from previous merge; mostly #include <thread> * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" * use filesystem::path and std::endian * more filesystem from coda-oss * less use of sys:: * NULL -> nullptr * use .data() rather than &d[0] * mem::BufferView -> std::span * const std::span<>& doesn't make much sense * need make_span() overload for pointer+size * latest from "nitro" (#383) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from "nitro" * latest from develop/jdsmith (#385) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * update "nitro" * update coda-oss and fix compiler errors * use "externals" from top-level "install" * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * build with simplified "externals" scheme * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * fix compiler errors from previous merge; mostly #include <thread> * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" * use filesystem::path and std::endian * more filesystem from coda-oss * less use of sys:: * NULL -> nullptr * use .data() rather than &d[0] * mem::BufferView -> std::span * const std::span<>& doesn't make much sense * need make_span() overload for pointer+size * latest from "nitro" * std::endian * coda-oss now gives us std::endian * sys::Filesystem -> std::filesystem * don't need to explicitly call fs::path::string() in most cases * sys::Filesystem -> std::filesystem * fix build errors when using C++17 * latest from "nitro" (#387) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from "nitro" * std::endian * latest from "nitro" * latest changes from develop/jdsmith (#386) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * update "nitro" * update coda-oss and fix compiler errors * use "externals" from top-level "install" * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * build with simplified "externals" scheme * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * fix compiler errors from previous merge; mostly #include <thread> * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" * use filesystem::path and std::endian * more filesystem from coda-oss * less use of sys:: * NULL -> nullptr * use .data() rather than &d[0] * mem::BufferView -> std::span * const std::span<>& doesn't make much sense * need make_span() overload for pointer+size * latest from "nitro" * std::endian * coda-oss now gives us std::endian * sys::Filesystem -> std::filesystem * don't need to explicitly call fs::path::string() in most cases * sys::Filesystem -> std::filesystem * fix build errors when using C++17 * simplify access to some ImageSubheader values * newReadControl() returns a std::unique_ptr<> rather than a raw pointer * a singleton is much easier in C++11 * don't need to do manual locking in C++11 * use a template and some macros to dramatically simplify Enums * adjust macros for GCC, provide operators for SWIG * got the map entries wrong * make getIndices() a bit more robust * store a std::unique_ptr<> instead of a raw poniter * throw exceptions in getIndices() rather than assuming * use Enum<T>.toString() where possible rather than duplicating code * remove duplicate code converting from a string to Enum<T> * don't explicilty check for "SIDD" as that's already part of getDataType() * use std::string instead of char[] * reduce use of "delete[]" * less use of "SICD" and "SIDD", use six::DataType instead * simplify Region buffer management * reduce some explicit use of std::shared_ptr<> with std::make_shared and/or auto * more reduction in explicit use of std::shared_ptr * latest from "nitro" * simplify use of six::Region * reduce use of explicit .toString() * further reduction in explicit use of toString() * template specialiaton can't be inline with G++ * simplify cphd enum creation * reduce use of toString() with setAttribute() * update externals (#388) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from "nitro" * std::endian * latest from "nitro" * latest from "nitro" and "coda-oss" * reduce use of toString() (#389) * put common #includes for PCH in a single file * build check_valid_six * use EXIT_* rather than 0/1 * getting rid of std::auto_ptr<> because it's gone in C++17 * build all projects with C++17 * use <filesystem> to remove hard-coded paths * in Visual Studio, run check_valid_six with a pre-defined path * tweak plugin dir * can't have "check_valid_six" as a directory for *ix build * build crop_sicd * turn on /Wall, fix some warnings * C++17 generates more warnings that I don't want to fix right now * removed some compiler warnings from third-party code * comment-out use of C++17's <filesystem> * tweak project settings for consistency * unit-test for createFakeComplexData() * turn on compiler warnings * crank-up warning level * enable "Warnings as errors" * turn on all warnings (many #pragma'd away) * get rid of more warnings * adjust more #pragma's * update "nitro" * update coda-oss and fix compiler errors * update "nitro" * update coda-oss and fix compiler errors * use "externals" from top-level "install" * use int64_t, etc. instead of sys::Int64_T * mem::SharedPtr -> std::shared_ptr * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * use std::unique_ptr<[]> instead of mem::ScopedArray * use int32_t et. al. instead of sys::Int32_T * use std::byte (not quite working yet, but need to move code to a faster machine) * build with std::byte * build with simplified "externals" scheme * latest from "nitro" * match nitro -> nitf change * make_span() * use std::thread::hardware_concurrency() instead of sys::OS().getNumCPUs() * sys::Off_T -> ptrdiff_t * fix compiler errors from previous merge; mostly #include <thread> * Revert "sys::Off_T -> ptrdiff_t" This reverts commit aa22a37. * sys::Off_T -> int64_t; sys::SSize_T -> ptrdiff_t * latest from "coda-oss" * use filesystem::path and std::endian * more filesystem from coda-oss * less use of sys:: * NULL -> nullptr * use .data() rather than &d[0] * mem::BufferView -> std::span * const std::span<>& doesn't make much sense * need make_span() overload for pointer+size * latest from "nitro" * std::endian * coda-oss now gives us std::endian * sys::Filesystem -> std::filesystem * don't need to explicitly call fs::path::string() in most cases * sys::Filesystem -> std::filesystem * fix build errors when using C++17 * simplify access to some ImageSubheader values * newReadControl() returns a std::unique_ptr<> rather than a raw pointer * a singleton is much easier in C++11 * don't need to do manual locking in C++11 * use a template and some macros to dramatically simplify Enums * adjust macros for GCC, provide operators for SWIG * got the map entries wrong * make getIndices() a bit more robust * store a std::unique_ptr<> instead of a raw poniter * throw exceptions in getIndices() rather than assuming * use Enum<T>.toString() where possible rather than duplicating code * remove duplicate code converting from a string to Enum<T> * don't explicilty check for "SIDD" as that's already part of getDataType() * use std::string instead of char[] * reduce use of "delete[]" * less use of "SICD" and "SIDD", use six::DataType instead * simplify Region buffer management * reduce some explicit use of std::shared_ptr<> with std::make_shared and/or auto * more reduction in explicit use of std::shared_ptr * latest from "nitro" * simplify use of six::Region * reduce use of explicit .toString() * further reduction in explicit use of toString() * template specialiaton can't be inline with G++ * simplify cphd enum creation * reduce use of toString() with setAttribute() * latest from "nitro" and "coda-oss" * don't need catch(excep::Exception) ex.toString() as std::exception::what() now does the same thing * really only have two calls to setAttribute(): std::string and size_t * use macros to generate SIDD Enums * add operator<< for Enum<T> to avoid some explicit .toString() calls * add operator==(std::string) overload to redue need for .toString() * add operator<<() to redue need for .toString() * don't implmeent a bunch of six::toString() routines; they sholdn't be called anymore * further reduction in use of toString() * eliminate six::toString() template; just provide a few overloads instead * createSixString() which calls six::toString(t) instead of t.toString() * createSixString() overload with URI parameter * allow different strings (e.g., "1" and "+1") to map to the same value * put "Enum" support code in a separate file * there is now just one NOT_SET_VALUE * latest from coda-oss (#390) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from "nitro" * std::endian * latest from "nitro" * latest from "nitro" and "coda-oss" * latest from coda-oss * lost toString<nullptr>() * latest from coda-oss/main * want "std" augmented in this repo * latest from coda-oss and nitro (#391) * update "nitro" * update coda-oss and fix compiler errors * update coda-oss and nitro with less use of sys:: * unit-test paths are wrong for "externals" * update "nitro" to get SegmentMemorySource overloads * latest from "nitro" * match nitro -> nitf change * make_span() * latest from "coda-oss" * more filesystem from coda-oss * latest from "nitro" * std::endian * latest from "nitro" * latest from "nitro" and "coda-oss" * latest from coda-oss * lost toString<nullptr>() * latest from coda-oss/main * want "std" augmented in this repo * partial update from coda-oss/main * latest from coda-oss/main * update coda-oss with latest from https://github.com/mdaus/coda-oss * update externals/nitro/docs * latest from "nitro" * Revert "latest from "nitro"" This reverts commit 0b99300. * latest from nitro/master * ignore build/ directory * Revert "latest from nitro/master" This reverts commit e89da71. * update externals/nitro/docs * update "c", "java", "mex", and "python" directories -- but not "c++" * update other nitro top-level files ... everything except modules/c++ * VCXPROJ files from nitro * several changes from nitro/c++ ... hoping this builds. * fix build error on Linux * more changes from nitro/modules/c++ * fix IOStreamWriter ctor * more changes from nitro/modules/c++ * paths are wrong when in "externals" * remove externals/nitro/docs * slam in "main" * latest from coda-oss/main * adjust coda-oss for our usage * latest from nitro/main * std::span removed from "nitro" * need to redo C++17 * fix missing #include file * remove "nitro" files not needed in externals/nitro * paths are wrong in "externals" * Revert "remove "nitro" files not needed in externals/nitro" This reverts commit da30b96. * Revert "Revert "remove "nitro" files not needed in externals/nitro"" This reverts commit e69391b. * slam in externals as merging creates too many conflicts * merge brought back a deleted #include * add back "java" and "mex" * lates from coda-oss/main * latest from "nitro" * paths are wrong in "externals" * need to redo C++17 support * std::span -> gsl::span * Revert "std::span -> gsl::span" This reverts commit c10f233. * latest from coda-oss and nitro * these are the correct files from "master" * gsl::span -> std::span * get #includes right for PCH * didn't want this change * trigger build on GitHub * remove files that shouldn't have been committed * latest from coda-oss:master * latest from nitro::master * adjust to API changes in coda-oss/xml.lite * latest from coda-oss * latest from coda-oss * std::filesystem::path doesn't implicitly convert to std::string * more place where an explicit std::filesystem::path::string() call is needed * latest from "coda-oss" and "nitro" * latest from coda-oss * one more change from coda-oss * "nitro" changes to build with C90 instead of C99 * old C++11 compilers don't like template<template> * new TREs from "nitro" * std::shared_ptr<> doesn't have [] versions, only std::unique_ptr * build with older compilers * latest coda-oss changes * Update .gitignore from "nitro" * SWIG doesn't like "final" * SWIG doesn't like "final" * latest from coda_oss * latest from "nitro" Co-authored-by: Dan Smith <j.daniel.smith@mdaus.com>
1 parent 6b82651 commit cf6f419

61 files changed

Lines changed: 1289 additions & 540 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

externals/coda-oss/modules/c++/config/include/config/coda_oss_config.h.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#ifndef _CODA_OSS_CONFIG_H_
44
#define _CODA_OSS_CONFIG_H_
55

6+
/* these should no longer be needed */
67
#cmakedefine HAVE_PTHREAD_H @HAVE_PTHREAD_H@
78
#cmakedefine HAVE_EXECINFO_H @HAVE_EXECINFO_H@
89
#cmakedefine HAVE_CLOCK_GETTIME @HAVE_CLOCK_GETTIME@
@@ -11,12 +12,14 @@
1112
#cmakedefine HAVE_LOCALTIME_R @HAVE_LOCALTIME_R@
1213
#cmakedefine HAVE_GMTIME_R @HAVE_GMTIME_R@
1314
#cmakedefine HAVE_SETENV @HAVE_SETENV@
14-
#cmakedefine HAVE_POSIX_MEMALIGN @HAVE_POSIX_MEMALIGN@
15-
#cmakedefine HAVE_MEMALIGN @HAVE_MEMALIGN@
1615
#cmakedefine01 BIGENDIAN
1716
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
18-
#cmakedefine HAVE_ATTRIBUTE_NOINLINE @HAVE_ATTRIBUTE_NOINLINE@
17+
#cmakedefine HAVE_POSIX_MEMALIGN @HAVE_POSIX_MEMALIGN@
18+
#cmakedefine HAVE_MEMALIGN @HAVE_MEMALIGN@
1919
#cmakedefine HAVE_ATTRIBUTE_ALIGNED @HAVE_ATTRIBUTE_ALIGNED@
20+
#cmakedefine HAVE_ATTRIBUTE_NOINLINE @HAVE_ATTRIBUTE_NOINLINE@
21+
22+
/* still might need these ... for now */
2023
#cmakedefine CODA_EXPORT @CODA_EXPORT@
2124

2225
#endif /* _CODA_OSS_CONFIG_H_ */

externals/coda-oss/modules/c++/config/include/config/compiler_extensions.h

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,34 @@
1919
* see <http://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#ifndef CONFIG_COMPILER_EXTENSIONS
23-
#define CONFIG_COMPILER_EXTENSIONS
22+
#ifndef CODA_OSS_config_compiler_extentions_h_INCLUDED_
23+
#define CODA_OSS_config_compiler_extentions_h_INCLUDED_
24+
#pragma once
2425

2526
#include <config/coda_oss_config.h>
2627

27-
#ifdef HAVE_ATTRIBUTE_NOINLINE
28-
#define ATTRIBUTE_NOINLINE __attribute__((noinline))
29-
#else
30-
#define ATTRIBUTE_NOINLINE
31-
#endif
28+
#ifndef CODA_OSS_attribute_noinline_DEFINED_
29+
#define CODA_OSS_attribute_noinline_DEFINED_ 1
3230

33-
#ifdef HAVE_ATTRIBUTE_ALIGNED
34-
#define ATTRIBUTE_ALIGNED(x) __attribute__((aligned (x)))
35-
#else
36-
#define ATTRIBUTE_ALIGNED(X)
37-
#endif
31+
// https://stackoverflow.com/a/49468469/8877
32+
#if defined(__GNUC__)
33+
#define ATTRIBUTE_NOINLINE __attribute__((noinline))
34+
#elif defined(_MSC_VER)
35+
#define ATTRIBUTE_NOINLINE __declspec(noinline)
36+
#else
37+
#define ATTRIBUTE_NOINLINE
38+
#endif
39+
#endif // CODA_OSS_attribute_noinline_DEFINED_
3840

39-
#endif
41+
#ifndef CODA_OSS_attribute_aligned_DEFINED_
42+
#define CODA_OSS_attribute_aligned_DEFINED_ 1
43+
44+
#if defined(__GNUC__)
45+
// https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Variable-Attributes.html
46+
#define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x)))
47+
#else
48+
#define ATTRIBUTE_ALIGNED(X)
49+
#endif
50+
#endif // CODA_OSS_attribute_aligned_DEFINED_
51+
52+
#endif // CODA_OSS_config_compiler_extentions_h_INCLUDED_

externals/coda-oss/modules/c++/io/include/io/PipeStream.h

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,8 @@ namespace io
3939
* \brief captures the standard output from a pipe
4040
* and streams it to the specified location
4141
*/
42-
class PipeStream : InputStream
42+
struct PipeStream : InputStream
4343
{
44-
45-
public:
46-
4744
/*!
4845
* Constructor --
4946
* Streams data from a pipe when available
@@ -95,6 +92,9 @@ class PipeStream : InputStream
9592
virtual sys::SSize_T streamTo(OutputStream& soi,
9693
sys::SSize_T numBytes = IS_END);
9794

95+
PipeStream(const PipeStream&) = delete;
96+
PipeStream& operator=(const PipeStream&) = delete;
97+
9898
protected:
9999
/*!
100100
* \brief returns the requested size in bytes from the stream
@@ -104,13 +104,7 @@ class PipeStream : InputStream
104104

105105
sys::ExecPipe mExecPipe;
106106
mem::ScopedArray<char> mCharString;
107-
size_t mBufferSize;
108-
109-
private:
110-
111-
//! Noncopyable
112-
PipeStream(const PipeStream& );
113-
const PipeStream& operator=(const PipeStream& );
107+
size_t mBufferSize = DEFAULT_CHUNK_SIZE;
114108
};
115109

116110
}

externals/coda-oss/modules/c++/io/include/io/TempFile.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ namespace io
3232
* RAII object for a temporary file that gets deleted
3333
* upon object destruction
3434
*/
35-
class TempFile
35+
struct TempFile
3636
{
37-
public:
3837
/*!
3938
* Constructor for TempFile object. Provided a directory,
4039
* this will find a random, unused filename, and create a file
@@ -53,10 +52,11 @@ class TempFile
5352
{
5453
return mPathname;
5554
}
55+
56+
TempFile(const TempFile&) = delete;
57+
TempFile& operator=(const TempFile&) = delete;
58+
5659
private:
57-
// Noncopyable
58-
TempFile(const TempFile& );
59-
const TempFile& operator=(const TempFile& );
6060
const sys::OS mOS;
6161
const std::string mPathname;
6262
};

externals/coda-oss/modules/c++/logging/include/logging/Logger.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ namespace logging
4343
* Instances of the Logger class represent a single logging channel.
4444
* A Logger instance can log to several Handlers.
4545
*/
46-
class Logger : public Filterer
46+
struct Logger : public Filterer
4747
{
48-
49-
public:
5048
/*!
5149
* Constructs a Logger with an optional name
5250
* \param name (optional) Name of the logger
@@ -130,15 +128,13 @@ class Logger : public Filterer
130128
//! Removes all handlers
131129
void reset();
132130

133-
private:
134-
// Noncopyable
135131
// NOTE: It isn't currently safe to copy a logger because mHandlers isn't
136132
// a deep copy and you end up with a double delete (it's not using
137133
// smart pointers :o( ). If we really wanted to support a copy,
138134
// would need to decide if mHandlers should be deeply or shallowly
139135
// copied.
140-
Logger(const Logger& );
141-
Logger& operator=(const Logger& );
136+
Logger(const Logger&) = delete;
137+
Logger& operator=(const Logger&) = delete;
142138

143139
protected:
144140
void handle(const LogRecord* record);

externals/coda-oss/modules/c++/mem/include/mem/ScopedAlignedArray.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ namespace mem
3434
* \brief This class provides RAII for alignedAlloc() and alignedFree()
3535
*/
3636
template <class T>
37-
class ScopedAlignedArray
37+
struct ScopedAlignedArray
3838
{
39-
public:
4039
typedef T ElementType;
4140

4241
explicit ScopedAlignedArray(
@@ -91,11 +90,10 @@ namespace mem
9190
return array;
9291
}
9392

94-
private:
95-
// Noncopyable
96-
ScopedAlignedArray(const ScopedAlignedArray& );
97-
const ScopedAlignedArray& operator=(const ScopedAlignedArray& );
93+
ScopedAlignedArray(const ScopedAlignedArray&) = delete;
94+
ScopedAlignedArray& operator=(const ScopedAlignedArray&) = delete;
9895

96+
private:
9997
static
10098
T* allocate(size_t numElements, size_t alignment)
10199
{

externals/coda-oss/modules/c++/mem/include/mem/ScopedArray.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ namespace mem
3333
* It is based on boost::scoped_array.
3434
*/
3535
template <class T>
36-
class ScopedArray
37-
{
38-
public:
36+
struct ScopedArray
37+
{
3938
typedef T ElementType;
4039

4140
explicit ScopedArray(T* array = NULL) :
@@ -71,10 +70,8 @@ namespace mem
7170
return array;
7271
}
7372

74-
private:
75-
// Noncopyable
76-
ScopedArray(const ScopedArray& );
77-
const ScopedArray& operator=(const ScopedArray& );
73+
ScopedArray(const ScopedArray&) = delete;
74+
ScopedArray& operator=(const ScopedArray&) = delete;
7875

7976
private:
8077
T* mArray;

externals/coda-oss/modules/c++/mem/include/mem/ScratchMemory.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ class ScratchMemory
157157
return mNumBytesNeeded;
158158
}
159159

160-
private:
161-
ScratchMemory(const ScratchMemory&);
162-
ScratchMemory& operator=(const ScratchMemory&);
160+
ScratchMemory(const ScratchMemory&) = delete;
161+
ScratchMemory& operator=(const ScratchMemory&) = delete;
163162

163+
private:
164164
struct Segment
165165
{
166166
Segment(size_t numBytes, size_t numBuffers, size_t alignment, size_t offset);

externals/coda-oss/modules/c++/mem/include/mem/VectorOfPointers.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ namespace mem
3737
* \brief This class provides safe cleanup for vectors of pointers
3838
*/
3939
template <typename T>
40-
class VectorOfPointers
40+
struct VectorOfPointers
4141
{
42-
public:
4342
VectorOfPointers()
4443
{
4544
}
@@ -149,19 +148,16 @@ class VectorOfPointers
149148
return mValues.erase(first, last);
150149
}
151150

152-
private:
153-
// Noncopyable
154-
VectorOfPointers(const VectorOfPointers& );
155-
const VectorOfPointers& operator=(const VectorOfPointers& );
151+
VectorOfPointers(const VectorOfPointers&) = delete;
152+
VectorOfPointers& operator=(const VectorOfPointers&) = delete;
156153

157154
private:
158155
std::vector<T*> mValues;
159156
};
160157

161158
template <typename T>
162-
class VectorOfSharedPointers
159+
struct VectorOfSharedPointers
163160
{
164-
public:
165161
VectorOfSharedPointers()
166162
{
167163
}

externals/coda-oss/modules/c++/mem/unittests/test_scoped_copyable_ptr.cpp

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,34 @@
2020
*
2121
*/
2222

23+
#include <memory>
24+
2325
#include <mem/ScopedCopyablePtr.h>
2426

2527
#include "TestCase.h"
2628

2729
namespace
2830
{
29-
struct Foo
31+
struct Foo final
3032
{
31-
Foo()
32-
: val1(0),
33-
val2(0)
34-
{
35-
}
36-
37-
size_t val1;
38-
size_t val2;
33+
size_t val1 = 0;
34+
size_t val2 = 0;
3935
};
4036

41-
struct Bar
37+
struct Bar final
4238
{
43-
Bar()
44-
: val3(0)
45-
{
46-
}
47-
4839
mem::ScopedCopyablePtr<Foo> foo;
49-
size_t val3;
40+
size_t val3 = 0;
41+
};
42+
43+
struct Baz final
44+
{
45+
std::shared_ptr<Foo> pFoo;
46+
size_t val3 = 0;
5047
};
5148

52-
class AssignOnDestruct
49+
struct AssignOnDestruct final
5350
{
54-
public:
5551
AssignOnDestruct(size_t &ref, size_t finalVal) :
5652
mRef(ref),
5753
mFinalVal(finalVal)
@@ -92,6 +88,25 @@ TEST_CASE(testCopyConstructor)
9288
TEST_ASSERT_EQ(bar1.val3, 30);
9389
}
9490

91+
TEST_CASE(testSharedCopyConstructor)
92+
{
93+
// Initialize the values
94+
Baz b1;
95+
b1.pFoo.reset(new Foo());
96+
b1.pFoo->val1 = 10;
97+
b1.pFoo->val2 = 20;
98+
b1.val3 = 30;
99+
100+
// Show that memory is shared, not copied as with mem::ScopedCopyablePtr
101+
auto b2 = b1;
102+
b2.pFoo->val1 = 40;
103+
b2.pFoo->val2 = 50;
104+
b2.val3 = 60;
105+
TEST_ASSERT_EQ(b1.pFoo->val1, 40);
106+
TEST_ASSERT_EQ(b1.pFoo->val2, 50);
107+
TEST_ASSERT_EQ(b1.val3, 30);
108+
}
109+
95110
TEST_CASE(testAssignmentOperator)
96111
{
97112
// Initialize the values
@@ -117,6 +132,27 @@ TEST_CASE(testAssignmentOperator)
117132
TEST_ASSERT_EQ(bar1.val3, 30);
118133
}
119134

135+
TEST_CASE(testSharedAssignmentOperator)
136+
{
137+
// Initialize the values
138+
Baz b1;
139+
b1.pFoo.reset(new Foo());
140+
b1.pFoo->val1 = 10;
141+
b1.pFoo->val2 = 20;
142+
b1.val3 = 30;
143+
144+
Baz b2;
145+
b2 = b1;
146+
147+
// Show that memory is shared, not copied as with mem::ScopedCopyablePtr
148+
b2.pFoo->val1 = 40;
149+
b2.pFoo->val2 = 50;
150+
b2.val3 = 60;
151+
TEST_ASSERT_EQ(b1.pFoo->val1, 40);
152+
TEST_ASSERT_EQ(b1.pFoo->val2, 50);
153+
TEST_ASSERT_EQ(b1.val3, 30);
154+
}
155+
120156
TEST_CASE(testDestructor)
121157
{
122158
// When the ScopedCopyablePtr goes out of scope, it should delete the
@@ -167,7 +203,9 @@ TEST_CASE(testEqualityOperator)
167203
int main(int, char**)
168204
{
169205
TEST_CHECK(testCopyConstructor);
206+
TEST_CHECK(testSharedCopyConstructor);
170207
TEST_CHECK(testAssignmentOperator);
208+
TEST_CHECK(testSharedAssignmentOperator);
171209
TEST_CHECK(testDestructor);
172210
TEST_CHECK(testSyntax);
173211
TEST_CHECK(testEqualityOperator);

0 commit comments

Comments
 (0)