mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 09:17:57 +00:00
Add default construction and isNull for Call handlers
This commit is contained in:
@@ -30,6 +30,10 @@ class CompletionCall
|
||||
public:
|
||||
typedef void result_type;
|
||||
|
||||
CompletionCall () noexcept
|
||||
{
|
||||
}
|
||||
|
||||
// Construction from Handler with zero arguments
|
||||
//
|
||||
template <typename Handler>
|
||||
@@ -63,6 +67,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool isNull () const noexcept
|
||||
{
|
||||
return m_call == nullptr;
|
||||
}
|
||||
|
||||
void operator() ()
|
||||
{
|
||||
(*m_call) ();
|
||||
|
||||
@@ -39,6 +39,10 @@ class ErrorCall
|
||||
public:
|
||||
typedef void result_type;
|
||||
|
||||
ErrorCall () noexcept
|
||||
{
|
||||
}
|
||||
|
||||
template <class Handler>
|
||||
ErrorCall (BOOST_ASIO_MOVE_ARG(Handler) handler)
|
||||
: m_call (new CallType <Handler> (BOOST_ASIO_MOVE_CAST(Handler)(handler)))
|
||||
@@ -50,6 +54,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool isNull () const noexcept
|
||||
{
|
||||
return m_call == nullptr;
|
||||
}
|
||||
|
||||
void operator() (boost::system::error_code const& ec)
|
||||
{
|
||||
(*m_call) (ec);
|
||||
|
||||
@@ -36,6 +36,10 @@ class TransferCall
|
||||
public:
|
||||
typedef void result_type;
|
||||
|
||||
TransferCall () noexcept
|
||||
{
|
||||
}
|
||||
|
||||
template <class Handler>
|
||||
TransferCall (BOOST_ASIO_MOVE_ARG(Handler) handler)
|
||||
: m_call (new CallType <Handler> (BOOST_ASIO_MOVE_CAST(Handler)(handler)))
|
||||
@@ -47,6 +51,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool isNull () const noexcept
|
||||
{
|
||||
return m_call == nullptr;
|
||||
}
|
||||
|
||||
void operator() (boost::system::error_code const& ec, std::size_t bytes_transferred)
|
||||
{
|
||||
(*m_call) (ec, bytes_transferred);
|
||||
|
||||
Reference in New Issue
Block a user