VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtElementFactory.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
13 #include <vrvCore/DtElementEntry.h>
14 
16 
17 #include <unordered_map>
18 
19 namespace makVrv
20 {
21  class DtElementCreator;
22  class DtBaseConnection;
23  class DtElement;
24  class DtStateListener;
25 
29  {
30  public:
33  using CreatorMap = std::unordered_map<std::string, DtElementCreator*>;
34 
36  virtual ~DtElementFactory();
37 
41  DtElementFactory( const DtElementFactory& rhs );
42 
44  DtElementFactory& operator=( const DtElementFactory& rhs );
45 
47  static DtElementFactory& instance( DtDe& de );
48 
50  static DtElementFactory& instance( DtBaseConnection& con );
51 
53  virtual DtElementFactory* clone();
54 
57  static void copyInstance( DtBaseConnection& con, DtDe& de );
59 
61  const CreatorMap& creators() const;
62 
64  virtual void addElementCreator( DtDe& de,
65  DtElementCreator* creator );
66 
70  DtElement* createElement( DtElementEntry::ElementType type,
71  DtBaseConnection& connection, DtStateListener& listener, const std::string& tag );
72  protected:
75  protected:
77  };
78 }
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
CreatorMap myCreatorMap
Definition: DtElementFactory.h:76
A factory for DtElement&#39;s.
Definition: DtElementFactory.h:28
std::unordered_map< std::string, DtElementCreator * > CreatorMap
The key is the DtElementEntry::ElementType + creator-&gt;tag() Maps ElementType to creators.
Definition: DtElementFactory.h:33
The DtElement class implements the common behavior of simulation based elements added to the scene...
Definition: DtElement.h:44
The DtBaseConnection is an abstract class.
Definition: DtBaseConnection.h:35
Contains makVrv::DtVirtualBaseClass class.
Abstract DtElementCreator creator.
Definition: DtElement.h:246
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
ElementType
Definition: DtElementEntry.h:26
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
The DtStateListener is an abstract class. Subclasses implement functionality that will allow data to ...
Definition: DtStateListener.h:26
Contains makVrv::DtElementEntry class.
Contains DLL export macros.

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)