GridComputing
Job Management in Grid Computing
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Job Class Reference

Job Class. More...

#include <job.h>

Inheritance diagram for Job:
ISave IUpdate IPrint

Classes

struct  PriorityLess
 Job::PriorityLess struct. More...
 

Public Member Functions

 Job (uint id)
 "Search" Constructor
 
 Job (const std::string &name, uint8 priority, double requiredRAM, double requiredDiskSpace, uint executionTime)
 Constructor.
 
uint GetId () const
 
void SetId (uint val)
 
const std::string & GetName () const
 Returns the name of the Job.
 
uint8 GetPriority () const
 Returns the priority of the Job.
 
void SetPriority (uint8 val)
 Sets job's priority with val.
 
double GetRequiredRAM () const
 Returns the required amount of RAM (MB)
 
double GetRequiredDiskSpace () const
 Returns the required amount of disk space (MB)
 
uint GetTotalExecutionTime () const
 Returns the total number of seconds to execute the Job.
 
uint GetElapsedTime () const
 Returns the number of seconds since the Job was created.
 
double GetPrice () const
 Returns the price of the Job (5 cents per MB of RAM)
 
bool Finished () const
 Returns true if the Job finished.
 
void Finish ()
 Forces the Job to abruptly end.
 
bool Save (ByteBuffer &bb) const override
 Saves Job data to a ByteBuffer.
 
void Update (uint32 diff)
 Updates Jobs timers.
 
void Print (std::ostream &os=std::cout) const override
 Representation of the class in a row form.
 
void PrintWithId (std::ostream &os=std::cout) const
 
void AddRequiredSoftware (const Software &sw)
 
bool IsRequiredSoftware (const Software &sw) const
 Deletes Software from the set of required Software.
 
const SoftwareSetGetRequiredSoftware () const
 Returns the set of required Software.
 

Static Public Member Functions

static JobLoad (ByteBuffer &bb)
 Loads a Job from a ByteBuffer.
 
static void PrintHeader (std::ostream &os=std::cout, bool withId=false)
 

Private Member Functions

 Job (const Job &)
 
Joboperator= (Job const &)
 

Private Attributes

const double _requiredRAM
 Amount of required RAM to execute the Job (MB)
 
const double _requiredDiskSpace
 Amount of required disk space to execute the Job (MB)
 
const uint _totalExecutionTime
 The total number of seconds to execute the Job.
 
uint _elapsedTime
 The number of seconds since the Job was created.
 
uint _ms
 Helper member to count the number of milliseconds since _elapsedTime was changed.
 
SoftwareSet _requiredSoftware
 Set of required software to execute the Job.
 
uint8 _priority
 Priority.
 
const std::string _name
 Name of the job.
 
uint _id
 

Static Private Attributes

static uint _maxNameLength = 0
 Length of the biggest name.
 

Detailed Description

Job Class.

Represents a Job that is executed in a Machine

Constructor & Destructor Documentation

Job::Job ( uint  id)

"Search" Constructor

Job::Job ( const std::string &  name,
uint8  priority,
double  requiredRAM,
double  requiredDiskSpace,
uint  executionTime 
)

Constructor.

Job::Job ( const Job )
private

Member Function Documentation

void Job::AddRequiredSoftware ( const Software sw)

Adds Software to the set of required Software

void Job::Finish ( )

Forces the Job to abruptly end.

bool Job::Finished ( ) const

Returns true if the Job finished.

uint Job::GetElapsedTime ( ) const

Returns the number of seconds since the Job was created.

uint Job::GetId ( ) const
const std::string& Job::GetName ( ) const

Returns the name of the Job.

double Job::GetPrice ( ) const

Returns the price of the Job (5 cents per MB of RAM)

uint8 Job::GetPriority ( ) const

Returns the priority of the Job.

double Job::GetRequiredDiskSpace ( ) const

Returns the required amount of disk space (MB)

double Job::GetRequiredRAM ( ) const

Returns the required amount of RAM (MB)

const SoftwareSet& Job::GetRequiredSoftware ( ) const

Returns the set of required Software.

uint Job::GetTotalExecutionTime ( ) const

Returns the total number of seconds to execute the Job.

bool Job::IsRequiredSoftware ( const Software sw) const

Deletes Software from the set of required Software.

Job * Job::Load ( ByteBuffer bb)
static

Loads a Job from a ByteBuffer.

Job& Job::operator= ( Job const &  )
private
void Job::Print ( std::ostream &  os = std::cout) const
overridevirtual

Representation of the class in a row form.

Parameters
osstream to print to.

Implements IPrint.

void Job::PrintHeader ( std::ostream &  os = std::cout,
bool  withId = false 
)
static
void Job::PrintWithId ( std::ostream &  os = std::cout) const
bool Job::Save ( ByteBuffer bb) const
overridevirtual

Saves Job data to a ByteBuffer.

Implements ISave.

void Job::SetId ( uint  val)
void Job::SetPriority ( uint8  val)

Sets job's priority with val.

void Job::Update ( uint32  diff)
virtual

Updates Jobs timers.

Implements IUpdate.

Member Data Documentation

uint Job::_elapsedTime
private

The number of seconds since the Job was created.

uint Job::_id
private
uint Job::_maxNameLength = 0
staticprivate

Length of the biggest name.

uint Job::_ms
private

Helper member to count the number of milliseconds since _elapsedTime was changed.

const std::string Job::_name
private

Name of the job.

uint8 Job::_priority
private

Priority.

const double Job::_requiredDiskSpace
private

Amount of required disk space to execute the Job (MB)

const double Job::_requiredRAM
private

Amount of required RAM to execute the Job (MB)

SoftwareSet Job::_requiredSoftware
private

Set of required software to execute the Job.

const uint Job::_totalExecutionTime
private

The total number of seconds to execute the Job.


The documentation for this class was generated from the following files: