Skip to content

Commit

Permalink
reduce use of explicit "new" (#497)
Browse files Browse the repository at this point in the history
* 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 "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 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"

* update "nitro" to get SegmentMemorySource overloads

* 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

* 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

* 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()

* 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

* 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"

* use filesystem::path and std::endian

* less use of sys::

* NULL -> nullptr

* 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

* #include <nitf/coda-oss.hpp> instead of sys/Conf.h to get stuff added to "std"

* remove files that shouldn't have been committed

* #define CODA_OSS_AUGMENT_std_namespace before #include <sys/Conf.h>

* #include <scene/sys_Conf.h> rather than <nitf/coda-oss.hpp>

* do a better job of being sure we have additional stuff in "std" from coda-oss

* no auto_ptr in C++17

* no std::auto_ptr in C++17

* mem::auto_ptr instead of std::auto_ptr for C++17

* fix a few more errors with building with C++17

* std::auto_ptr -> mem::auto_ptr for C++17

* old compilers don't like certain kinds of braced-initialization

* turn off some CA diagnostics from other code

* reduce use of explicit "new" and pointers in CPHDReader

* another "version" -> "strVersion"; added unit-test

* version -> strVersion to avoid conflicting with global "version"

* reduce use of explicit "new"

* use std::make_unique() instead of explicit "new"

* use a std::unique_ptr for storing an "owned" logger

* new Logger class to more easily manage logging configuration

* use new Logger class to reduce boiler-plate code

* use the new six::Logger class to reduce boilerplate logger code

* more use of six::Logger to manage logging

* more use of six::Logger to reduce boilerplate code

* simplify six::Logger

* fix G++ compiler errors

* switch remaining code to new six::Logger infrastructure

* build Logger.cpp w/CMake

* reduce use of explicit "new"

* sys::Uint32_T -> uint32_t

* mem::ScopedArray<T> -> std::unique_ptr<T[]>

Co-authored-by: Dan Smith <j.daniel.smith@mdaus.com>
  • Loading branch information
J. Daniel Smith and Dan Smith authored Nov 9, 2021
1 parent 80f110c commit bc12320
Show file tree
Hide file tree
Showing 54 changed files with 544 additions and 417 deletions.
19 changes: 9 additions & 10 deletions six/modules/c++/cphd/include/cphd/CPHDReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ namespace cphd
* Requires a valid CPHD file,and optional schemas
* for XML format verification
*/
class CPHDReader
struct CPHDReader final
{
public:
/*
* \func CPHDReader constructor
* \brief Construct CPHDReader from an input stream
Expand Down Expand Up @@ -81,22 +80,22 @@ class CPHDReader
//! Get parameter functions
size_t getNumChannels() const
{
return mMetadata->data.getNumChannels();
return mMetadata.data.getNumChannels();
}
//! 0-based channel number
size_t getNumVectors(size_t channel) const
{
return mMetadata->data.getNumVectors(channel);
return mMetadata.data.getNumVectors(channel);
}
//! 0-based channel number
size_t getNumSamples(size_t channel) const
{
return mMetadata->data.getNumSamples(channel);
return mMetadata.data.getNumSamples(channel);
}
//! returns total per complex sample (2, 4, or 8)
size_t getNumBytesPerSample() const
{
return mMetadata->data.getNumBytesPerSample();
return mMetadata.data.getNumBytesPerSample();
}

/*
Expand All @@ -122,12 +121,12 @@ class CPHDReader
//! Get metadata object
const Metadata& getMetadata() const
{
return *mMetadata;
return mMetadata;
}
//! Get per vector parameters
const PVPBlock& getPVPBlock() const
{
return *mPVPBlock;
return mPVPBlock;
}
//! Get signal data
const Wideband& getWideband() const
Expand All @@ -145,11 +144,11 @@ class CPHDReader
//! New cphd file header
FileHeader mFileHeader;
//! Metadata read in from CPHD file
std::unique_ptr<Metadata> mMetadata;
Metadata mMetadata;
//! Support Block book-keeping info read in from CPHD file
std::unique_ptr<SupportBlock> mSupportBlock;
//! Per Vector Parameter info read in from CPHD file
std::unique_ptr<PVPBlock> mPVPBlock;
PVPBlock mPVPBlock;
//! Signal block book-keeping info read in from CPHD file
std::unique_ptr<Wideband> mWideband;

Expand Down
5 changes: 2 additions & 3 deletions six/modules/c++/cphd/include/cphd/CPHDWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,8 @@ struct DataWriterLittleEndian final : public DataWriter


private:
// Size of scratch space
const size_t mScratchSize;
// Scratch space buffer
const std::unique_ptr<std::byte[]> mScratch;
std::vector<std::byte> mScratch;
};

/*
Expand Down Expand Up @@ -389,6 +387,7 @@ struct CPHDWriter

//! DataWriter object
std::unique_ptr<DataWriter> mDataWriter;
void initializeDataWriter();

// Book-keeping element
//! metadata information
Expand Down
25 changes: 20 additions & 5 deletions six/modules/c++/cphd/include/cphd/CPHDXMLControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@

#ifndef __CPHD_CPHD_XML_CONTROL_H__
#define __CPHD_CPHD_XML_CONTROL_H__
#pragma once

#include <memory>
#include <unordered_map>
#include <std/filesystem>
#include <vector>

#include <scene/sys_Conf.h>
#include <logging/Logger.h>
#include <xml/lite/Element.h>
#include <xml/lite/Document.h>
#include <cphd/CPHDXMLParser.h>
#include <cphd/Types.h>
#include <six/Logger.h>

namespace cphd
{
Expand All @@ -54,7 +57,7 @@ class CPHDXMLControl
CPHDXMLControl(logging::Logger* log = nullptr, bool ownLog = false);

//! Destructor
virtual ~CPHDXMLControl();
virtual ~CPHDXMLControl() = default;

/*
* \func setLogger
Expand All @@ -63,7 +66,15 @@ class CPHDXMLControl
* \param log provide logger object
* \param ownLog flag indicates if log should be deleted
*/
void setLogger(logging::Logger* log, bool ownLog = false);
template<typename TLogger>
void setLogger(TLogger&& logger)
{
mLogger.setLogger(std::forward<TLogger>(logger));
}
void setLogger(logging::Logger* logger, bool ownLog)
{
mLogger.setLogger(logger, ownLog);
}

/*!
* \func toXMLString
Expand Down Expand Up @@ -117,10 +128,14 @@ class CPHDXMLControl
virtual std::unique_ptr<Metadata> fromXML(
const xml::lite::Document* doc,
const std::vector<std::string>& schemaPaths = std::vector<std::string>());
virtual Metadata fromXML(const xml::lite::Document& doc,
const std::vector<std::filesystem::path>& schemaPaths = std::vector<std::filesystem::path>());


protected:
logging::Logger *mLog;
bool mOwnLog;
logging::Logger *mLog = nullptr;
bool mOwnLog = false;
six::Logger mLogger;

private:
//! \return Hardcoded version to uri mapping
Expand Down
2 changes: 1 addition & 1 deletion six/modules/c++/cphd/include/cphd/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace cphd
* This object contains all of the sub-blocks for CPHD.
*
*/
struct Metadata : MetadataBase
struct Metadata final : MetadataBase
{
//! Default constructor
//! Initializes CPHD version to default version specified in FileHeader
Expand Down
3 changes: 3 additions & 0 deletions six/modules/c++/cphd/include/cphd/PVPBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

namespace cphd
{
class FileHeader;
/*
* \struct AddedPVP
* \brief Template Specialization to get additional pvp
Expand Down Expand Up @@ -98,6 +99,7 @@ struct PVPBlock
* if provided number of bytes is not sufficient
*/
PVPBlock(const Pvp& pvp, const Data& data);
PVPBlock(const Metadata&);

/*!
* \func PVPBlock
Expand Down Expand Up @@ -323,6 +325,7 @@ struct PVPBlock
int64_t startPVP,
int64_t sizePVP,
size_t numThreads);
int64_t load(io::SeekableInputStream& inStream, const FileHeader&, size_t numThreads);

//! Equality operators
bool operator==(const PVPBlock& other) const
Expand Down
15 changes: 9 additions & 6 deletions six/modules/c++/cphd/include/cphd/SupportBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@

namespace cphd
{
class FileHeader;


/*
* \struct SupportBlock
*
* \brief This class contains information about the SupportBlock CPHD data.
*/
// Provides methods to read support block data from CPHD file/stream
class SupportBlock
struct SupportBlock final
{
public:
/*
* \func SupportBlock
*
Expand Down Expand Up @@ -80,6 +81,8 @@ class SupportBlock
const cphd::Data& data,
int64_t startSupport,
int64_t sizeSupport);
SupportBlock(std::shared_ptr<io::SeekableInputStream> inStream,
const cphd::Data& data, const FileHeader&);

// Noncopyable
SupportBlock(const SupportBlock&) = delete;
Expand Down Expand Up @@ -138,12 +141,12 @@ class SupportBlock
// Same as above but allocates the memory
void read(const std::string& id,
size_t numThreads,
mem::ScopedArray<sys::ubyte>& data) const;
std::unique_ptr<sys::ubyte[]>& data) const;
void read(const std::string& id,
size_t numThreads,
std::unique_ptr<std::byte[]>& data) const
{
mem::ScopedArray<sys::ubyte> data_;
std::unique_ptr<sys::ubyte[]> data_;
read(id, numThreads, data_);
data.reset(reinterpret_cast<std::byte*>(data_.release()));
}
Expand All @@ -161,11 +164,11 @@ class SupportBlock
*
*/
void readAll(size_t numThreads,
mem::ScopedArray<sys::ubyte>& data) const;
std::unique_ptr<sys::ubyte[]>& data) const;
void readAll(size_t numThreads,
std::unique_ptr<std::byte[]>& data) const
{
mem::ScopedArray<sys::ubyte> data_;
std::unique_ptr<sys::ubyte[]> data_;
readAll(numThreads, data_);
data.reset(reinterpret_cast<std::byte*>(data_.release()));
}
Expand Down
13 changes: 7 additions & 6 deletions six/modules/c++/cphd/include/cphd/Wideband.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,16 @@

namespace cphd
{
class FileHeader;

/*
* \class Wideband
* \brief Information about the wideband CPHD data
*/
// It contains the cphd::Data structure (for channel and vector sizes).
// Provides methods read wideband data from CPHD file/stream
class Wideband
struct Wideband final
{
public:
static const size_t ALL;

/*!
Expand Down Expand Up @@ -211,15 +212,15 @@ class Wideband
size_t firstSample,
size_t lastSample,
size_t numThreads,
mem::ScopedArray<sys::ubyte>& data) const;
std::unique_ptr<sys::ubyte[]>& data) const;
std::unique_ptr<std::byte[]>read(size_t channel,
size_t firstVector,
size_t lastVector,
size_t firstSample,
size_t lastSample,
size_t numThreads) const
{
mem::ScopedArray<sys::ubyte> data;
std::unique_ptr<sys::ubyte[]> data;
read(channel, firstVector, lastVector, firstSample, lastSample, numThreads, data);

return std::unique_ptr<std::byte[]>(reinterpret_cast<std::byte*>(data.release()));
Expand All @@ -238,10 +239,10 @@ class Wideband
* \throw except::Exception If BufferView memory allocated is insufficient
*/
// Same as above for compressed Signal Array
void read(size_t channel, mem::ScopedArray<sys::ubyte>& data) const;
void read(size_t channel, std::unique_ptr<sys::ubyte[]>& data) const;
void read(size_t channel, std::unique_ptr<std::byte[]>& data) const
{
mem::ScopedArray<sys::ubyte> data_;
std::unique_ptr<sys::ubyte[]> data_;
read(channel, data_);
data.reset(reinterpret_cast<std::byte*>(data_.release()));
}
Expand Down
15 changes: 7 additions & 8 deletions six/modules/c++/cphd/source/ByteSwap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <cphd/ByteSwap.h>

#include <string>
#include <std/memory>

#include <sys/Conf.h>
#include <mt/ThreadPlanner.h>
Expand Down Expand Up @@ -195,13 +196,12 @@ void byteSwapAndPromote(const void* input,
startRow,
numRowsThisThread))
{
std::unique_ptr<sys::Runnable> scaler(
new ByteSwapAndPromoteRunnable<InT>(
auto scaler = std::make_unique<ByteSwapAndPromoteRunnable<InT>>(
input,
startRow,
numRowsThisThread,
dims.col,
output));
output);
threads.createThread(std::move(scaler));
}

Expand Down Expand Up @@ -233,13 +233,13 @@ void byteSwapAndScale(const void* input,
startRow,
numRowsThisThread))
{
std::unique_ptr<sys::Runnable> scaler(new ByteSwapAndScaleRunnable<InT>(
auto scaler = std::make_unique<ByteSwapAndScaleRunnable<InT>>(
input,
startRow,
numRowsThisThread,
dims.col,
scaleFactors,
output));
output);
threads.createThread(std::move(scaler));
}

Expand Down Expand Up @@ -273,12 +273,11 @@ void byteSwap(void* buffer,
startElement,
numElementsThisThread))
{
std::unique_ptr<sys::Runnable> thread(new ByteSwapRunnable(
auto thread = std::make_unique<ByteSwapRunnable>(
buffer,
elemSize,
startElement,
numElementsThisThread));

numElementsThisThread);
threads.createThread(std::move(thread));
}
threads.joinAll();
Expand Down
Loading

0 comments on commit bc12320

Please sign in to comment.