VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
stateComponentFactory.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 #include <map>
11 
12 namespace Legion
13 {
14  class SimulationDatabase;
15 }
16 
17 namespace makVrf
18 {
19  class DtStateData;
20 
25  {
26  public:
29 
31  virtual ~DtStateComponentFactory();
32 
34  static DtStateComponentFactory* instance();
35 
38  virtual DtStateComponent::StateComponentType addStateComponentCreator(const char* stateComponent, DtStateComponent::StateComponentType, DtStateComponentCreatorInterface*);
39 
43 
45  virtual DtStateComponent* createStateComponent(const std::string& name, DtStateData*) const;
46 
48  virtual void registerLegionComponents(Legion::SimulationDatabase* db);
49 
51  virtual void addAdditionalTableColumns(Legion::SimulationDatabase* db);
52 
54  virtual bool hasCreator(DtStateComponent::StateComponentType) const;
55 
59  virtual DtStateComponent::StateComponentType stateComponentTypeWithCreator(const std::string& creator) const;
60 
63  virtual bool autoCreateForRemoteObject(DtStateComponent::StateComponentType) const;
64 
65  protected:
67  typedef std::map<DtStateComponent::StateComponentType, DtStateComponentCreatorInterface*> StateComponentCreatorMap;
70 
72  typedef std::map<std::string, DtStateComponentCreatorInterface*> StateComponentCreatorByNameMap;
75  };
76 }
77 
82 #define REGISTER_STATE_COMPONENT(ComponentCreator, Component) \
83  UInt32 Register##ComponentCreator = DtStateComponentFactory::instance()->addStateComponentCreator(#ComponentCreator, ComponentCreator::ComponentType(), new ComponentCreator); \
84  UInt32 Component::theComponentCreatorType = 0xFFFFFFFF;
unsigned int StateComponentType
Definition: stateComponent.h:56
The state component factory contains creators for all the state components that can have double buffe...
Definition: stateComponentFactory.h:24
StateComponentCreatorMap myStateComponentCreatorMap
Stores all registered state component creators keyed by their combined creator/component type...
Definition: stateComponentFactory.h:69
DT_DLL_vrfmodel makVrf::DtDynamicTerrainStateComponent * createStateComponent(DtLocalObject *localObject)
Creates a new state component on the localObject and returns a pointer to it. Note that the state com...
std::map< std::string, DtStateComponentCreatorInterface * > StateComponentCreatorByNameMap
Map from creator registration name to the corresponding creator interface.
Definition: stateComponentFactory.h:72
std::map< DtStateComponent::StateComponentType, DtStateComponentCreatorInterface * > StateComponentCreatorMap
Map from creator-tagged StateComponentType to the corresponding creator interface.
Definition: stateComponentFactory.h:67
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
StateComponentCreatorByNameMap myStateComponentCreatorByNameMap
Stores all registered state component creators keyed by their string registration name...
Definition: stateComponentFactory.h:74
The creator that is used to create a state component.
Definition: stateComponent.h:299
Definition: stateComponent.h:52
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:29
Contains the DtStateComponent class declaration.

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)