VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtVisualizerAttributeFactory.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2011 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvCore/vrvCore.h>
14 #include <vrvUtil/DtUnicode.h>
15 #include <boost/unordered_map.hpp>
16 
17 namespace makVrv
18 {
19  class DtVisualizerAttribute;
20  class DtDe;
21 
26  {
27  public:
28 
32  {
33  public:
35  virtual ~CreatorInterface();
36 
38  virtual DtVisualizerAttribute* create() = 0;
39 
40  virtual const DtVisualizerAttribute::TypeInfo& attributeTypeInfo() const
41  = 0;
42  };
43 
45  template <typename Attribute>
46  class Creator : public CreatorInterface
47  {
48  public:
49  virtual DtVisualizerAttribute* create()
50  {
51  return new Attribute();
52  }
53 
54  virtual const DtVisualizerAttribute::TypeInfo& attributeTypeInfo() const
55  {
56  return Attribute::theTypeInfo();
57  }
58  };
59 
61  static DtVisualizerAttributeFactory& instance(DtDe&);
62 
65  static void registerInstance(DtDe&, DtVisualizerAttributeFactory*);
66 
69 
71  virtual DtVisualizerAttribute* create(const std::string& className);
72 
73 
76  virtual DtVisualizerAttribute* create(const std::string& className,
77  const DtUnicode& value);
78 
81  virtual void registerClass(CreatorInterface* creator);
82 
83  protected:
85 
86  protected:
87  typedef boost::unordered_map<std::string, CreatorInterface*> CreatorMap;
91  };
92 }
93 

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)