- Added ResourcePolicyManager

- Removed obsolete files

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@815 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-08-02 23:38:52 +00:00
parent 56a7ce1221
commit 10091d7a16
16 changed files with 52 additions and 752 deletions

View file

@ -97,20 +97,6 @@ TextSimulation::~TextSimulation()
{
}
/**
Adds an IO_device and creates a thread which loops the read-parse-execute process
*/
void
TextSimulation::add_io_device(smart_ptr<IOManager> io)
{
_devices.push_back(io);
//pair<TextSimulation*, int> p(this, 0);
//if (!io->is_full_duplex())
// Thread::create( sigc::bind(&TextSimulation::_io_loop, p), true);
}
bool
TextSimulation::check_arguments_num(const Tokens& arguments, unsigned int num)
{
@ -1317,6 +1303,9 @@ TextSimulation::p_stderr(const ustring& str)
ustring
TextSimulation::readline()
{
// TODO throw an exception when the stream returned by
// getline() has the fail, bad or eof bit set, because
// in this case the application should quit
string str;
getline(cin, str);
return str;
@ -1542,32 +1531,3 @@ TextSimulation::update(const History& changed_history)
p_stdout("\n");
}
void
TextSimulation::_io_loop(pair<TextSimulation* , int > pun)
{
while(true)
{
//reads the command
ustring str;
//the sgpem cursor appears only in the console
//if (!pun.first->_devices[pun.second]->is_full_duplex())
pun.first->_devices[pun.second]->write_buffer("\nSGPEM=> ");
str = pun.first->_devices[pun.second]->read_command();
pair< pair<TextSimulation*, IOManager*>, const ustring > p
(pair<TextSimulation*, IOManager*>(pun.first, &(*pun.first->_devices[pun.second])), str);
//if (pun.first->_devices[pun.second]->is_full_duplex())
//if the IOManager can read AND write at the same time then create a new thread
//thath will write to it while going on reading the next command
//Thread::create( sigc::bind(&TextSimulation::parse_command, p), true);
//else
//no read is possible: only write
// FIXME what was the purpose of this (_io_loop()) method
// need to comment out to make the code compile
//pun.first->parse_command(p);
}
}