VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
systemSwitcherComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
10 
13 
14 #pragma once
15 
17 #include "vrfobjcore/simRadio.h"
18 
19 class DtComponentSystem;
22 
25 {
26 public:
27 
29  DtSystemSwitcherComponent(const DtString & name, DtLocalObject* owner,
30  DtSimulationServices * simManager, DtComponentDescriptor* desc = NULL,
31  DtReaderWriterRegistry * parentRegistry = 0);
32 
34  virtual ~DtSystemSwitcherComponent();
35 
37  virtual bool init();
38 
41  virtual const char* type() const;
42 
43  virtual void tick();
44 
47  virtual void enable();
48 
51  virtual void disable();
52 
53  virtual bool transitionIsComplete() const;
54 
55  virtual void onTransitionComplete();
56 
57 public:
58 
59  static void setSwitchSystemsCallback(DtSimMessage * msg, void * usrData);
60 
61 
63  static DtSimComponent* creator(const DtString & name, DtLocalObject* owner,
64  DtSimulationServices * simManager, DtComponentDescriptor* desc,
65  DtReaderWriterRegistry * parentRegistry);
66 
67 protected:
68 
71 
74 
76  virtual void setRadio(DtSimRadio * radio);
77 
78  virtual bool createPSR();
79 
82  virtual void addSetDataCallbacks();
83 
86  void removeSetDataCallbacks();
87 
88  virtual void processSetSwitchSystems(DtSimMessage * msg);
89 
92  virtual bool switchSystems();
93 
96  void enableComponentSystem(DtComponentSystem* activateSystem);
97  void disableComponentSystem(DtComponentSystem* deactivateSystem);
98  void enableSimComponent(DtSimComponent* simComponent);
99  void disableSimComponent(DtSimComponent* simComponent);
101 
104  virtual bool allowedToTransition() const;
105 
106 protected:
107 
111 
113 
115 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtSwitchSystemComponentPSR * myProcessState
Definition: systemSwitcherComponent.h:112
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
Definition: simRadio.h:30
DtComponentSystem * mySystemToActivate
Definition: systemSwitcherComponent.h:110
virtual void setRadio(DtSimRadio *radio)
virtual void enable() override
Enables the component and resends capable tasks and sets.
bool mySwitchingSystems
Definition: systemSwitcherComponent.h:114
A set of DtSimComponent and DtComponentSystem instances that are connected with a set of connections...
Definition: simComponentNetwork.h:34
A DtComponentSystem is a collection of DtSimComponents that are associated with each other...
Definition: componentSystem.h:35
virtual const char * type() const =0
This returns a string from compTypes.h, and identifies the type of component.
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
Definition: systemSwitcherComponent.h:24
virtual void disable()
Is this component enabled or not. If enabled, component's tick function will be called, otherwise it will not. Default is true (enabled).
virtual bool init() override
Calls setRadio()
DtComponentSystem * mySystemToDeactivate
Definition: systemSwitcherComponent.h:109
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:31
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:95
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
Definition: switchSystemComponentPSR.h:21
DtSimComponentNetwork * myComponentNetwork
Definition: systemSwitcherComponent.h:108
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

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)