- "Beautify" debug printout from Python policy manager
- Added support for resource policies in textual frontend git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1064 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
f7b440d53a
commit
0c02a29f8b
7 changed files with 103 additions and 68 deletions
|
@ -52,13 +52,16 @@ namespace sgpem
|
|||
friend class Singleton<CPUPoliciesGatekeeper>;
|
||||
|
||||
public:
|
||||
std::vector<CPUPolicyManager*> get_registered() const;
|
||||
typedef CPUPolicyManager Manager;
|
||||
typedef std::vector<Manager*> Managers;
|
||||
|
||||
Managers get_registered() const;
|
||||
|
||||
void register_manager(CPUPolicyManager* manager);
|
||||
|
||||
void unregister_manager(CPUPolicyManager* manager);
|
||||
|
||||
CPUPolicy* get_current_policy(History* history) throw(std::runtime_error);
|
||||
CPUPolicy* get_current_policy(History* history) throw(std::runtime_error);
|
||||
|
||||
/**
|
||||
Associates policy with history. If an exception is thrown, the current associated
|
||||
|
@ -74,7 +77,7 @@ namespace sgpem
|
|||
// Deactivates active policies managed by the specified manager.
|
||||
void deactivate_policies(CPUPolicyManager* manager);
|
||||
|
||||
std::vector<CPUPolicyManager*> _registered;
|
||||
Managers _registered;
|
||||
std::map<History*, CPUPolicy*> _active_policies;
|
||||
};
|
||||
|
||||
|
|
|
@ -38,6 +38,8 @@ namespace sgpem
|
|||
class SG_DLLEXPORT CPUPolicyManager
|
||||
{
|
||||
public:
|
||||
typedef CPUPolicy Policy;
|
||||
typedef std::vector<Policy*> Policies;
|
||||
/** \brief CPUPolicyManager constructor
|
||||
*
|
||||
* Saves ``this'' pointer into the _registered attribute, so it can access
|
||||
|
@ -51,7 +53,7 @@ namespace sgpem
|
|||
|
||||
virtual ~CPUPolicyManager() = 0;
|
||||
|
||||
virtual const std::vector<CPUPolicy*>& get_avail_policies() = 0;
|
||||
virtual const Policies& get_avail_policies() = 0;
|
||||
|
||||
protected:
|
||||
virtual void collect_policies() = 0;
|
||||
|
|
|
@ -50,7 +50,8 @@ namespace sgpem
|
|||
friend class Singleton<ResourcePoliciesGatekeeper>;
|
||||
|
||||
public:
|
||||
typedef std::vector<ResourcePolicyManager*> Managers;
|
||||
typedef ResourcePolicyManager Manager;
|
||||
typedef std::vector<Manager*> Managers;
|
||||
|
||||
const Managers& get_registered() const;
|
||||
|
||||
|
@ -69,7 +70,7 @@ namespace sgpem
|
|||
|
||||
void deactivate_policies(const ResourcePolicyManager& manager);
|
||||
|
||||
std::vector<ResourcePolicyManager*> _registered;
|
||||
Managers _registered;
|
||||
std::map<History*, ResourcePolicy*> _active_policies;
|
||||
};
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ namespace sgpem
|
|||
class SG_DLLEXPORT ResourcePolicyManager
|
||||
{
|
||||
public:
|
||||
typedef ResourcePolicy Policy;
|
||||
typedef std::vector<Policy*> Policies;
|
||||
/** \brief ResourcePolicyManager constructor
|
||||
*
|
||||
* Registers itself to the ResourcePoliciesGatekeeper singleton.
|
||||
|
@ -49,7 +51,7 @@ namespace sgpem
|
|||
|
||||
virtual ~ResourcePolicyManager();
|
||||
|
||||
virtual const std::vector<ResourcePolicy*>& get_avail_policies() const = 0;
|
||||
virtual const Policies& get_avail_policies() const = 0;
|
||||
};
|
||||
|
||||
} //~ namespace sgpem
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue