mirror of https://github.com/oxen-io/lokinet
Include What You Use
This commit is contained in:
parent
91f401ff71
commit
8f0f6dde9d
|
@ -6,8 +6,6 @@ namespace llarp
|
|||
{
|
||||
namespace metrics
|
||||
{
|
||||
const char *FormatSpec::DEFAULT_FORMAT = "%f";
|
||||
|
||||
std::ostream &
|
||||
FormatSpec::format(std::ostream &stream, double data,
|
||||
const FormatSpec &format)
|
||||
|
|
|
@ -43,13 +43,13 @@ namespace llarp
|
|||
float m_scale;
|
||||
const char *m_format;
|
||||
|
||||
static const char *DEFAULT_FORMAT;
|
||||
static constexpr char DEFAULT_FORMAT[] = "%f";
|
||||
|
||||
FormatSpec() : m_scale(1.0), m_format(DEFAULT_FORMAT)
|
||||
constexpr FormatSpec() : m_scale(1.0), m_format(DEFAULT_FORMAT)
|
||||
{
|
||||
}
|
||||
|
||||
FormatSpec(float scale, const char *format)
|
||||
constexpr FormatSpec(float scale, const char *format)
|
||||
: m_scale(scale), m_format(format)
|
||||
{
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ namespace llarp
|
|||
|
||||
std::array< Spec, Publication::MaxSize > m_specs;
|
||||
|
||||
Format() : m_specs()
|
||||
constexpr Format() : m_specs()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -81,13 +81,13 @@ namespace llarp
|
|||
m_specs[static_cast< size_t >(pub)].emplace(spec);
|
||||
}
|
||||
|
||||
void
|
||||
constexpr void
|
||||
clear()
|
||||
{
|
||||
m_specs = decltype(m_specs)();
|
||||
}
|
||||
|
||||
const FormatSpec *
|
||||
constexpr const FormatSpec *
|
||||
specFor(Publication::Type val) const
|
||||
{
|
||||
const auto &spec = m_specs[static_cast< size_t >(val)];
|
||||
|
@ -158,7 +158,7 @@ namespace llarp
|
|||
const Category *m_category;
|
||||
CategoryContainer *m_nextCategory;
|
||||
|
||||
void
|
||||
constexpr void
|
||||
clear()
|
||||
{
|
||||
m_enabled = false;
|
||||
|
@ -261,33 +261,33 @@ namespace llarp
|
|||
const Description *m_description;
|
||||
|
||||
public:
|
||||
Id() : m_description(nullptr)
|
||||
constexpr Id() : m_description(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
Id(const Description *description) : m_description(description)
|
||||
constexpr Id(const Description *description) : m_description(description)
|
||||
{
|
||||
}
|
||||
|
||||
const Description *&
|
||||
constexpr const Description *&
|
||||
description()
|
||||
{
|
||||
return m_description;
|
||||
}
|
||||
|
||||
const Description *const &
|
||||
constexpr const Description *const &
|
||||
description() const
|
||||
{
|
||||
return m_description;
|
||||
}
|
||||
|
||||
constexpr bool
|
||||
bool
|
||||
valid() const noexcept
|
||||
{
|
||||
return m_description != nullptr;
|
||||
}
|
||||
|
||||
explicit constexpr operator bool() const noexcept
|
||||
explicit operator bool() const noexcept
|
||||
{
|
||||
return valid();
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
#ifndef LLARP_OBJECT_HPP
|
||||
#define LLARP_OBJECT_HPP
|
||||
|
||||
#include <absl/types/optional.h>
|
||||
#include <util/threading.hpp>
|
||||
|
||||
#include <absl/types/optional.h>
|
||||
#include <vector>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
namespace object
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <util/types.hpp>
|
||||
|
||||
#include <bitset>
|
||||
#include <vector>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue