Commit 207cacca authored by David COME's avatar David COME
Browse files

Cleaned up interfaces to removed endOfWork remains and make functions virtual...

Cleaned up interfaces to removed endOfWork remains and make functions virtual pure when it was possible
parent a371bd4d
......@@ -37,13 +37,14 @@ class DiskReadTask :public DiskReadTaskInterface {
public:
DiskReadTask(DataConsumer & destination, int fileId, int nbBlocks): m_fileId(fileId),
m_nbBlocks(nbBlocks), m_fifo(destination) {}
/* Implementation of the DiskReadTask interface*/
virtual bool endOfWork() { return false; }
virtual void execute() {
for (int blockId=0; blockId < m_nbBlocks; blockId++) {
MemBlock * mb = m_fifo.getFreeBlock();
mb->m_fileid = m_fileId;
mb->m_fileBlock = blockId;
//TODO fill mb. Somehow we need a disk
m_fifo.pushDataBlock(mb);
}
}
......
......@@ -33,10 +33,7 @@ namespace daemon {
class DiskReadTaskInterface {
public:
virtual bool endOfWork() = 0;
virtual void execute() {
throw MemException("Tring to execute a non-execuatble DiskReadTask");
};
virtual void execute() =0;
virtual ~DiskReadTaskInterface() {}
};
......
......@@ -38,27 +38,20 @@ namespace daemon {
class DiskWriteTaskInterface {
public:
/**
* TODO: see comment on the same function in DiskWriteFileTask.
*/
virtual bool endOfWork() = 0;
/**
* @return the number of memory blocks to be used
*/
virtual int blocks() { return 0; }
virtual int blocks() =0;
/**
* @return the number of files to write to disk
*/
virtual int files() { return 0; }
virtual int files() =0;
/**
* Main routine of the task
*/
virtual void execute() {
throw MemException("Trying to execute a non-executable DiskWriteTask");
};
virtual void execute() =0;
/**
* Wait for the end of the task
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment