Browse Source

JobPool.cpp Skeleton.

git-svn-id: https://svn.microneil.com/svn/SNF4CGP/trunk@17 59e8e3e7-56fa-483b-b4b4-fa6ab0af3dfc
master
madscientist 15 years ago
parent
commit
46123c5a75
2 changed files with 125 additions and 1 deletions
  1. 121
    0
      SNF4CGP/JobPool.cpp
  2. 4
    1
      SNF4CGP/JobPool.hpp

+ 121
- 0
SNF4CGP/JobPool.cpp View File

// SNF4CGP/JobPool.cpp // SNF4CGP/JobPool.cpp
// Copyright (C) 2009 ARM Research Labs, LLC. // Copyright (C) 2009 ARM Research Labs, LLC.
// See www.armresearch.com for more information. // 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 View File

void doHold(); void doHold();
public: public:
Job(ScannerPool& S, OutputProcessor O); // Construct with important links.
Job(ScannerPool& S, OutputProcessor& O); // Construct with important links.
~Job(); // Cleanup when destructing. ~Job(); // Cleanup when destructing.
void setCommand(Command& C); // Assign a command for this job. void setCommand(Command& C); // Assign a command for this job.
void doIt(); // Get the job done. void doIt(); // Get the job done.
bool Started; // True if we're ready to go. 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: public:
JobPool(); // Basic construction. JobPool(); // Basic construction.
~JobPool(); // Safe cleanup on destruction. ~JobPool(); // Safe cleanup on destruction.

Loading…
Cancel
Save