Skip to content

Commit

Permalink
std::shared_ptr -> mem::SharedPtr for fewer diffs with "master"
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Smith committed Jan 19, 2021
1 parent e0f0fac commit 4131733
Show file tree
Hide file tree
Showing 35 changed files with 276 additions and 276 deletions.
14 changes: 7 additions & 7 deletions six/modules/c++/cphd/include/cphd/CPHDReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ class CPHDReader
* \param logger (Optional) Provide custom log
*/
// Provides access to wideband but doesn't read it
CPHDReader(std::shared_ptr<io::SeekableInputStream> inStream,
CPHDReader(mem::SharedPtr<io::SeekableInputStream> inStream,
size_t numThreads,
const std::vector<std::string>& schemaPaths =
std::vector<std::string>(),
std::shared_ptr<logging::Logger> logger =
std::shared_ptr<logging::Logger>());
mem::SharedPtr<logging::Logger> logger =
mem::SharedPtr<logging::Logger>());

/*
* \func CPHDReader constructor
Expand All @@ -75,8 +75,8 @@ class CPHDReader
size_t numThreads,
const std::vector<std::string>& schemaPaths =
std::vector<std::string>(),
std::shared_ptr<logging::Logger> logger =
std::shared_ptr<logging::Logger>());
mem::SharedPtr<logging::Logger> logger =
mem::SharedPtr<logging::Logger>());

//! Get parameter functions
size_t getNumChannels() const
Expand Down Expand Up @@ -156,9 +156,9 @@ class CPHDReader
/*
* Read in header, metadata, supportblock, pvpblock and wideband
*/
void initialize(std::shared_ptr<io::SeekableInputStream> inStream,
void initialize(mem::SharedPtr<io::SeekableInputStream> inStream,
size_t numThreads,
std::shared_ptr<logging::Logger> logger,
mem::SharedPtr<logging::Logger> logger,
const std::vector<std::string>& schemaPaths);
};
}
Expand Down
12 changes: 6 additions & 6 deletions six/modules/c++/cphd/include/cphd/CPHDWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DataWriter
* \param stream The seekable output stream to be written
* \param numThreads Number of threads for parallel processing
*/
DataWriter(std::shared_ptr<io::SeekableOutputStream> stream,
DataWriter(mem::SharedPtr<io::SeekableOutputStream> stream,
size_t numThreads);

/*
Expand All @@ -73,7 +73,7 @@ class DataWriter

protected:
//! Output stream of CPHD
std::shared_ptr<io::SeekableOutputStream> mStream;
mem::SharedPtr<io::SeekableOutputStream> mStream;
//! Number of threads for parallelism
const size_t mNumThreads;
};
Expand All @@ -95,7 +95,7 @@ struct DataWriterLittleEndian final : public DataWriter
* \param numThreads Number of threads for parallel processing
* \param scratchSize Size of buffer to be used for scratch space
*/
DataWriterLittleEndian(std::shared_ptr<io::SeekableOutputStream> stream,
DataWriterLittleEndian(mem::SharedPtr<io::SeekableOutputStream> stream,
size_t numThreads,
size_t scratchSize);

Expand Down Expand Up @@ -134,7 +134,7 @@ struct DataWriterBigEndian final : public DataWriter
* \param stream The seekable output stream to be written
* \param numThreads Number of threads for parallel processing
*/
DataWriterBigEndian(std::shared_ptr<io::SeekableOutputStream> stream,
DataWriterBigEndian(mem::SharedPtr<io::SeekableOutputStream> stream,
size_t numThreads);

/*
Expand Down Expand Up @@ -184,7 +184,7 @@ class CPHDWriter
*/
CPHDWriter(
const Metadata& metadata,
std::shared_ptr<io::SeekableOutputStream> stream,
mem::SharedPtr<io::SeekableOutputStream> stream,
const std::vector<std::string>& schemaPaths = std::vector<std::string>(),
size_t numThreads = 0,
size_t scratchSpaceSize = 4 * 1024 * 1024);
Expand Down Expand Up @@ -376,7 +376,7 @@ class CPHDWriter
//! schemas for XML validation
const std::vector<std::string> mSchemaPaths;
//! Output stream contains CPHD file
std::shared_ptr<io::SeekableOutputStream> mStream;
mem::SharedPtr<io::SeekableOutputStream> mStream;
};
}

4 changes: 2 additions & 2 deletions six/modules/c++/cphd/include/cphd/SupportBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class SupportBlock
* \param startSupport CPHD header keyword "SUPPORT_BLOCK_BYTE_OFFSET"
* \param sizeSupport CPHD header keyword "SUPPORT_BLOCK_SIZE"
*/
SupportBlock(std::shared_ptr<io::SeekableInputStream> inStream,
SupportBlock(mem::SharedPtr<io::SeekableInputStream> inStream,
const cphd::Data& data,
int64_t startSupport,
int64_t sizeSupport);
Expand Down Expand Up @@ -153,7 +153,7 @@ class SupportBlock
const SupportBlock& operator=(const SupportBlock& ) = delete;

private:
const std::shared_ptr<io::SeekableInputStream> mInStream;
const mem::SharedPtr<io::SeekableInputStream> mInStream;
cphd::Data mData;
const int64_t mSupportOffset; // offset in bytes to start of SupportBlock
const size_t mSupportSize; // total size in bytes of SupportBlock
Expand Down
4 changes: 2 additions & 2 deletions six/modules/c++/cphd/include/cphd/Wideband.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Wideband
* \param startWB CPHD header keyword "cphd_BYTE_OFFSET"
* \param sizeWB CPHD header keyword "cphd_DATA_SIZE"
*/
Wideband(std::shared_ptr<io::SeekableInputStream> inStream,
Wideband(mem::SharedPtr<io::SeekableInputStream> inStream,
const cphd::MetadataBase& metadata,
int64_t startWB,
int64_t sizeWB);
Expand Down Expand Up @@ -411,7 +411,7 @@ class Wideband
const Wideband& operator=(const Wideband&) = delete;

private:
const std::shared_ptr<io::SeekableInputStream> mInStream;
const mem::SharedPtr<io::SeekableInputStream> mInStream;
const cphd::MetadataBase& mMetadata; // pointer to data metadata
const int64_t mWBOffset; // offset in bytes to start of wideband
const size_t mWBSize; // total size in bytes of wideband
Expand Down
10 changes: 5 additions & 5 deletions six/modules/c++/cphd/source/CPHDReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@

namespace cphd
{
CPHDReader::CPHDReader(std::shared_ptr<io::SeekableInputStream> inStream,
CPHDReader::CPHDReader(mem::SharedPtr<io::SeekableInputStream> inStream,
size_t numThreads,
const std::vector<std::string>& schemaPaths,
std::shared_ptr<logging::Logger> logger)
mem::SharedPtr<logging::Logger> logger)
{
initialize(inStream, numThreads, logger, schemaPaths);
}

CPHDReader::CPHDReader(const std::string& fromFile,
size_t numThreads,
const std::vector<std::string>& schemaPaths,
std::shared_ptr<logging::Logger> logger)
mem::SharedPtr<logging::Logger> logger)
{
initialize(std::make_shared<io::FileInputStream>(fromFile),
numThreads, logger, schemaPaths);
}

void CPHDReader::initialize(std::shared_ptr<io::SeekableInputStream> inStream,
void CPHDReader::initialize(mem::SharedPtr<io::SeekableInputStream> inStream,
size_t numThreads,
std::shared_ptr<logging::Logger> logger,
mem::SharedPtr<logging::Logger> logger,
const std::vector<std::string>& schemaPaths)
{
mFileHeader.read(*inStream);
Expand Down
8 changes: 4 additions & 4 deletions six/modules/c++/cphd/source/CPHDWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

namespace cphd
{
DataWriter::DataWriter(std::shared_ptr<io::SeekableOutputStream> stream,
DataWriter::DataWriter(mem::SharedPtr<io::SeekableOutputStream> stream,
size_t numThreads) :
mStream(stream),
mNumThreads(numThreads == 0 ? std::thread::hardware_concurrency() : numThreads)
Expand All @@ -50,7 +50,7 @@ DataWriter::~DataWriter()
}

DataWriterLittleEndian::DataWriterLittleEndian(
std::shared_ptr<io::SeekableOutputStream> stream,
mem::SharedPtr<io::SeekableOutputStream> stream,
size_t numThreads,
size_t scratchSize) :
DataWriter(stream, numThreads),
Expand Down Expand Up @@ -84,7 +84,7 @@ void DataWriterLittleEndian::operator()(const std::byte* data,
}

DataWriterBigEndian::DataWriterBigEndian(
std::shared_ptr<io::SeekableOutputStream> stream, size_t numThreads) :
mem::SharedPtr<io::SeekableOutputStream> stream, size_t numThreads) :
DataWriter(stream, numThreads)
{
}
Expand All @@ -98,7 +98,7 @@ void DataWriterBigEndian::operator()(const std::byte* data,
}

CPHDWriter::CPHDWriter(const Metadata& metadata,
std::shared_ptr<io::SeekableOutputStream> outStream,
mem::SharedPtr<io::SeekableOutputStream> outStream,
const std::vector<std::string>& schemaPaths,
size_t numThreads,
size_t scratchSpaceSize) :
Expand Down
2 changes: 1 addition & 1 deletion six/modules/c++/cphd/source/SupportBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ SupportBlock::SupportBlock(const std::string& pathname,
initialize();
}

SupportBlock::SupportBlock(std::shared_ptr<io::SeekableInputStream> inStream,
SupportBlock::SupportBlock(mem::SharedPtr<io::SeekableInputStream> inStream,
const cphd::Data& data,
int64_t startSupport,
int64_t sizeSupport) :
Expand Down
2 changes: 1 addition & 1 deletion six/modules/c++/cphd/source/Wideband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Wideband::Wideband(const std::string& pathname,
initialize();
}

Wideband::Wideband(std::shared_ptr<io::SeekableInputStream> inStream,
Wideband::Wideband(mem::SharedPtr<io::SeekableInputStream> inStream,
const cphd::MetadataBase& metadata,
int64_t startWB,
int64_t sizeWB) :
Expand Down
14 changes: 7 additions & 7 deletions six/modules/c++/cphd03/include/cphd03/CPHDReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ class CPHDReader
public:
//! Constructor
// Provides access to wideband but doesn't read it
CPHDReader(std::shared_ptr<io::SeekableInputStream> inStream,
CPHDReader(mem::SharedPtr<io::SeekableInputStream> inStream,
size_t numThreads,
std::shared_ptr<logging::Logger> logger =
std::shared_ptr<logging::Logger>());
mem::SharedPtr<logging::Logger> logger =
mem::SharedPtr<logging::Logger>());

CPHDReader(const std::string& fromFile,
size_t numThreads,
std::shared_ptr<logging::Logger> logger =
std::shared_ptr<logging::Logger>());
mem::SharedPtr<logging::Logger> logger =
mem::SharedPtr<logging::Logger>());

size_t getNumChannels() const
{
Expand Down Expand Up @@ -130,9 +130,9 @@ class CPHDReader
std::unique_ptr<VBM> mVBM;
std::unique_ptr<cphd::Wideband> mWideband;

void initialize(std::shared_ptr<io::SeekableInputStream> inStream,
void initialize(mem::SharedPtr<io::SeekableInputStream> inStream,
size_t numThreads,
std::shared_ptr<logging::Logger> logger);
mem::SharedPtr<logging::Logger> logger);

};
}
Expand Down
4 changes: 2 additions & 2 deletions six/modules/c++/cphd03/include/cphd03/CPHDWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CPHDWriter
* Default is 4 MB
*/
CPHDWriter(const Metadata& metadata,
std::shared_ptr<io::SeekableOutputStream> stream,
mem::SharedPtr<io::SeekableOutputStream> stream,
size_t numThreads = 0,
size_t scratchSpaceSize = 4 * 1024 * 1024);

Expand Down Expand Up @@ -186,7 +186,7 @@ class CPHDWriter
const size_t mScratchSpaceSize;
const size_t mNumThreads;

std::shared_ptr<io::SeekableOutputStream> mStream;
mem::SharedPtr<io::SeekableOutputStream> mStream;

std::vector<const std::byte*> mCPHDData;
std::vector<const std::byte*> mVBMData;
Expand Down
10 changes: 5 additions & 5 deletions six/modules/c++/cphd03/source/CPHDReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@

namespace cphd03
{
CPHDReader::CPHDReader(std::shared_ptr<io::SeekableInputStream> inStream,
CPHDReader::CPHDReader(mem::SharedPtr<io::SeekableInputStream> inStream,
size_t numThreads,
std::shared_ptr<logging::Logger> logger)
mem::SharedPtr<logging::Logger> logger)
{
initialize(inStream, numThreads, logger);
}

CPHDReader::CPHDReader(const std::string& fromFile,
size_t numThreads,
std::shared_ptr<logging::Logger> logger)
mem::SharedPtr<logging::Logger> logger)
{
initialize(std::make_shared<io::FileInputStream>(fromFile),
numThreads, logger);
}

void CPHDReader::initialize(std::shared_ptr<io::SeekableInputStream> inStream,
void CPHDReader::initialize(mem::SharedPtr<io::SeekableInputStream> inStream,
size_t numThreads,
std::shared_ptr<logging::Logger> logger)
mem::SharedPtr<logging::Logger> logger)
{
mFileHeader.read(*inStream);

Expand Down
2 changes: 1 addition & 1 deletion six/modules/c++/cphd03/source/CPHDWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
namespace cphd03
{
CPHDWriter::CPHDWriter(const Metadata& metadata,
std::shared_ptr<io::SeekableOutputStream> stream,
mem::SharedPtr<io::SeekableOutputStream> stream,
size_t numThreads,
size_t scratchSpaceSize) :
mMetadata(metadata),
Expand Down
2 changes: 1 addition & 1 deletion six/modules/c++/cphd03/tests/print_cphd_header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int main(int argc, char** argv)
const std::string pathname(argv[1]);

// Set up a logger to log to the console
std::shared_ptr<logging::Logger> logger(logging::setupLogger(progname));
mem::SharedPtr<logging::Logger> logger(logging::setupLogger(progname));

// There are lots of ways we could print this information
// For now, just use the default ways each object knows to print itself
Expand Down
4 changes: 2 additions & 2 deletions six/modules/c++/samples/test_compare_sidd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@

namespace
{
std::shared_ptr<six::Data> readMetadata(const six::NITFReadControl& reader)
mem::SharedPtr<six::Data> readMetadata(const six::NITFReadControl& reader)
{
const six::Data* data = reader.getContainer()->getData(0);
return std::shared_ptr<six::Data>(data->clone());
return mem::SharedPtr<six::Data>(data->clone());
}

void readWideband(six::NITFReadControl& reader,
Expand Down
2 changes: 1 addition & 1 deletion six/modules/c++/six.sicd/tests/test_add_additional_des.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ bool addingNullSegmentWriterShouldThrow(const std::string& xmlPathname)
six::NITFWriteControl writer;
writer.initialize(container);

std::shared_ptr<nitf::SegmentWriter> segmentWriter;
mem::SharedPtr<nitf::SegmentWriter> segmentWriter;
try
{
writer.addAdditionalDES(segmentWriter);
Expand Down
2 changes: 1 addition & 1 deletion six/modules/c++/six.sicd/tests/test_streaming_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class Tester
const std::string mNormalPathname;
const EnsureFileCleanup mNormalFileCleanup;

std::shared_ptr<six::Container> mContainer;
mem::SharedPtr<six::Container> mContainer;
const types::RowCol<size_t> mDims;
std::vector<std::complex<DataTypeT> > mImage;
std::complex<DataTypeT>* const mImagePtr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class GeoTIFFWriteControl : public WriteControl
/*!
* Init the GeoTIFF writer. Throws if we are a SICD container
*/
virtual void initialize(std::shared_ptr<Container> container) override;
virtual void initialize(mem::SharedPtr<Container> container) override;

using WriteControl::save;

Expand Down
2 changes: 1 addition & 1 deletion six/modules/c++/six.sidd/source/GeoTIFFWriteControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ GeoTIFFWriteControl::GeoTIFFWriteControl()
tiff::Const::Type::ASCII,
Constants::GT_XML_TAG);
}
void GeoTIFFWriteControl::initialize(std::shared_ptr<Container> container)
void GeoTIFFWriteControl::initialize(mem::SharedPtr<Container> container)
{

if (container->getDataType() != DataType::DERIVED)
Expand Down
4 changes: 2 additions & 2 deletions six/modules/c++/six/include/six/ByteProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ByteProvider : public nitf::ByteProvider
* \param[out] options Options to populate
*/
static void populateOptions(
std::shared_ptr<Container> container,
mem::SharedPtr<Container> container,
size_t maxProductSize,
size_t numRowsPerBlock,
size_t numColsPerBlock,
Expand Down Expand Up @@ -159,7 +159,7 @@ class ByteProvider : public nitf::ByteProvider
* \param numColsPerBlock The number of columns per block. Only applies
* for SIDD. Defaults to no blocking.
*/
void initialize(std::shared_ptr<Container> container,
void initialize(mem::SharedPtr<Container> container,
const XMLControlRegistry& xmlRegistry,
const std::vector<std::string>& schemaPaths,
size_t maxProductSize,
Expand Down
2 changes: 1 addition & 1 deletion six/modules/c++/six/include/six/CompressedByteProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CompressedByteProvider : public nitf::CompressedByteProvider
* \param numColsPerBlock The number of columns per block. Only applies
* for SIDD. Defaults to no blocking.
*/
void initialize(std::shared_ptr<Container> container,
void initialize(mem::SharedPtr<Container> container,
const XMLControlRegistry& xmlRegistry,
const std::vector<std::string>& schemaPaths,
const std::vector<std::vector<size_t> >& bytesPerBlock,
Expand Down
Loading

0 comments on commit 4131733

Please sign in to comment.