Skip to content

Commit

Permalink
Replace auxiliary::forget() with NOLINT comments
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Nov 10, 2023
1 parent 6aba6b8 commit 21ecbc9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 49 deletions.
33 changes: 14 additions & 19 deletions src/IO/ADIOS/ADIOS2IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3433,38 +3433,33 @@ ADIOS2IOHandler::flush(internal::ParsedFlushParams &flushParams)

#else // openPMD_HAVE_ADIOS2

namespace detail
{
template <typename... Args>
void forget(Args...)
{}
} // namespace detail

#if openPMD_HAVE_MPI
ADIOS2IOHandler::ADIOS2IOHandler(
std::string path,
Access at,
MPI_Comm comm,
json::TracingJSON a,
std::string b,
std::string c)
// NOLINTNEXTLINE(performance-unnecessary-value-param)
json::TracingJSON,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
std::string,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
std::string)
: AbstractIOHandler(std::move(path), at, comm)
{
detail::forget(a, b, c);
}
{}

#endif // openPMD_HAVE_MPI

ADIOS2IOHandler::ADIOS2IOHandler(
std::string path,
Access at,
json::TracingJSON a,
std::string b,
std::string c)
// NOLINTNEXTLINE(performance-unnecessary-value-param)
json::TracingJSON,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
std::string,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
std::string)
: AbstractIOHandler(std::move(path), at)
{
detail::forget(std::move(a), std::move(b), std::move(c));
}
{}

std::future<void> ADIOS2IOHandler::flush(internal::ParsedFlushParams &)
{
Expand Down
12 changes: 4 additions & 8 deletions src/IO/HDF5/HDF5IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2814,18 +2814,14 @@ std::future<void> HDF5IOHandler::flush(internal::ParsedFlushParams &)
return m_impl->flush();
}
#else
namespace detail
{
template <typename T>
void forget(T)
{}
} // namespace detail

HDF5IOHandler::HDF5IOHandler(
std::string path, Access at, json::TracingJSON config)
std::string path,
Access at,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[[maybe_unused]] json::TracingJSON config)
: AbstractIOHandler(std::move(path), at)
{
detail::forget(std::move(config));
throw std::runtime_error("openPMD-api built without HDF5 support");
}

Expand Down
19 changes: 9 additions & 10 deletions src/IO/HDF5/ParallelHDF5IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,27 +180,26 @@ ParallelHDF5IOHandlerImpl::~ParallelHDF5IOHandlerImpl()
}
}
#else
namespace detail
{
template <typename T>
void forget(T)
{}
} // namespace detail

#if openPMD_HAVE_MPI
ParallelHDF5IOHandler::ParallelHDF5IOHandler(
std::string path, Access at, MPI_Comm comm, json::TracingJSON config)
std::string path,
Access at,
MPI_Comm comm,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[[maybe_unused]] json::TracingJSON config)
: AbstractIOHandler(std::move(path), at, comm)
{
detail::forget(std::move(config));
throw std::runtime_error("openPMD-api built without HDF5 support");
}
#else
ParallelHDF5IOHandler::ParallelHDF5IOHandler(
std::string const &path, Access at, json::TracingJSON config)
std::string const &path,
Access at,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[[maybe_unused]] json::TracingJSON config)
: AbstractIOHandler(path, at)
{
detail::forget(std::move(config));
throw std::runtime_error(
"openPMD-api built without parallel support and without HDF5 support");
}
Expand Down
15 changes: 3 additions & 12 deletions src/IO/JSON/JSONIOHandlerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,16 @@ namespace
}
} // namespace

namespace detail
{
template <typename T>
void forget(T)
{}
} // namespace detail

JSONIOHandlerImpl::JSONIOHandlerImpl(
AbstractIOHandler *handler,
openPMD::json::TracingJSON config,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[[maybe_unused]] openPMD::json::TracingJSON config,
FileFormat format,
std::string originalExtension)
: AbstractIOHandlerImpl(handler)
, m_fileFormat{format}
, m_originalExtension{std::move(originalExtension)}
{
// Currently unused
detail::forget(std::move(config));
}
{}

JSONIOHandlerImpl::~JSONIOHandlerImpl() = default;

Expand Down

0 comments on commit 21ecbc9

Please sign in to comment.