treqs::Resource Class Reference
#include <Resource.h>
List of all members.
Detailed Description
This class contains the resource allocation for a given PVR (aka media type)
Constructor & Destructor Documentation
treqs::Resource::Resource |
( |
|
) |
|
treqs::Resource::~Resource |
( |
|
) |
[virtual] |
Member Function Documentation
int treqs::Resource::countFreeResources |
( |
|
) |
|
return the count of resources available
int treqs::Resource::getAge |
( |
|
) |
|
Returns the age of the data in seconds
- Returns:
- seconds since last data refresh
unsigned int treqs::Resource::getPvrId |
( |
|
) |
const |
time_t treqs::Resource::getTimestamp |
( |
|
) |
const |
int treqs::Resource::getTotalAllocation |
( |
|
) |
const |
std::map< std::string, int > * treqs::Resource::getUsedResources |
( |
|
) |
|
Returns a pointer to the map of used resources
- Returns:
- a pointer to the map of used resources
int treqs::Resource::getUsedResources |
( |
string |
user |
) |
|
Returns the resource usage for a given user
- Parameters:
-
- Returns:
- the number of used resources
std::map< std::string, float > * treqs::Resource::getUserAllocation |
( |
|
) |
|
Returns a pointer to the map of user allocations
- Returns:
- a pointer to the map of user allocations
float treqs::Resource::getUserAllocation |
( |
string |
user |
) |
|
Returns the allocation for a given user
- Parameters:
-
- Returns:
- the allocation, 0 if none
int treqs::Resource::incUsedResources |
( |
string |
u |
) |
|
increment the used resources for a given user. If the user reference doesn't exist, create it
- Parameters:
-
| u | the reference to the user |
void treqs::Resource::resetTimestamp |
( |
|
) |
|
void treqs::Resource::resetUsedResources |
( |
|
) |
|
set all used resources to 0
void treqs::Resource::setPvrId |
( |
int |
p |
) |
|
void treqs::Resource::setTimestamp |
( |
time_t |
t |
) |
|
void treqs::Resource::setTotalAllocation |
( |
int |
t |
) |
|
void treqs::Resource::setUsedResources |
( |
string |
u, |
|
|
int |
r | |
|
) |
| | |
void treqs::Resource::setUserAllocation |
( |
pair< string, float > |
p |
) |
|
void treqs::Resource::setUserAllocation |
( |
string |
u, |
|
|
float |
a | |
|
) |
| | |
Member Data Documentation
ID of the PVR for this resource.
Date of the last data refresh.
Total resource (drives) attribution.
Resources currently used for a user.
Allocated resource for a user, as a fraction of TotalAllocation.
The documentation for this class was generated from the following files:
- /home/gomez/Documents/workspaces/treqs/treqs/src/Resource.h
- /home/gomez/Documents/workspaces/treqs/treqs/src/Resource.cpp