LibMusicXML 3.22
factory.h
1/*
2 MusicXML Library
3 Copyright (C) Grame 2006-2013
4
5 This Source Code Form is subject to the terms of the Mozilla Public
6 License, v. 2.0. If a copy of the MPL was not distributed with this
7 file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9 Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
10 research@grame.fr
11*/
12
13#ifndef __factory__
14#define __factory__
15
16#include <string>
17#include <map>
18#include "functor.h"
19#include "singleton.h"
20#include "xml.h"
21
22namespace MusicXML2
23{
24
29
30class EXP factory : public singleton<factory>{
31
32 std::map<std::string, functor<Sxmlelement>*> fMap;
33 std::map<int, const char*> fType2Name;
34 public:
35 factory();
36 virtual ~factory() {}
37
38 Sxmlelement create(const std::string& elt) const;
39 Sxmlelement create(int type) const;
40};
41
42}
43
45
46#endif
Definition singleton.h:17