VR-Forces 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 #include <boost/unordered_map.hpp>
15 
18 class DtLocalObject;
20 
29 {
30 private:
37 
38 public:
40 
42  virtual bool init();
43 
44 public:
46 
50 
51  virtual void registerCommunicationInterface(DtSimInternalCommunicationInterface* commIf);
52  virtual void unregisterCommunicationInterface(DtSimInternalCommunicationInterface* commIf);
54 
57  virtual void deliverMessage(const DtVrfObjectMessage* message);
58 
60  virtual void tick();
61 
63  virtual void clearQueue();
64 
66  {
67  return mySimulationServices;
68  }
69 
72  virtual void deliverMessageLocally(const DtVrfObjectMessage* message);
73 
76  virtual void deliverMessageRemotely(const DtVrfObjectMessage* message);
77 
78 protected:
80 
81  static void deliverRadioMessageCallback(DtSimMessage* msg, void* usr);
82  virtual void processDeliverRadioMessage(DtSimMessage* msg);
84 
86  virtual bool objectShouldReceiveMessage(DtLocalObject* vrfObj, const DtVrfObjectMessage* msg);
87 
88  virtual void processUUIDChanged(const DtUUID& oldUUID, const DtUUID& newUUID);
89 
90 protected:
91 
93  typedef boost::unordered_map<DtUUID, std::set<DtSimInternalCommunicationInterface*> > DtCommInterfaceList;
95 
96  typedef std::deque<DtVrfObjectMessage*> DtMessageDeque;
99 
100  typedef tbb::spin_mutex Mutex;
102 
103  mutable tbb::spin_mutex myInterfaceMutex;
104 
105  boost::signals2::scoped_connection myUUIDChangedConnection;
106 };
std::deque< DtVrfObjectMessage * > DtMessageDeque
Definition: simInternalCommunicationManager.h:96
UUID is a unique ID wrapper class.
Definition: uuid.h:59
boost::unordered_map< DtUUID, std::set< DtSimInternalCommunicationInterface * > > DtCommInterfaceList
Definition: simInternalCommunicationManager.h:93
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:28
DtCommInterfaceList myCommInterfaceList
Definition: simInternalCommunicationManager.h:94
DtMessageDeque myMessagesToDeliver
Queue which stores messages that need to be delivered.
Definition: simInternalCommunicationManager.h:98
boost::signals2::scoped_connection myUUIDChangedConnection
Definition: simInternalCommunicationManager.h:105
Arguments passed by the DtLocalObjectManager::addUUIDChangedCallback callbacks.
Definition: localObjectManager.h:125
DtSimulationServices * simulationServices() const
Definition: simInternalCommunicationManager.h:65
DtSimulationServices * mySimulationServices
Definition: simInternalCommunicationManager.h:92
#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:96
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
tbb::spin_mutex Mutex
Definition: simInternalCommunicationManager.h:100
Mutex myMessageMutex
Definition: simInternalCommunicationManager.h:101
tbb::spin_mutex myInterfaceMutex
Definition: simInternalCommunicationManager.h:103
A locally simulated VRF object.
Definition: localObject.h:98

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)