rippled
Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
ripple::Job Class Reference
Inheritance diagram for ripple::Job:
Inheritance graph
[legend]
Collaboration diagram for ripple::Job:
Collaboration graph
[legend]

Public Types

using clock_type = std::chrono::steady_clock
 

Public Member Functions

 Job ()
 Default constructor. More...
 
 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 & queue_time () const
 Returns the time when the job was queued. More...
 
void doJob ()
 
bool operator< (const Job &j) const
 
bool operator> (const Job &j) const
 
bool operator<= (const Job &j) const
 
bool operator>= (const Job &j) const
 

Static Private Member Functions

static auto & getCounter () noexcept
 

Private Attributes

JobType mType
 
std::uint64_t mJobIndex
 
std::function< void()> mJob
 
std::shared_ptr< LoadEventm_loadEvent
 
std::string mName
 
clock_type::time_point m_queue_time
 

Detailed Description

Definition at line 96 of file Job.h.

Member Typedef Documentation

◆ clock_type

Definition at line 99 of file Job.h.

Constructor & Destructor Documentation

◆ Job() [1/3]

ripple::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 26 of file Job.cpp.

◆ Job() [2/3]

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

Definition at line 30 of file Job.cpp.

◆ Job() [3/3]

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

Definition at line 34 of file Job.cpp.

Member Function Documentation

◆ getType()

JobType ripple::Job::getType ( ) const

Definition at line 50 of file Job.cpp.

◆ queue_time()

Job::clock_type::time_point const & ripple::Job::queue_time ( ) const

Returns the time when the job was queued.

Definition at line 56 of file Job.cpp.

◆ doJob()

void ripple::Job::doJob ( )

Definition at line 62 of file Job.cpp.

◆ operator<()

bool ripple::Job::operator< ( const Job j) const

Definition at line 100 of file Job.cpp.

◆ operator>()

bool ripple::Job::operator> ( const Job j) const

Definition at line 76 of file Job.cpp.

◆ operator<=()

bool ripple::Job::operator<= ( const Job j) const

Definition at line 112 of file Job.cpp.

◆ operator>=()

bool ripple::Job::operator>= ( const Job j) const

Definition at line 88 of file Job.cpp.

◆ getCounter()

static auto& ripple::CountedObject< Job >::getCounter
staticprivatenoexceptinherited

Definition at line 128 of file CountedObject.h.

Member Data Documentation

◆ mType

JobType ripple::Job::mType
private

Definition at line 145 of file Job.h.

◆ mJobIndex

std::uint64_t ripple::Job::mJobIndex
private

Definition at line 146 of file Job.h.

◆ mJob

std::function<void()> ripple::Job::mJob
private

Definition at line 147 of file Job.h.

◆ m_loadEvent

std::shared_ptr<LoadEvent> ripple::Job::m_loadEvent
private

Definition at line 148 of file Job.h.

◆ mName

std::string ripple::Job::mName
private

Definition at line 149 of file Job.h.

◆ m_queue_time

clock_type::time_point ripple::Job::m_queue_time
private

Definition at line 150 of file Job.h.