VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simInternalCommunicationManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2007 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 #include <set>
11 #include <deque>
12 #include <tbb/spin_mutex.h>
13 #include <boost/signals2.hpp>
14 
17 class DtLocalObject;
19 
28 {
29 private:
36 
37 public:
39 
41  virtual bool init();
42 
43 public:
45 
49 
50  virtual void registerCommunicationInterface(DtSimInternalCommunicationInterface* commIf);
51  virtual void unregisterCommunicationInterface(DtSimInternalCommunicationInterface* commIf);
53 
56  virtual void deliverMessage(const DtVrfObjectMessage* message);
57 
59  virtual void tick();
60 
62  virtual void clearQueue();
63 
65  {
66  return mySimulationServices;
67  }
68 
71  virtual void deliverMessageLocally(const DtVrfObjectMessage* message);
72 
75  virtual void deliverMessageRemotely(const DtVrfObjectMessage* message);
76 
77 protected:
79 
80  static void deliverRadioMessageCallback(DtSimMessage* msg, void* usr);
81  virtual void processDeliverRadioMessage(DtSimMessage* msg);
83 
85  virtual bool objectShouldReceiveMessage(DtLocalObject* vrfObj, const DtVrfObjectMessage* msg);
86 
87  virtual void processUUIDChanged(const DtUUID& oldUUID, const DtUUID& newUUID);
88 
89 protected:
90 
92  typedef boost::unordered_map<DtUUID, std::set<DtSimInternalCommunicationInterface*> > DtCommInterfaceList;
94 
95  typedef std::deque<DtVrfObjectMessage*> DtMessageDeque;
98 
99  typedef tbb::spin_mutex Mutex;
101 
102  mutable tbb::spin_mutex myInterfaceMutex;
103 
104  boost::signals2::scoped_connection myUUIDChangedConnection;
105 };
std::deque< DtVrfObjectMessage * > DtMessageDeque
Definition: simInternalCommunicationManager.h:95
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
boost::unordered_map< DtUUID, std::set< DtSimInternalCommunicationInterface * > > DtCommInterfaceList
Definition: simInternalCommunicationManager.h:92
The handler for all SimInternal messages that are sent to and from a specified DtLocalObject. This class is the central interface of a DtLocalObject to the SimInternal message system of inter-VrfObject communication. Callbacks can be registered for message receipt and messages can be sent. Normally, components on an entity will register with 3CommunicationInterface instead of with this object directly.
Definition: simInternalCommunicationInterface.h:20
The manager for SimInternal messages on a single simulation engine. This class manages the passing of...
Definition: simInternalCommunicationManager.h:27
DtCommInterfaceList myCommInterfaceList
Definition: simInternalCommunicationManager.h:93
DtMessageDeque myMessagesToDeliver
Queue which stores messages that need to be delivered.
Definition: simInternalCommunicationManager.h:97
boost::signals2::scoped_connection myUUIDChangedConnection
Definition: simInternalCommunicationManager.h:104
Arguments passed by the DtLocalObjectManager::addUUIDChangedCallback callbacks.
Definition: localObjectManager.h:119
DtSimulationServices * simulationServices() const
Definition: simInternalCommunicationManager.h:64
DtSimulationServices * mySimulationServices
Definition: simInternalCommunicationManager.h:91
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
File: simMsg.h.
Definition: simMessage.h:35
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
tbb::spin_mutex Mutex
Definition: simInternalCommunicationManager.h:99
Mutex myMessageMutex
Definition: simInternalCommunicationManager.h:100
tbb::spin_mutex myInterfaceMutex
Definition: simInternalCommunicationManager.h:102
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 Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)