// // Created by erki on 28.02.21. // #ifndef C_ANALYZER_OPERATIONSTORAGE_HPP #define C_ANALYZER_OPERATIONSTORAGE_HPP #include #include #include class OperationStorage { public: struct Log { std::string operation; unsigned int line; std::string operand_lhs; std::string operand_rhs; std::string operand_result; }; OperationStorage() = delete; OperationStorage(const OperationStorage&) = delete; explicit OperationStorage(const std::string& output_filename); ~OperationStorage(); void pushOperation(const std::string& filename, const Log& op); [[nodiscard]] const std::unordered_map>& getOperations() const; private: std::unordered_map> _operations; std::string _output_filename; void _dumpToFile(); }; #endif //C_ANALYZER_OPERATIONSTORAGE_HPP