VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
networkEventManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
9 #include <boost/signals2.hpp>
10 
11 #include <tbb/spin_rw_mutex.h>
12 
34 
35 class DtExerciseConn;
37 class DtVrfTDLMessage;
39 
41 {
42 private:
47 
48 public:
50  virtual ~DtNetworkEventManager();
51 
54  virtual void addEvent(const DtEvent&);
55 
56  DtExerciseConn* exerciseConnection() const
57  {
58  return myExerciseConnection;
59  }
60 
62  virtual void setExerciseConnection(DtExerciseConn*);
63 
66  virtual const DtSimulationAddress& messageAddress() const;
67 
68 #if DtHLA
69  virtual void setTransportTypeReliable(int contentType);
71 
76  virtual void setTransportTypeBestEffort(int contentType);
77 
79  virtual bool sendReliable(const DtVrfTDLMessage& message) const;
80  virtual bool sendReliable(const DtSimInterfaceMessage& message) const;
81 #endif
82 
85  virtual void setProcessNetworkEventsLocally(bool);
87  {
88  return myProcessNetworkEventsLocally;
89  }
90 
91 public:
92  boost::signals2::signal<void (const DtEvent&)> signal_sendingEventOnNetwork;
93 
95  virtual bool selfReflecting(const DtEvent&) const;
96  virtual bool selfReflecting() const;
97 
98  static DtEventManager* creator();
99 
100 protected:
101  virtual void removeExerciseConnectionCallbacks();
102  virtual void installExerciseConnectionCallbacks();
103 
104 #if DtHLA
105  static void influenceCallback(DtInfluenceInteraction*, void*);
106  virtual void processInfluence(DtInfluenceInteraction*);
107 
108  static char* dataInteractionChooser(
109  DtExerciseConn* exConn, const DtInteraction& inter);
110 #endif
111  static void commentInteractionCallback(DtCommentInteraction *inter, void* usr);
112  virtual void processCommentInteraction(DtCommentInteraction* ctrlInter);
113 
114  static void fireCallback(DtFireInteraction*, void*);
115  virtual void processFireCallback(DtFireInteraction*);
116 
117  static void setGimbalControlCallback(DtSensorFieldOfViewControlInter* ctrlInter, void* usr);
118  virtual void processGimbalControl(DtSensorFieldOfViewControlInter* ctrlInter);
119 
120  static void detonationCallback(DtDetonationInteraction*, void*);
121  virtual void processDetonationCallback(DtDetonationInteraction*);
122 
123  static void startResumeInterationCallback(DtStartResumeInteraction* d, void* u);
124  virtual void processStartResumeInteractionCallback(DtStartResumeInteraction* d);
125 
126  static void stopFreezeInterationCallback(DtStopFreezeInteraction* d, void* u);
127  virtual void processStopFreezeInteractionCallback(DtStopFreezeInteraction* d);
128 
130  virtual bool isNetworkEvent(const DtEvent&) const;
131 
133  virtual bool sendNetworkEvent(const DtEvent&);
134 
135  static void netMessageCallback(DtDataInteraction* dataInter, void * usr);
136  virtual void processNetMessage(DtDataInteraction* dataInter);
137 
138  static void signalInteractionCallback(DtSignalInteraction* dataInter, void * usr);
139  virtual void processSignalInteraction(DtSignalInteraction* dataInter);
140 
141  static void serviceRequestCallback(DtServiceRequestInteraction*, void*);
142  virtual void processServiceRequestCallback(DtServiceRequestInteraction*);
143 
144  static void resupplyOfferCallback(DtResupplyOfferInteraction*, void*);
145  virtual void processResupplyOfferCallback(DtResupplyOfferInteraction*);
146 
147  static void resupplyReceivedCallback(DtResupplyRecInteraction*, void*);
148  virtual void processResupplyReceivedCallback(DtResupplyRecInteraction*);
149 
150  static void resupplyCancelCallback(DtResupplyCancelInteraction*, void*);
151  virtual void processResupplyCancelCallback(DtResupplyCancelInteraction*);
152 
153  virtual void initializeProtocolSpecific();
154 
155 protected:
156  DtExerciseConn* myExerciseConnection;
160 
161 #ifdef DtHLA
162 
165 
168  tbb::spin_rw_mutex myFedTimeMutex;
169 #endif
170 };
virtual bool selfReflecting() const
Wether or not an event added will be processed locally. Default is true.
boost::signals2::signal< void(const DtEvent &)> signal_sendingEventOnNetwork
Definition: networkEventManager.h:92
virtual void addEvent(const DtEvent &)
Connect to the individual event signal to only get notified for a particular event.
DtExerciseConn * myExerciseConnection
Definition: networkEventManager.h:156
DtSimInterfaceMessage is used to send a message to the front end or the back end. ...
Definition: simInterfaceMessage.h:32
std::set< int > myContentTypesToSendReliable
Set of content types to be sent via reliable transport.
Definition: networkEventManager.h:167
tbb::spin_rw_mutex myFedTimeMutex
Definition: networkEventManager.h:168
bool myProcessNetworkEventsLocally
Definition: networkEventManager.h:159
Definition: events.h:49
bool myCallbacksInstalled
Definition: networkEventManager.h:157
Definition: networkEventManager.h:40
Definition: eventManager.h:23
bool myAllowReliableDataInteractions
Whether reliable data interactions are supported.
Definition: networkEventManager.h:164
Definition: vrfTDLMessage.h:52
DtDetonationPdu DtDetonationInteraction
Definition: DistributedSimulationDriver3A.h:14
DtEventManager & operator=(const DtEventManager &)
Not implemented.
Contains the DtInterfaceMessageExecutive class declaration.
Definition: interfaceMessageExecutive.h:22
Instances of DtSensorFieldOfViewControlInter are used to store state data for SensorFieldOfViewContro...
Definition: sensorFieldOfViewControlInterDIS.h:51
Instances of DtInfluenceInter are used to store state data for Influence interactions.
Definition: influenceInteractionHLA.h:27
#define DT_DLL_vrfMsgTransport
This file is used to determine how to build.
Definition: vrfMsgTransportDefines.h:28
bool processNetworkEventsLocally() const
Definition: networkEventManager.h:86
bool myDataCallbackInstalled
Definition: networkEventManager.h:158
DtExerciseConn * exerciseConnection() const
Definition: networkEventManager.h:56

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)