- Gettext support to resource policies descriptions.
- Renamed default_resource_policy_manager to match the design. - Audited some other files. git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1232 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
37e4d7572b
commit
859df07a89
11 changed files with 233 additions and 65 deletions
|
@ -1,4 +1,4 @@
|
|||
// src/backend/default_resource_policy_manager.cc - Copyright 2005, 2006, University
|
||||
// src/backend/cpp_resource_policy_manager.cc - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
|
@ -19,20 +19,20 @@
|
|||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
#include <sgpemv2/cpp_resource_policy_manager.hh>
|
||||
#include <sgpemv2/resource_policy_lifo.hh>
|
||||
#include <sgpemv2/resource_policy_fifo.hh>
|
||||
#include <sgpemv2/resource_policy_priority.hh>
|
||||
#include <sgpemv2/resource_policy_priority_inheritance.hh>
|
||||
#include <sgpemv2/default_resource_policy_manager.hh>
|
||||
#include <sgpemv2/resource_policies_gatekeeper.hh>
|
||||
|
||||
using namespace sgpem;
|
||||
|
||||
// instantiate a default instance of this class.
|
||||
DefaultResourcePolicyManager DefaultResourcePolicyManager::_default_instance;
|
||||
CppResourcePolicyManager CppResourcePolicyManager::_default_instance;
|
||||
|
||||
|
||||
DefaultResourcePolicyManager::DefaultResourcePolicyManager()
|
||||
CppResourcePolicyManager::CppResourcePolicyManager()
|
||||
{
|
||||
ResourcePoliciesGatekeeper::get_instance().register_manager(this);
|
||||
// Includes default policies.
|
||||
|
@ -43,13 +43,13 @@ DefaultResourcePolicyManager::DefaultResourcePolicyManager()
|
|||
}
|
||||
|
||||
|
||||
DefaultResourcePolicyManager::~DefaultResourcePolicyManager()
|
||||
CppResourcePolicyManager::~CppResourcePolicyManager()
|
||||
{
|
||||
ResourcePoliciesGatekeeper::get_instance().unregister_manager(this);
|
||||
}
|
||||
|
||||
const std::vector<ResourcePolicy*>&
|
||||
DefaultResourcePolicyManager::get_avail_policies() const
|
||||
CppResourcePolicyManager::get_avail_policies() const
|
||||
{
|
||||
return _policies;
|
||||
}
|
|
@ -70,13 +70,13 @@ ResourcePolicyFiFo::enforce(Environment& environment, Environment::SubRequestQue
|
|||
Glib::ustring
|
||||
ResourcePolicyFiFo::get_description() const
|
||||
{
|
||||
return "A resource policy which satisfies earlier requests before older ones.";
|
||||
return _("A resource policy which satisfies earlier requests before older ones.");
|
||||
}
|
||||
|
||||
Glib::ustring
|
||||
ResourcePolicyFiFo::get_name() const
|
||||
{
|
||||
return "First In, First Out";
|
||||
return _("First In, First Out");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -82,13 +82,13 @@ ResourcePolicyLiFo::enforce(Environment& environment, Environment::SubRequestQue
|
|||
Glib::ustring
|
||||
ResourcePolicyLiFo::get_description() const
|
||||
{
|
||||
return "A resource policy which allows a request to be immediately allocated if there is enough space.";
|
||||
return _("A resource policy which allows a request to be immediately allocated if there is enough space.");
|
||||
}
|
||||
|
||||
Glib::ustring
|
||||
ResourcePolicyLiFo::get_name() const
|
||||
{
|
||||
return "Last In, First Out";
|
||||
return _("Last In, First Out");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -85,13 +85,13 @@ ResourcePolicyPriority::enforce(Environment& environment, Environment::SubReques
|
|||
Glib::ustring
|
||||
ResourcePolicyPriority::get_description() const
|
||||
{
|
||||
return "A resource policy which satisfies higher priority requests before lower priority ones.";
|
||||
return _("A resource policy which satisfies higher priority requests before lower priority ones.");
|
||||
}
|
||||
|
||||
Glib::ustring
|
||||
ResourcePolicyPriority::get_name() const
|
||||
{
|
||||
return "Higher Priority First";
|
||||
return _("Higher Priority First");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -98,13 +98,13 @@ ResourcePolicyPriorityInheritance::enforce(Environment& environment, Environment
|
|||
Glib::ustring
|
||||
ResourcePolicyPriorityInheritance::get_description() const
|
||||
{
|
||||
return "A resource policy which solves the priority inversion problem by raising the priority of a thread to the maximum relative to the queue.";
|
||||
return _("A resource policy which solves the priority inversion problem by raising the priority of a thread to the maximum relative to the queue.");
|
||||
}
|
||||
|
||||
Glib::ustring
|
||||
ResourcePolicyPriorityInheritance::get_name() const
|
||||
{
|
||||
return "Basic Priority Inheritance Protocol";
|
||||
return _("Basic Priority Inheritance Protocol");
|
||||
}
|
||||
|
||||
|
||||
|
|
67
src/backend/sgpemv2/cpp_resource_policy_manager.hh
Normal file
67
src/backend/sgpemv2/cpp_resource_policy_manager.hh
Normal file
|
@ -0,0 +1,67 @@
|
|||
// src/backend/sgpemv2/cpp_resource_policy_manager.hh - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
// This file is part of SGPEMv2.
|
||||
//
|
||||
// This is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// SGPEMv2 is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with SGPEMv2; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#ifndef CPP_RESOURCE_POLICY_MANAGER_HH
|
||||
#define CPP_RESOURCE_POLICY_MANAGER_HH 1
|
||||
|
||||
namespace sgpem
|
||||
{
|
||||
class ResourcePolicy;
|
||||
}
|
||||
|
||||
#include <sgpemv2/sgpemv2-visibility.hh>
|
||||
|
||||
#include <sgpemv2/resource_policy_manager.hh>
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace sgpem
|
||||
{
|
||||
class CppResourcePolicyManager;
|
||||
|
||||
/**
|
||||
ResourcePolicyManager is the Abstract Factory for \ref ResourcePolicy objects.
|
||||
*/
|
||||
class SG_DLLEXPORT CppResourcePolicyManager : public ResourcePolicyManager
|
||||
{
|
||||
public:
|
||||
/** \brief CppResourcePolicyManager constructor
|
||||
*
|
||||
* Registers itself to the ResourcePoliciesGatekeeper singleton.
|
||||
*/
|
||||
CppResourcePolicyManager();
|
||||
|
||||
virtual ~CppResourcePolicyManager();
|
||||
|
||||
virtual const std::vector<ResourcePolicy*>& get_avail_policies() const;
|
||||
|
||||
private:
|
||||
std::vector<ResourcePolicy*> _policies;
|
||||
|
||||
// an Instance of this class is created by default and it is registered to
|
||||
// the ResourcePolicyGateKeeper
|
||||
static CppResourcePolicyManager _default_instance;
|
||||
};
|
||||
|
||||
} //~ namespace sgpem
|
||||
|
||||
#endif
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// src/backend/default_resource_policy_manager.hh - Copyright 2005, 2006, University
|
||||
// src/backend/sgpemv2/cpp_resource_policy_manager.hh - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
|
@ -18,8 +18,8 @@
|
|||
// along with SGPEMv2; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#ifndef DEFAULT_RESOURCE_POLICY_MANAGER_HH
|
||||
#define DEFAULT_RESOURCE_POLICY_MANAGER_HH 1
|
||||
#ifndef CPP_RESOURCE_POLICY_MANAGER_HH
|
||||
#define CPP_RESOURCE_POLICY_MANAGER_HH 1
|
||||
|
||||
namespace sgpem
|
||||
{
|
||||
|
@ -35,21 +35,21 @@ namespace sgpem
|
|||
|
||||
namespace sgpem
|
||||
{
|
||||
class DefaultResourcePolicyManager;
|
||||
class CppResourcePolicyManager;
|
||||
|
||||
/**
|
||||
ResourcePolicyManager is the Abstract Factory for \ref ResourcePolicy objects.
|
||||
*/
|
||||
class SG_DLLEXPORT DefaultResourcePolicyManager : public ResourcePolicyManager
|
||||
class SG_DLLEXPORT CppResourcePolicyManager : public ResourcePolicyManager
|
||||
{
|
||||
public:
|
||||
/** \brief DefaultResourcePolicyManager constructor
|
||||
/** \brief CppResourcePolicyManager constructor
|
||||
*
|
||||
* Registers itself to the ResourcePoliciesGatekeeper singleton.
|
||||
*/
|
||||
DefaultResourcePolicyManager();
|
||||
CppResourcePolicyManager();
|
||||
|
||||
virtual ~DefaultResourcePolicyManager();
|
||||
virtual ~CppResourcePolicyManager();
|
||||
|
||||
virtual const std::vector<ResourcePolicy*>& get_avail_policies() const;
|
||||
|
||||
|
@ -58,7 +58,7 @@ namespace sgpem
|
|||
|
||||
// an Instance of this class is created by default and it is registered to
|
||||
// the ResourcePolicyGateKeeper
|
||||
static DefaultResourcePolicyManager _default_instance;
|
||||
static CppResourcePolicyManager _default_instance;
|
||||
};
|
||||
|
||||
} //~ namespace sgpem
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// src/backend/resource_policy_priority.hh - Copyright 2005, 2006, University
|
||||
// src/backend/sgpemv2/resource_policy_priority.hh - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue