mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-26 16:40:20 +00:00
33 lines
681 B
C++
33 lines
681 B
C++
#pragma once
|
|
|
|
#include <xrpl/core/NetworkIDService.h>
|
|
|
|
#include <cstdint>
|
|
|
|
namespace xrpl {
|
|
|
|
// Forward declaration
|
|
class Config;
|
|
|
|
/** Implementation of NetworkIDService that reads from Config.
|
|
|
|
This class provides a NetworkIDService interface that wraps
|
|
the network ID from the application Config. It caches the
|
|
network ID at construction time.
|
|
*/
|
|
class NetworkIDServiceImpl final : public NetworkIDService
|
|
{
|
|
public:
|
|
explicit NetworkIDServiceImpl(std::uint32_t networkID);
|
|
|
|
~NetworkIDServiceImpl() override = default;
|
|
|
|
[[nodiscard]] std::uint32_t
|
|
getNetworkID() const noexcept override;
|
|
|
|
private:
|
|
std::uint32_t networkID_;
|
|
};
|
|
|
|
} // namespace xrpl
|