2016-08-24 01:35:59 +00:00
|
|
|
//
|
|
|
|
// StaticAnalyser.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 23/08/2016.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2016 Thomas Harte. All rights reserved.
|
2016-08-24 01:35:59 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef StaticAnalyser_hpp
|
|
|
|
#define StaticAnalyser_hpp
|
|
|
|
|
2018-01-25 02:48:44 +00:00
|
|
|
#include "../Machines.hpp"
|
|
|
|
|
|
|
|
#include "../../Storage/Cartridge/Cartridge.hpp"
|
2019-08-25 19:10:09 +00:00
|
|
|
#include "../../Storage/Disk/Disk.hpp"
|
|
|
|
#include "../../Storage/MassStorage/MassStorageDevice.hpp"
|
|
|
|
#include "../../Storage/Tape/Tape.hpp"
|
2016-08-27 22:26:51 +00:00
|
|
|
|
2018-04-14 16:12:12 +00:00
|
|
|
#include <memory>
|
2016-08-24 01:35:59 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2018-01-25 02:48:44 +00:00
|
|
|
namespace Analyser {
|
|
|
|
namespace Static {
|
2016-08-24 01:35:59 +00:00
|
|
|
|
2017-08-17 14:48:29 +00:00
|
|
|
/*!
|
|
|
|
A list of disks, tapes and cartridges.
|
|
|
|
*/
|
|
|
|
struct Media {
|
2018-01-24 03:18:16 +00:00
|
|
|
std::vector<std::shared_ptr<Storage::Disk::Disk>> disks;
|
|
|
|
std::vector<std::shared_ptr<Storage::Tape::Tape>> tapes;
|
|
|
|
std::vector<std::shared_ptr<Storage::Cartridge::Cartridge>> cartridges;
|
2019-08-25 19:10:09 +00:00
|
|
|
std::vector<std::shared_ptr<Storage::MassStorage::MassStorageDevice>> mass_storage_devices;
|
2017-12-02 21:01:30 +00:00
|
|
|
|
|
|
|
bool empty() const {
|
2019-08-25 19:10:09 +00:00
|
|
|
return disks.empty() && tapes.empty() && cartridges.empty() && mass_storage_devices.empty();
|
2017-12-02 21:01:30 +00:00
|
|
|
}
|
2017-08-17 14:48:29 +00:00
|
|
|
};
|
|
|
|
|
2016-08-28 16:20:40 +00:00
|
|
|
/*!
|
|
|
|
A list of disks, tapes and cartridges plus information about the machine to which to attach them and its configuration,
|
|
|
|
and instructions on how to launch the software attached, plus a measure of confidence in this target's correctness.
|
|
|
|
*/
|
2016-08-24 01:35:59 +00:00
|
|
|
struct Target {
|
2018-03-09 20:36:11 +00:00
|
|
|
virtual ~Target() {}
|
|
|
|
|
2018-01-25 02:48:44 +00:00
|
|
|
Machine machine;
|
2018-01-25 03:35:54 +00:00
|
|
|
Media media;
|
2018-01-26 00:02:16 +00:00
|
|
|
float confidence;
|
2016-08-24 01:35:59 +00:00
|
|
|
};
|
2018-04-14 16:12:12 +00:00
|
|
|
typedef std::vector<std::unique_ptr<Target>> TargetList;
|
2016-08-24 01:35:59 +00:00
|
|
|
|
2016-08-28 16:20:40 +00:00
|
|
|
/*!
|
|
|
|
Attempts, through any available means, to return a list of potential targets for the file with the given name.
|
2017-11-08 03:51:06 +00:00
|
|
|
|
2016-08-28 16:20:40 +00:00
|
|
|
@returns The list of potential targets, sorted from most to least probable.
|
|
|
|
*/
|
2018-04-14 16:12:12 +00:00
|
|
|
TargetList GetTargets(const std::string &file_name);
|
2016-08-24 01:35:59 +00:00
|
|
|
|
2017-08-17 14:48:29 +00:00
|
|
|
/*!
|
|
|
|
Inspects the supplied file and determines the media included.
|
|
|
|
*/
|
2018-04-06 21:42:24 +00:00
|
|
|
Media GetMedia(const std::string &file_name);
|
2017-08-17 14:48:29 +00:00
|
|
|
|
2018-01-25 02:48:44 +00:00
|
|
|
}
|
2016-08-24 01:35:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* StaticAnalyser_hpp */
|