- Give facelift to test_loader. Still to be finished.
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@509 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
d462f6d1d3
commit
6a0bf4f444
11 changed files with 145 additions and 37 deletions
|
@ -45,9 +45,7 @@ namespace sgpem
|
|||
class SG_DLLEXPORT PythonPolicy : public Policy
|
||||
{
|
||||
public:
|
||||
//only PythonPolicyManager can create a PythonPolicy object
|
||||
friend class PythonPolicyManager;
|
||||
|
||||
PythonPolicy(const char* name);
|
||||
virtual ~PythonPolicy();
|
||||
|
||||
/**
|
||||
|
@ -77,7 +75,6 @@ namespace sgpem
|
|||
int get_time_slice() const throw(UserInterruptException);
|
||||
|
||||
private:
|
||||
PythonPolicy(const char* name);
|
||||
PythonPolicy(const PythonPolicy&);
|
||||
PythonPolicy& operator=(const PythonPolicy&);
|
||||
|
||||
|
|
|
@ -56,10 +56,9 @@ PythonPolicyManager::get_policy()
|
|||
void
|
||||
PythonPolicyManager::init()
|
||||
{
|
||||
if(_initialized) {
|
||||
_python_policy = std::auto_ptr<PythonPolicy>(0);
|
||||
Py_Finalize();
|
||||
}
|
||||
if(_initialized)
|
||||
// No-op
|
||||
return;
|
||||
|
||||
Py_Initialize();
|
||||
_initialized = true;
|
||||
|
|
|
@ -67,17 +67,18 @@ namespace sgpem
|
|||
*/
|
||||
static PythonPolicyManager* const get_instance();
|
||||
|
||||
private:
|
||||
protected:
|
||||
/** The selected and active PyhonPolicy object. */
|
||||
PythonPolicyManager();
|
||||
std::auto_ptr<PythonPolicy> _python_policy;
|
||||
|
||||
private:
|
||||
PythonPolicyManager(const PythonPolicyManager&);
|
||||
PythonPolicyManager& operator=(const PythonPolicyManager&);
|
||||
|
||||
/** Singleton support. */
|
||||
static PythonPolicyManager* _instance;
|
||||
|
||||
/** The selected and active PyhonPolicy object. */
|
||||
std::auto_ptr<PythonPolicy> _python_policy;
|
||||
|
||||
bool _initialized;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue