xrpld
Loading...
Searching...
No Matches
xrpl::Job Class Reference

#include <Job.h>

Inheritance diagram for xrpl::Job:
Collaboration diagram for xrpl::Job:

Public Types

using clock_type = std::chrono::steady_clock

Public Member Functions

 Job ()
 Default constructor.
 Job (JobType type, std::uint64_t index)
 Job (JobType type, std::string const &name, std::uint64_t index, LoadMonitor &lm, std::function< void()> const &job)
JobType getType () const
clock_type::time_point const & queueTime () const
 Returns the time when the job was queued.
void doJob ()
bool operator< (Job const &j) const
bool operator> (Job const &j) const
bool operator<= (Job const &j) const
bool operator>= (Job const &j) const

Public Attributes

friend Object

Static Private Member Functions

static auto & getCounter () noexcept

Private Attributes

JobType type_
std::uint64_t jobIndex_
std::function< void()> job_
std::shared_ptr< LoadEventloadEvent_
std::string name_
clock_type::time_point queueTime_

Detailed Description

Definition at line 76 of file Job.h.

Member Typedef Documentation

◆ clock_type

Definition at line 79 of file Job.h.

Constructor & Destructor Documentation

◆ Job() [1/3]

xrpl::Job::Job ( )

Default constructor.

Allows Job to be used as a container type.

This is used to allow things like jobMap [key] = value.

Definition at line 14 of file Job.cpp.

◆ Job() [2/3]

xrpl::Job::Job ( JobType type,
std::uint64_t index )

Definition at line 18 of file Job.cpp.

◆ Job() [3/3]

xrpl::Job::Job ( JobType type,
std::string const & name,
std::uint64_t index,
LoadMonitor & lm,
std::function< void()> const & job )

Definition at line 22 of file Job.cpp.

Member Function Documentation

◆ getType()

JobType xrpl::Job::getType ( ) const
nodiscard

Definition at line 34 of file Job.cpp.

◆ queueTime()

Job::clock_type::time_point const & xrpl::Job::queueTime ( ) const
nodiscard

Returns the time when the job was queued.

Definition at line 40 of file Job.cpp.

◆ doJob()

void xrpl::Job::doJob ( )

Definition at line 46 of file Job.cpp.

◆ operator<()

bool xrpl::Job::operator< ( Job const & j) const

Definition at line 83 of file Job.cpp.

◆ operator>()

bool xrpl::Job::operator> ( Job const & j) const

Definition at line 60 of file Job.cpp.

◆ operator<=()

bool xrpl::Job::operator<= ( Job const & j) const

Definition at line 95 of file Job.cpp.

◆ operator>=()

bool xrpl::Job::operator>= ( Job const & j) const

Definition at line 72 of file Job.cpp.

◆ getCounter()

auto & xrpl::CountedObject< Job >::getCounter ( )
staticprivatenoexceptinherited

Definition at line 109 of file CountedObject.h.

Member Data Documentation

◆ type_

JobType xrpl::Job::type_
private

Definition at line 125 of file Job.h.

◆ jobIndex_

std::uint64_t xrpl::Job::jobIndex_
private

Definition at line 126 of file Job.h.

◆ job_

std::function<void()> xrpl::Job::job_
private

Definition at line 127 of file Job.h.

◆ loadEvent_

std::shared_ptr<LoadEvent> xrpl::Job::loadEvent_
private

Definition at line 128 of file Job.h.

◆ name_

std::string xrpl::Job::name_
private

Definition at line 129 of file Job.h.

◆ queueTime_

clock_type::time_point xrpl::Job::queueTime_
private

Definition at line 130 of file Job.h.

◆ Object

friend xrpl::CountedObject< Job >::Job
inherited

Definition at line 134 of file CountedObject.h.