Ver código fonte

JobPool.cpp Skeleton.

git-svn-id: https://svn.microneil.com/svn/SNF4CGP/trunk@17 59e8e3e7-56fa-483b-b4b4-fa6ab0af3dfc
master
madscientist 15 anos atrás
pai
commit
46123c5a75
2 arquivos alterados com 125 adições e 1 exclusões
  1. 121
    0
      SNF4CGP/JobPool.cpp
  2. 4
    1
      SNF4CGP/JobPool.hpp

+ 121
- 0
SNF4CGP/JobPool.cpp Ver arquivo

@@ -1,3 +1,124 @@
// SNF4CGP/JobPool.cpp
// Copyright (C) 2009 ARM Research Labs, LLC.
// See www.armresearch.com for more information.
#include "JobPool.hpp"
#include "Command.hpp"
#include "ScannerPool.hpp"
#include "../CodeDweller/threading.hpp"
#include "../CodeDweller/faults.hpp"
#include <iostream>
#include <vector>
using namespace std;
//// Job ///////////////////////////////////////////////////////////////////////
void Job::doWakeUp() {
}
void Job::doINTF() {
}
void Job::doFAIL() {
}
void Job::doFILE() {
}
void Job::doRead() {
}
void Job::doScan() {
}
void Job::doAction() {
}
void Job::doBypass() {
}
void Job::doAllow() {
}
void Job::doReject() {
}
void Job::doDelete() {
}
void Job::doHold() {
}
/*
ScannerPool& Scanners; // Knows where to get scanners.
OutputProcessor& Output;
Command CurrentCommand; // Has a current comand.
string OutputBuffer; // Preserves an output buffer.
vector<unsigned char> ReadBuffer; // Preserves a file read buffer.
unsigned int ReadLength; // How much data in the buffer.
*/
Job::Job(ScannerPool& S, OutputProcessor& O) : // Construct with important links.
Scanners(S),
Output(O),
ReadLength(0) {
}
Job::~Job() { // Cleanup when destructing.
}
void Job::setCommand(Command& C) { // Assign a command for this job.
}
void Job::doIt() { // Get the job done.
}
string& Job::Responses() { // Read the job's report.
}
void Job::clear() { // Cleanup for the next command.
}
//// JobPool ///////////////////////////////////////////////////////////////////
JobPool::JobPool() : // Simple constructor.
Output_(0),
Scanners_(0),
AllocatedJobs(0),
Started(false) {
}
JobPool::~JobPool() { // Clean up on the way out.
try { stop(); }
catch(...) {}
}
// Watch out -- Initializing the JobPool also means starting up SNFMulti and
// the ScannerPool.
void JobPool::init(string Configuration, OutputProcessor& O) { // Initialize the JobPool.
}
Job* JobPool::makeJob() { // Create and count a Job.
}
Job& JobPool::grab() { // Grab a job (prefer from the pool).
}
void JobPool::drop(Job& J) { // Drop a job into the pool.
}
void JobPool::killJobFromPool() { // Kill and count a Job from the pool.
}
// Watch out -- Stopping the JobPool also means shutting down SNFMulti and
// the ScannerPool.
void JobPool::stop() { // Shut down the JobPool.
// Kill off all of the allocated Jobs.
// Shut down and destroy the ScannerPool.
}

+ 4
- 1
SNF4CGP/JobPool.hpp Ver arquivo

@@ -60,7 +60,7 @@ class Job {
void doHold();
public:
Job(ScannerPool& S, OutputProcessor O); // Construct with important links.
Job(ScannerPool& S, OutputProcessor& O); // Construct with important links.
~Job(); // Cleanup when destructing.
void setCommand(Command& C); // Assign a command for this job.
void doIt(); // Get the job done.
@@ -81,6 +81,9 @@ class JobPool {
bool Started; // True if we're ready to go.
Job* makeJob(); // Create and count a Job.
void killJobFromPool(); // Kill and count a Job from the pool.
public:
JobPool(); // Basic construction.
~JobPool(); // Safe cleanup on destruction.

Carregando…
Cancelar
Salvar