OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
subviewfactoryimp.hpp
Go to the documentation of this file.
1 #ifndef CSV_DOC_SUBVIEWFACTORYIMP_H
2 #define CSV_DOC_SUBVIEWFACTORYIMP_H
3 
4 #include "../../model/doc/document.hpp"
5 
6 #include "subviewfactory.hpp"
7 
8 namespace CSVDoc
9 {
10  template<class SubViewT>
12  {
13  public:
14 
15  virtual CSVDoc::SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
16  };
17 
18  template<class SubViewT>
20  CSMDoc::Document& document)
21  {
22  return new SubViewT (id, document);
23  }
24 
25 
26  template<class SubViewT, class CreatorFactoryT>
28  {
29  bool mSorting;
30 
31  public:
32 
33  SubViewFactoryWithCreator (bool sorting = true);
34 
35  virtual CSVDoc::SubView *makeSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
36  };
37 
38  template<class SubViewT, class CreatorFactoryT>
40  : mSorting (sorting)
41  {}
42 
43  template<class SubViewT, class CreatorFactoryT>
45  const CSMWorld::UniversalId& id, CSMDoc::Document& document)
46  {
47  return new SubViewT (id, document, CreatorFactoryT(), mSorting);
48  }
49 }
50 
51 #endif
bool mSorting
Definition: subviewfactoryimp.hpp:29
virtual CSVDoc::SubView * makeSubView(const CSMWorld::UniversalId &id, CSMDoc::Document &document)
The ownership of the returned sub view is not transferred.
Definition: subviewfactoryimp.hpp:19
Definition: subview.hpp:23
Definition: subviewfactoryimp.hpp:27
Definition: document.hpp:57
virtual CSVDoc::SubView * makeSubView(const CSMWorld::UniversalId &id, CSMDoc::Document &document)
The ownership of the returned sub view is not transferred.
Definition: subviewfactoryimp.hpp:44
Definition: subviewfactory.hpp:17
SubViewFactoryWithCreator(bool sorting=true)
Definition: subviewfactoryimp.hpp:39
Definition: subviewfactoryimp.hpp:11
Definition: universalid.hpp:12