GridComputing
Job Management in Grid Computing
|
EnterpriseUser Class. More...
#include <user.h>
Public Member Functions | |
EnterpriseUser (const std::string &name, double budget) | |
double | GetBudget () const |
Returns the current budget, in euros. | |
void | SetBudget (double val) |
Changes the budget. | |
bool | Save (ByteBuffer &bb) const override |
Savers User data to a ByteBuffer. | |
void | CreatedJob (const Job *job) override |
Updates User info when a Job creation was successfull. | |
bool | CanCreateJob (const Job *job) override |
Returns true if User can create the given Job. | |
void | Print (std::ostream &os=std::cout) const override |
Representation of the class in a row form. | |
Public Member Functions inherited from User | |
virtual | ~User () |
uint | GetId () const |
Virtual destructor. | |
void | SetId (uint val) |
Changes the User's identifier. | |
void | SetName (const std::string &name) |
Updates the User's name. | |
const std::string & | GetName () const |
Returns the User's name. | |
Private Attributes | |
double | _budget |
Current budget. | |
Additional Inherited Members | |
Static Public Member Functions inherited from User | |
static User * | Load (ByteBuffer &bb) |
Loads (1) User data from a ByteBuffer. | |
static void | PrintHeader (std::ostream &os=std::cout) |
static Menu * | GetMenu () |
Returns the menu for the User class. | |
Protected Member Functions inherited from User | |
User (uint id) | |
User (const std::string &name) | |
Constructor used by subclasses. | |
Static Protected Attributes inherited from User | |
static Menu * | _menu = Loader<Menu>("userMenu.txt").Load() |
Menu associated with the User class. | |
static uint | _maxNameLength = 0 |
The length of the biggest name, used in Print methods. | |
EnterpriseUser Class.
EnterpriseUser represents a company that pays for each job created (with a budget)
EnterpriseUser::EnterpriseUser | ( | const std::string & | name, |
double | budget | ||
) |
|
overridevirtual |
|
overridevirtual |
double EnterpriseUser::GetBudget | ( | ) | const |
Returns the current budget, in euros.
|
overridevirtual |
Representation of the class in a row form.
os | stream to print to. |
Reimplemented from User.
|
overridevirtual |
Savers User data to a ByteBuffer.
Reimplemented from User.
void EnterpriseUser::SetBudget | ( | double | val | ) |
Changes the budget.
|
private |
Current budget.