masters-thesis/op-finder/OperationStorage.hpp

33 lines
826 B
C++

//
// Created by erki on 28.02.21.
//
#ifndef C_ANALYZER_OPERATIONSTORAGE_HPP
#define C_ANALYZER_OPERATIONSTORAGE_HPP
#include <string>
#include <unordered_map>
#include <vector>
#include "OperationLog.hpp"
class OperationStorage : public IOperationOutput
{
public:
OperationStorage() = delete;
OperationStorage(const OperationStorage&) = delete;
explicit OperationStorage(const std::string& output_filename);
~OperationStorage() override;
void pushOperation(const std::string& filename, const OperationLog& op) override;
[[nodiscard]] const std::unordered_map<std::string, std::vector<OperationLog>>& getOperations() const;
private:
std::unordered_map<std::string, std::vector<OperationLog>> _operations;
std::string _output_filename;
void _dumpToFile();
};
#endif //C_ANALYZER_OPERATIONSTORAGE_HPP