- Use strictier naming scheme for pyloader
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@812 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
43b817aaed
commit
1961283f85
7 changed files with 20 additions and 20 deletions
104
plugins/pyloader/src/python_cpu_policy.hh
Normal file
104
plugins/pyloader/src/python_cpu_policy.hh
Normal file
|
@ -0,0 +1,104 @@
|
|||
// src/python_cpu_policy.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 PYTHON_CPU_POLICY_HH
|
||||
#define PYTHON_CPU_POLICY_HH 1
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <Python.h>
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "cpu_policy.hh"
|
||||
#include "user_interrupt_exception.hh"
|
||||
|
||||
namespace sgpem
|
||||
{
|
||||
class PythonCPUPolicy;
|
||||
class PythonCPUPolicyManager;
|
||||
class UserInterruptException;
|
||||
|
||||
/** \brief A specialization of abstract class Policy
|
||||
|
||||
This class represents a policy written in Python. Its methods interact with Python interpreter.
|
||||
See the documentation of class Policy for more detailed informations.
|
||||
*/
|
||||
class SG_DLLEXPORT PythonCPUPolicy : public CPUPolicy
|
||||
{
|
||||
public:
|
||||
PythonCPUPolicy(const char* name);
|
||||
virtual ~PythonCPUPolicy();
|
||||
|
||||
/**
|
||||
Calls the method \c async_configure
|
||||
*/
|
||||
void configure() throw(UserInterruptException);
|
||||
|
||||
/**
|
||||
Calls the method \c async_sort_queue
|
||||
*/
|
||||
void sort_queue() const throw(UserInterruptException);
|
||||
|
||||
/**
|
||||
\returns A textual description of this policy.
|
||||
*/
|
||||
Glib::ustring get_description() const;
|
||||
|
||||
Glib::ustring get_name() const;
|
||||
|
||||
/**
|
||||
\returns \c TRUE if the policy is preemptive.
|
||||
\returns \c FALSE if the policy is not preemptive.
|
||||
*/
|
||||
bool is_pre_emptive() const throw(UserInterruptException);
|
||||
|
||||
/**
|
||||
\returns The integer value of its time-slice.
|
||||
*/
|
||||
int get_time_slice() const throw(UserInterruptException);
|
||||
|
||||
void activate()
|
||||
{
|
||||
//FIXME write code for me
|
||||
}
|
||||
|
||||
void deactivate()
|
||||
{
|
||||
//FIXME write code for me
|
||||
}
|
||||
|
||||
private:
|
||||
PythonCPUPolicy(const PythonCPUPolicy&);
|
||||
PythonCPUPolicy& operator=(const PythonCPUPolicy&);
|
||||
|
||||
void wait_unlock() const throw(UserInterruptException);
|
||||
|
||||
PyObject* _upolicy_dict;
|
||||
PyObject* _adapter;
|
||||
|
||||
Glib::ustring _name;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue