Skip to content

Commit

Permalink
Merge pull request #388 from evoskuil/master
Browse files Browse the repository at this point in the history
Remove unnecessary session forward declaration.
  • Loading branch information
evoskuil authored Mar 24, 2024
2 parents a49a766 + 13af839 commit dd2d4e6
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 29 deletions.
4 changes: 2 additions & 2 deletions include/bitcoin/network/log/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ class BCT_API logger final
writer write(uint8_t level) const NOEXCEPT;

/// Fire event with optional value, recorded with current time.
void fire(uint8_t event, uint64_t value=zero) const NOEXCEPT;
void fire(uint8_t event_, uint64_t value=zero) const NOEXCEPT;

/// Fire event with nanosecond duration value, recorded with current time.
void span(uint8_t event, const time& started) const NOEXCEPT;
void span(uint8_t event_, const time& started) const NOEXCEPT;

/// If stopped, handler is invoked with error::subscriber_stopped/defaults
/// and dropped. Otherwise it is held until stop/drop. False if failed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
#include <bitcoin/network/messages/messages.hpp>
#include <bitcoin/network/net/net.hpp>
#include <bitcoin/network/protocols/protocol.hpp>
#include <bitcoin/network/sessions/sessions.hpp>

namespace libbitcoin {
namespace network {

class session;

class BCT_API protocol_address_in_31402
: public protocol, protected tracker<protocol_address_in_31402>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
#include <bitcoin/network/messages/messages.hpp>
#include <bitcoin/network/net/net.hpp>
#include <bitcoin/network/protocols/protocol.hpp>
#include <bitcoin/network/sessions/sessions.hpp>

namespace libbitcoin {
namespace network {

class session;

class BCT_API protocol_address_out_31402
: public protocol, protected tracker<protocol_address_out_31402>
{
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/network/protocols/protocol_alert_31402.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
#include <bitcoin/network/messages/messages.hpp>
#include <bitcoin/network/net/net.hpp>
#include <bitcoin/network/protocols/protocol.hpp>
#include <bitcoin/network/sessions/sessions.hpp>

namespace libbitcoin {
namespace network {

class session;

class BCT_API protocol_alert_31402
: public protocol, protected tracker<protocol_alert_31402>
{
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/network/protocols/protocol_ping_31402.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
#include <bitcoin/network/messages/messages.hpp>
#include <bitcoin/network/net/net.hpp>
#include <bitcoin/network/protocols/protocol.hpp>
#include <bitcoin/network/sessions/sessions.hpp>

namespace libbitcoin {
namespace network {

class session;

class BCT_API protocol_ping_31402
: public protocol, protected tracker<protocol_ping_31402>
{
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/network/protocols/protocol_ping_60001.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
#include <bitcoin/network/messages/messages.hpp>
#include <bitcoin/network/net/net.hpp>
#include <bitcoin/network/protocols/protocol_ping_31402.hpp>
#include <bitcoin/network/sessions/sessions.hpp>

namespace libbitcoin {
namespace network {

class session;

class BCT_API protocol_ping_60001
: public protocol_ping_31402, protected tracker<protocol_ping_60001>
{
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/network/protocols/protocol_reject_70002.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
#include <bitcoin/network/messages/messages.hpp>
#include <bitcoin/network/net/net.hpp>
#include <bitcoin/network/protocols/protocol.hpp>
#include <bitcoin/network/sessions/sessions.hpp>

namespace libbitcoin {
namespace network {

class session;

class BCT_API protocol_reject_70002
: public protocol, protected tracker<protocol_reject_70002>
{
Expand Down
4 changes: 1 addition & 3 deletions include/bitcoin/network/protocols/protocol_seed_31402.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@
#include <bitcoin/network/messages/messages.hpp>
#include <bitcoin/network/net/net.hpp>
#include <bitcoin/network/protocols/protocol.hpp>
#include <bitcoin/network/sessions/sessions.hpp>

namespace libbitcoin {
namespace network {

class session;

class BCT_API protocol_seed_31402
: public protocol, protected tracker<protocol_seed_31402>
{
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/network/protocols/protocol_version_31402.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
#include <bitcoin/network/messages/messages.hpp>
#include <bitcoin/network/net/net.hpp>
#include <bitcoin/network/protocols/protocol.hpp>
#include <bitcoin/network/sessions/sessions.hpp>

namespace libbitcoin {
namespace network {

class session;

class BCT_API protocol_version_31402
: public protocol, protected tracker<protocol_version_31402>
{
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/network/protocols/protocol_version_70001.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
#include <bitcoin/network/messages/messages.hpp>
#include <bitcoin/network/net/net.hpp>
#include <bitcoin/network/protocols/protocol_version_31402.hpp>
#include <bitcoin/network/sessions/sessions.hpp>

namespace libbitcoin {
namespace network {

class session;

class BCT_API protocol_version_70001
: public protocol_version_31402, protected tracker<protocol_version_70001>
{
Expand Down
3 changes: 1 addition & 2 deletions include/bitcoin/network/protocols/protocol_version_70002.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
#include <bitcoin/network/messages/messages.hpp>
#include <bitcoin/network/net/net.hpp>
#include <bitcoin/network/protocols/protocol_version_70001.hpp>
#include <bitcoin/network/sessions/sessions.hpp>

namespace libbitcoin {
namespace network {

class session;

class BCT_API protocol_version_70002
: public protocol_version_70001, protected tracker<protocol_version_70002>
{
Expand Down
12 changes: 6 additions & 6 deletions src/log/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,25 @@ void logger::do_subscribe_messages(const message_notifier& handler) NOEXCEPT
// events
// ----------------------------------------------------------------------------

void logger::span(uint8_t event, const time& started) const NOEXCEPT
void logger::span(uint8_t event_, const time& started) const NOEXCEPT
{
// value parameter is time span in nanoseconds.
fire(event, (now() - started).count());
fire(event_, (now() - started).count());
}

void logger::fire(uint8_t event, uint64_t value) const NOEXCEPT
void logger::fire(uint8_t event_, uint64_t value) const NOEXCEPT
{
boost::asio::post(strand_,
std::bind(&logger::do_notify_event,
this, event, value, fine_clock::now()));
this, event_, value, fine_clock::now()));
}

// private
void logger::do_notify_event(uint8_t event, uint64_t value,
void logger::do_notify_event(uint8_t event_, uint64_t value,
const time& point) const NOEXCEPT
{
BC_ASSERT_MSG(stranded(), "strand");
event_subscriber_.notify(error::success, event, value, point);
event_subscriber_.notify(error::success, event_, value, point);
}

void logger::subscribe_events(event_notifier&& handler) NOEXCEPT
Expand Down

0 comments on commit dd2d4e6

Please sign in to comment.