Update headers to use #pragma once

This commit is contained in:
Alexander Kremer
2022-11-23 17:46:31 +00:00
committed by Michael Legleux
parent 7bb567761c
commit bf217345ae
33 changed files with 35 additions and 143 deletions

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_APP_REPORTING_BACKENDFACTORY_H_INCLUDED #pragma once
#define RIPPLE_APP_REPORTING_BACKENDFACTORY_H_INCLUDED
#include <backend/BackendInterface.h> #include <backend/BackendInterface.h>
#include <backend/CassandraBackend.h> #include <backend/CassandraBackend.h>
@@ -42,5 +41,3 @@ make_Backend(boost::asio::io_context& ioc, clio::Config const& config)
return backend; return backend;
} }
} // namespace Backend } // namespace Backend
#endif // RIPPLE_REPORTING_BACKEND_FACTORY

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_APP_REPORTING_BACKENDINTERFACE_H_INCLUDED #pragma once
#define RIPPLE_APP_REPORTING_BACKENDINTERFACE_H_INCLUDED
#include <ripple/ledger/ReadView.h> #include <ripple/ledger/ReadView.h>
#include <backend/DBHelpers.h> #include <backend/DBHelpers.h>
@@ -643,4 +642,3 @@ private:
} // namespace Backend } // namespace Backend
using BackendInterface = Backend::BackendInterface; using BackendInterface = Backend::BackendInterface;
#endif

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_APP_REPORTING_CASSANDRABACKEND_H_INCLUDED #pragma once
#define RIPPLE_APP_REPORTING_CASSANDRABACKEND_H_INCLUDED
#include <ripple/basics/base_uint.h> #include <ripple/basics/base_uint.h>
#include <backend/BackendInterface.h> #include <backend/BackendInterface.h>
@@ -1258,4 +1257,3 @@ public:
}; };
} // namespace Backend } // namespace Backend
#endif

View File

@@ -1,5 +1,4 @@
#ifndef CLIO_BACKEND_DBHELPERS_H_INCLUDED #pragma once
#define CLIO_BACKEND_DBHELPERS_H_INCLUDED
#include <ripple/basics/Log.h> #include <ripple/basics/Log.h>
#include <ripple/basics/StringUtilities.h> #include <ripple/basics/StringUtilities.h>
@@ -181,4 +180,3 @@ uint256ToString(ripple::uint256 const& uint)
} }
static constexpr std::uint32_t rippleEpochStart = 946684800; static constexpr std::uint32_t rippleEpochStart = 946684800;
#endif

View File

@@ -1,5 +1,4 @@
#ifndef CLIO_SIMPLECACHE_H_INCLUDED #pragma once
#define CLIO_SIMPLECACHE_H_INCLUDED
#include <ripple/basics/base_uint.h> #include <ripple/basics/base_uint.h>
#include <ripple/basics/hardened_hash.h> #include <ripple/basics/hardened_hash.h>
@@ -78,4 +77,3 @@ public:
}; };
} // namespace Backend } // namespace Backend
#endif

View File

@@ -1,5 +1,5 @@
#ifndef CLIO_TYPES_H_INCLUDED #pragma once
#define CLIO_TYPES_H_INCLUDED
#include <ripple/basics/base_uint.h> #include <ripple/basics/base_uint.h>
#include <ripple/protocol/AccountID.h> #include <ripple/protocol/AccountID.h>
#include <optional> #include <optional>
@@ -89,4 +89,3 @@ constexpr ripple::uint256 lastKey{
constexpr ripple::uint256 hi192{ constexpr ripple::uint256 hi192{
"0000000000000000000000000000000000000000000000001111111111111111"}; "0000000000000000000000000000000000000000000000001111111111111111"};
} // namespace Backend } // namespace Backend
#endif

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_APP_CONFIG_H_INCLUDED #pragma once
#define RIPPLE_APP_CONFIG_H_INCLUDED
#include <config/detail/Helpers.h> #include <config/detail/Helpers.h>
@@ -385,5 +384,3 @@ public:
}; };
} // namespace clio } // namespace clio
#endif // RIPPLE_APP_CONFIG_H_INCLUDED

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_APP_CONFIG_DETAIL_H_INCLUDED #pragma once
#define RIPPLE_APP_CONFIG_DETAIL_H_INCLUDED
#include <optional> #include <optional>
#include <queue> #include <queue>
@@ -144,5 +143,3 @@ typeName<double>()
} }
}; // namespace clio::detail }; // namespace clio::detail
#endif // RIPPLE_APP_CONFIG_DETAIL_H_INCLUDED

View File

@@ -1,5 +1,5 @@
#ifndef RIPPLE_APP_REPORTING_ETLHELPERS_H_INCLUDED #pragma once
#define RIPPLE_APP_REPORTING_ETLHELPERS_H_INCLUDED
#include <ripple/basics/base_uint.h> #include <ripple/basics/base_uint.h>
#include <condition_variable> #include <condition_variable>
#include <mutex> #include <mutex>
@@ -171,5 +171,3 @@ getMarkers(size_t numMarkers)
} }
return markers; return markers;
} }
#endif // RIPPLE_APP_REPORTING_ETLHELPERS_H_INCLUDED

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_APP_REPORTING_ETLSOURCE_H_INCLUDED #pragma once
#define RIPPLE_APP_REPORTING_ETLSOURCE_H_INCLUDED
#include <backend/BackendInterface.h> #include <backend/BackendInterface.h>
#include <config/Config.h> #include <config/Config.h>
@@ -704,5 +703,3 @@ private:
bool bool
execute(Func f, uint32_t ledgerSequence); execute(Func f, uint32_t ledgerSequence);
}; };
#endif

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_APP_REPORTING_PROBINGETLSOURCE_H_INCLUDED #pragma once
#define RIPPLE_APP_REPORTING_PROBINGETLSOURCE_H_INCLUDED
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/beast/core.hpp> #include <boost/beast/core.hpp>
@@ -92,5 +91,3 @@ private:
ETLSourceHooks ETLSourceHooks
make_PlainHooks() noexcept; make_PlainHooks() noexcept;
}; };
#endif

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_APP_REPORTING_REPORTINGETL_H_INCLUDED #pragma once
#define RIPPLE_APP_REPORTING_REPORTINGETL_H_INCLUDED
#include <ripple/ledger/ReadView.h> #include <ripple/ledger/ReadView.h>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
@@ -395,5 +394,3 @@ public:
return now - (rippleEpochStart + closeTime); return now - (rippleEpochStart + closeTime);
} }
}; };
#endif

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_UTIL_LOGGER_H #pragma once
#define RIPPLE_UTIL_LOGGER_H
#include <boost/algorithm/string/predicate.hpp> #include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
@@ -253,5 +252,3 @@ public:
}; };
}; // namespace clio }; // namespace clio
#endif // RIPPLE_UTIL_LOGGER_H

View File

@@ -1,5 +1,4 @@
#ifndef CLIO_BUILD_INFO_H #pragma once
#define CLIO_BUILD_INFO_H
#include <string> #include <string>
@@ -12,5 +11,3 @@ std::string const&
getClioFullVersionString(); getClioFullVersionString();
} // namespace Build } // namespace Build
#endif // CLIO_BUILD_INFO_H

View File

@@ -1,5 +1,4 @@
#ifndef RPC_COUNTERS_H #pragma once
#define RPC_COUNTERS_H
#include <boost/json.hpp> #include <boost/json.hpp>
#include <chrono> #include <chrono>
@@ -53,5 +52,3 @@ public:
}; };
} // namespace RPC } // namespace RPC
#endif // RPC_COUNTERS_H

View File

@@ -1,5 +1,4 @@
#ifndef REPORTING_RPC_ERRORS_H_INCLUDED #pragma once
#define REPORTING_RPC_ERRORS_H_INCLUDED
#include <ripple/protocol/ErrorCodes.h> #include <ripple/protocol/ErrorCodes.h>
@@ -236,5 +235,3 @@ makeError(
std::optional<std::string_view> customMessage = std::nullopt); std::optional<std::string_view> customMessage = std::nullopt);
} // namespace RPC } // namespace RPC
#endif // REPORTING_RPC_ERRORS_H_INCLUDED

View File

@@ -1,5 +1,4 @@
#ifndef REPORTING_HANDLERS_H_INCLUDED #pragma once
#define REPORTING_HANDLERS_H_INCLUDED
#include <rpc/RPC.h> #include <rpc/RPC.h>
@@ -102,4 +101,3 @@ doServerInfo(Context const& context);
Result Result
doRandom(Context const& context); doRandom(Context const& context);
} // namespace RPC } // namespace RPC
#endif

View File

@@ -1,5 +1,4 @@
#ifndef REPORTING_RPC_H_INCLUDED #pragma once
#define REPORTING_RPC_H_INCLUDED
#include <backend/BackendInterface.h> #include <backend/BackendInterface.h>
#include <log/Logger.h> #include <log/Logger.h>
@@ -146,5 +145,3 @@ logDuration(Context const& ctx, T const& dur)
} }
} // namespace RPC } // namespace RPC
#endif // REPORTING_RPC_H_INCLUDED

View File

@@ -1,6 +1,5 @@
#pragma once
#ifndef XRPL_REPORTING_RPCHELPERS_H_INCLUDED
#define XRPL_REPORTING_RPCHELPERS_H_INCLUDED
/* /*
* This file contains a variety of utility functions used when executing * This file contains a variety of utility functions used when executing
* the handlers * the handlers
@@ -272,4 +271,3 @@ computeBookChanges(
std::vector<Backend::TransactionAndMetadata> const& transactions); std::vector<Backend::TransactionAndMetadata> const& transactions);
} // namespace RPC } // namespace RPC
#endif

View File

@@ -1,5 +1,4 @@
#ifndef CLIO_WORK_QUEUE_H #pragma once
#define CLIO_WORK_QUEUE_H
#include <log/Logger.h> #include <log/Logger.h>
@@ -77,5 +76,3 @@ private:
boost::asio::io_context ioc_ = {}; boost::asio::io_context ioc_ = {};
std::optional<boost::asio::io_context::work> work_{ioc_}; std::optional<boost::asio::io_context::work> work_{ioc_};
}; };
#endif // CLIO_WORK_QUEUE_H

View File

@@ -1,5 +1,4 @@
#ifndef CLIO_SUBSCRIPTION_MESSAGE_H #pragma once
#define CLIO_SUBSCRIPTION_MESSAGE_H
#include <string> #include <string>
@@ -36,5 +35,3 @@ public:
return message_.size(); return message_.size();
} }
}; };
#endif // CLIO_SUBSCRIPTION_MESSAGE_H

View File

@@ -1,5 +1,4 @@
#ifndef SUBSCRIPTION_MANAGER_H #pragma once
#define SUBSCRIPTION_MANAGER_H
#include <backend/BackendInterface.h> #include <backend/BackendInterface.h>
#include <config/Config.h> #include <config/Config.h>
@@ -285,5 +284,3 @@ private:
std::unordered_map<session_ptr, std::vector<CleanupFunction>> std::unordered_map<session_ptr, std::vector<CleanupFunction>>
cleanupFuncs_ = {}; cleanupFuncs_ = {};
}; };
#endif // SUBSCRIPTION_MANAGER_H

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_UTIL_TAGDECORATOR_H #pragma once
#define RIPPLE_UTIL_TAGDECORATOR_H
#include <boost/algorithm/string/predicate.hpp> #include <boost/algorithm/string/predicate.hpp>
#include <boost/json.hpp> #include <boost/json.hpp>
@@ -259,5 +258,3 @@ public:
}; };
} // namespace util } // namespace util
#endif // RIPPLE_UTIL_TAGDECORATOR_H

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_REPORTING_DOS_GUARD_H #pragma once
#define RIPPLE_REPORTING_DOS_GUARD_H
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <string> #include <string>
@@ -100,4 +99,3 @@ private:
boost::transform_iterator(std::end(whitelist), transform)}; boost::transform_iterator(std::end(whitelist), transform)};
} }
}; };
#endif

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_REPORTING_HTTP_BASE_SESSION_H #pragma once
#define RIPPLE_REPORTING_HTTP_BASE_SESSION_H
#include <boost/asio/dispatch.hpp> #include <boost/asio/dispatch.hpp>
#include <boost/asio/spawn.hpp> #include <boost/asio/spawn.hpp>
@@ -468,5 +467,3 @@ handle_request(
RPC::makeError(RPC::RippledError::rpcINTERNAL)))); RPC::makeError(RPC::RippledError::rpcINTERNAL))));
} }
} }
#endif // RIPPLE_REPORTING_HTTP_BASE_SESSION_H

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_REPORTING_HTTP_SESSION_H #pragma once
#define RIPPLE_REPORTING_HTTP_SESSION_H
#include <webserver/HttpBase.h> #include <webserver/HttpBase.h>
@@ -91,5 +90,3 @@ public:
// At this point the connection is closed gracefully // At this point the connection is closed gracefully
} }
}; };
#endif // RIPPLE_REPORTING_HTTP_SESSION_H

View File

@@ -1,5 +1,4 @@
#ifndef LISTENER_H #pragma once
#define LISTENER_H
#include <log/Logger.h> #include <log/Logger.h>
#include <subscriptions/SubscriptionManager.h> #include <subscriptions/SubscriptionManager.h>
@@ -369,5 +368,3 @@ make_HttpServer(
return server; return server;
} }
} // namespace Server } // namespace Server
#endif // LISTENER_H

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_REPORTING_WS_SESSION_H #pragma once
#define RIPPLE_REPORTING_WS_SESSION_H
#include <boost/asio/dispatch.hpp> #include <boost/asio/dispatch.hpp>
#include <boost/beast/core.hpp> #include <boost/beast/core.hpp>
@@ -210,5 +209,3 @@ private:
->run(std::move(req_)); ->run(std::move(req_));
} }
}; };
#endif // RIPPLE_REPORTING_WS_SESSION_H

View File

@@ -1,24 +1,4 @@
//------------------------------------------------------------------------------ #pragma once
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2021 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef REPORTING_SSL_H
#define REPORTING_SSL_H
#include <boost/asio/ssl.hpp> #include <boost/asio/ssl.hpp>
@@ -62,5 +42,3 @@ parse_certs(const char* certFilename, const char* keyFilename)
return ctx; return ctx;
} }
#endif // REPORTING_SSL_H

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_REPORTING_HTTPS_SESSION_H #pragma once
#define RIPPLE_REPORTING_HTTPS_SESSION_H
#include <webserver/HttpBase.h> #include <webserver/HttpBase.h>
@@ -126,5 +125,3 @@ public:
// At this point the connection is closed gracefully // At this point the connection is closed gracefully
} }
}; };
#endif // RIPPLE_REPORTING_HTTPS_SESSION_H

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_REPORTING_SSL_WS_SESSION_H #pragma once
#define RIPPLE_REPORTING_SSL_WS_SESSION_H
#include <boost/asio/dispatch.hpp> #include <boost/asio/dispatch.hpp>
#include <boost/beast/core.hpp> #include <boost/beast/core.hpp>
@@ -223,5 +222,3 @@ private:
->run(std::move(req_)); ->run(std::move(req_));
} }
}; };
#endif // RIPPLE_REPORTING_SSL_WS_SESSION_H

View File

@@ -1,5 +1,4 @@
#ifndef RIPPLE_REPORTING_WS_BASE_SESSION_H #pragma once
#define RIPPLE_REPORTING_WS_BASE_SESSION_H
#include <backend/BackendInterface.h> #include <backend/BackendInterface.h>
#include <etl/ETLSource.h> #include <etl/ETLSource.h>
@@ -444,5 +443,3 @@ public:
do_read(); do_read();
} }
}; };
#endif // RIPPLE_REPORTING_WS_BASE_SESSION_H

View File

@@ -1,5 +1,4 @@
#ifndef CLIO_UNITTEST_FIXTURES_H #pragma once
#define CLIO_UNITTEST_FIXTURES_H
#include <ios> #include <ios>
#include <mutex> #include <mutex>
@@ -89,5 +88,3 @@ protected:
boost::log::core::get()->set_logging_enabled(false); boost::log::core::get()->set_logging_enabled(false);
} }
}; };
#endif // CLIO_UNITTEST_FIXTURES_H