Format first-party source according to .clang-format

This commit is contained in:
Pretty Printer
2020-04-17 09:56:34 -05:00
committed by manojsdoshi
parent 65dfc5d19e
commit 50760c6935
1076 changed files with 86161 additions and 77449 deletions

View File

@@ -17,82 +17,86 @@
*/
//==============================================================================
#include <ripple/core/Job.h>
#include <ripple/beast/core/CurrentThreadName.h>
#include <ripple/core/Job.h>
#include <cassert>
namespace ripple {
Job::Job ()
: mType (jtINVALID)
, mJobIndex (0)
Job::Job() : mType(jtINVALID), mJobIndex(0)
{
}
Job::Job (JobType type, std::uint64_t index)
: mType (type)
, mJobIndex (index)
Job::Job(JobType type, std::uint64_t index) : mType(type), mJobIndex(index)
{
}
Job::Job (JobType type,
std::string const& name,
std::uint64_t index,
LoadMonitor& lm,
std::function <void (Job&)> const& job,
CancelCallback cancelCallback)
: m_cancelCallback (cancelCallback)
, mType (type)
, mJobIndex (index)
, mJob (job)
, mName (name)
, m_queue_time (clock_type::now ())
Job::Job(
JobType type,
std::string const& name,
std::uint64_t index,
LoadMonitor& lm,
std::function<void(Job&)> const& job,
CancelCallback cancelCallback)
: m_cancelCallback(cancelCallback)
, mType(type)
, mJobIndex(index)
, mJob(job)
, mName(name)
, m_queue_time(clock_type::now())
{
m_loadEvent = std::make_shared <LoadEvent> (std::ref (lm), name, false);
m_loadEvent = std::make_shared<LoadEvent>(std::ref(lm), name, false);
}
JobType Job::getType () const
JobType
Job::getType() const
{
return mType;
}
Job::CancelCallback Job::getCancelCallback () const
Job::CancelCallback
Job::getCancelCallback() const
{
assert (m_cancelCallback);
assert(m_cancelCallback);
return m_cancelCallback;
}
Job::clock_type::time_point const& Job::queue_time () const
Job::clock_type::time_point const&
Job::queue_time() const
{
return m_queue_time;
}
bool Job::shouldCancel () const
bool
Job::shouldCancel() const
{
if (m_cancelCallback)
return m_cancelCallback ();
return m_cancelCallback();
return false;
}
void Job::doJob ()
void
Job::doJob()
{
beast::setCurrentThreadName ("doJob: " + mName);
m_loadEvent->start ();
m_loadEvent->setName (mName);
beast::setCurrentThreadName("doJob: " + mName);
m_loadEvent->start();
m_loadEvent->setName(mName);
mJob (*this);
mJob(*this);
// Destroy the lambda, otherwise we won't include
// its duration in the time measurement
mJob = nullptr;
}
void Job::rename (std::string const& newName)
void
Job::rename(std::string const& newName)
{
mName = newName;
}
bool Job::operator> (const Job& j) const
bool
Job::operator>(const Job& j) const
{
if (mType < j.mType)
return true;
@@ -103,7 +107,8 @@ bool Job::operator> (const Job& j) const
return mJobIndex > j.mJobIndex;
}
bool Job::operator>= (const Job& j) const
bool
Job::operator>=(const Job& j) const
{
if (mType < j.mType)
return true;
@@ -114,7 +119,8 @@ bool Job::operator>= (const Job& j) const
return mJobIndex >= j.mJobIndex;
}
bool Job::operator< (const Job& j) const
bool
Job::operator<(const Job& j) const
{
if (mType < j.mType)
return false;
@@ -125,7 +131,8 @@ bool Job::operator< (const Job& j) const
return mJobIndex < j.mJobIndex;
}
bool Job::operator<= (const Job& j) const
bool
Job::operator<=(const Job& j) const
{
if (mType < j.mType)
return false;
@@ -136,4 +143,4 @@ bool Job::operator<= (const Job& j) const
return mJobIndex <= j.mJobIndex;
}
}
} // namespace ripple