forked from viva64/plog-converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutputfactory.h
36 lines (26 loc) · 806 Bytes
/
outputfactory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// 2006-2008 (c) Viva64.com Team
// 2008-2020 (c) OOO "Program Verification Systems"
#ifndef OUTPUTFACTORY_H
#define OUTPUTFACTORY_H
#include <iostream>
#include <fstream>
#include <string>
#include <unordered_map>
#include <functional>
#include <memory>
#include "ioutput.h"
namespace PlogConverter
{
class OutputFactory
{
public:
using AllocFunction = std::function<std::unique_ptr<IOutput>(const ProgramOptions&)>;
OutputFactory();
std::unique_ptr<IOutput> createOutput(const ProgramOptions &opt, const std::string& format);
void registerOutput(const std::string& format, AllocFunction f);
const std::unordered_map<std::string, AllocFunction>& getMap() const { return m_formats; }
private:
std::unordered_map<std::string, AllocFunction> m_formats;
};
}
#endif // OUTPUTFACTORY_H