forked from noj/fixfilt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfixdb.cpp
More file actions
41 lines (33 loc) · 1.01 KB
/
Copy pathfixdb.cpp
File metadata and controls
41 lines (33 loc) · 1.01 KB
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
37
38
39
40
41
// vim: ts=2 sw=2
#include "fix.hpp"
#include <algorithm>
#include "gen/fix40.hpp"
#include "gen/fix41.hpp"
#include "gen/fix42.hpp"
#include "gen/fix43.hpp"
#include "gen/fix44.hpp"
#include "gen/fix50.hpp"
#include <map>
namespace fix
{
namespace
{
static std::map<unsigned, Schema> schemas = {
{static_cast<unsigned> (Ver::FIX40), FIX40::load_schema ()},
{static_cast<unsigned> (Ver::FIX41), FIX41::load_schema ()},
{static_cast<unsigned> (Ver::FIX42), FIX42::load_schema ()},
{static_cast<unsigned> (Ver::FIX43), FIX43::load_schema ()},
{static_cast<unsigned> (Ver::FIX44), FIX44::load_schema ()},
{static_cast<unsigned> (Ver::FIX50), FIX50::load_schema ()},
};
}
const Schema & get_schema (Ver ver)
{
return schemas[static_cast<unsigned> (ver)];
}
const Schema & get_schema (boost::string_ref str_ver)
{
if (auto ver = parse_ver (str_ver)) return get_schema (*ver);
throw std::runtime_error ("Unknown fix version: " + str_ver.to_string ());
}
}