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 
56  virtual DtStateComponent::StateComponentType stateComponentTypeWithCreator(const std::string& creator) const;
57 
60  virtual bool autoCreateForRemoteObject(DtStateComponent::StateComponentType) const;
61 
62  protected:
63  typedef std::map<DtStateComponent::StateComponentType, DtStateComponentCreatorInterface*> StateComponentCreatorMap;
65 
66  typedef std::map<std::string, DtStateComponentCreatorInterface*> StateComponentCreatorByNameMap;
68  };
69 }
70 
71 #define REGISTER_STATE_COMPONENT(ComponentCreator, Component) \
72  UInt32 Register##ComponentCreator = DtStateComponentFactory::instance()->addStateComponentCreator(#ComponentCreator, ComponentCreator::ComponentType(), new ComponentCreator); \
73  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
Definition: stateComponentFactory.h:64
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
Definition: stateComponentFactory.h:66
std::map< DtStateComponent::StateComponentType, DtStateComponentCreatorInterface * > StateComponentCreatorMap
Definition: stateComponentFactory.h:63
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:398
StateComponentCreatorByNameMap myStateComponentCreatorByNameMap
Definition: stateComponentFactory.h:67
The creator that is used to create a state component.
Definition: stateComponent.h:256
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:26
Contains the DtStateComponent class declaration.

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)