VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtMessageDispatcher.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <map>
12 #include <list>
13 #include <string>
14 #include <vector>
15 #include <vrvUtil/DtMessage.h>
16 
17 #include <vrvCore/vrvCore.h>
18 
19 namespace makVrv
20 {
21 
22  class DtDe;
23  class DtProctor;
24  class DtProxy;
25  class DtMessage;
26  class DtMessageClient;
27  class DtUdpMessageClient;
28 
32  {
33  public:
34 
35  enum
36  {
37  theInternalControlId = 1
38  };
39 
40  enum
41  {
42  id_AddInterfaceMap = 1
43  };
44 
46  DtMessageDispatcher(bool isMaster);
47 
50  typedef unsigned short IGIInterfaceID;
51 
53  virtual ~DtMessageDispatcher();
54 
59  void registerProctor(int classId, DtProctor* handler);
60 
62  DtProctor* findProctor(int classId);
63 
65  void deliverFromClients();
66 
68  void deliverToClients();
69 
72  void queueForDelivery(DtMessage* msg, bool toClients = true,bool toLocalInterface = false);
73 
75  void addClient(DtMessageClient* client);
76 
78  void removeClient(DtMessageClient* client);
79 
80  void setUdpClient(DtUdpMessageClient* udpClient);
81 
82  void removeUdpClient();
83 
84 
86  bool hasClients() const;
87 
89  bool isMaster() const;
90 
92  void setIsMaster(bool isMaster);
93 
94  protected:
95 
97  void sendInterfaceMapToClients(IGIInterfaceID id, const std::string& name);
98 
102 
105 
106  typedef std::list<DtMessageClient*> ClientList;
109 
111 
112  typedef std::map<std::string,IGIInterfaceID> NameIdMap;
114 
115  typedef std::map<IGIInterfaceID,DtProxy*> IdInterfaceMap;
117 
118  typedef std::list<DtProxy*> InterfaceList;
120 
121  typedef std::map<int, DtProctor*> ProctorTable;
123 
124  typedef std::vector<DtMessage*> MessageList;
126  };
127 
128 }
129 
std::map< std::string, IGIInterfaceID > NameIdMap
Definition: DtMessageDispatcher.h:112
MessageList myMessageQueue
Definition: DtMessageDispatcher.h:125
The IGI Message. Is easily encoded and decoding using stream operators. It also provides validation d...
Definition: DtMessage.h:30
NameIdMap myIdLookUp
Definition: DtMessageDispatcher.h:113
InterfaceList myUnknownInterfaceList
Definition: DtMessageDispatcher.h:119
DtUdpMessageClient * myUdpClient
Definition: DtMessageDispatcher.h:110
std::map< IGIInterfaceID, DtProxy * > IdInterfaceMap
Definition: DtMessageDispatcher.h:115
Base class for Proctor classes.
Definition: DtProctor.h:21
std::map< int, DtProctor * > ProctorTable
Definition: DtMessageDispatcher.h:121
std::list< DtMessageClient * > ClientList
Definition: DtMessageDispatcher.h:106
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
IdInterfaceMap myInstanceLookUp
Definition: DtMessageDispatcher.h:116
std::vector< DtMessage * > MessageList
Definition: DtMessageDispatcher.h:124
bool myIsMasterFlag
Holds whether the IGI Manager is the master manager. The server should always be the master manager...
Definition: DtMessageDispatcher.h:101
IGI Client is responsible for delivering IGI messages to other remote managers. IGI Client is the abs...
Definition: DtMessageClient.h:27
IGI Manager managers both IGI clients and IGI interfaces.
Definition: DtMessageDispatcher.h:31
ProctorTable myProctors
Definition: DtMessageDispatcher.h:122
ClientList myClients
My list of clients.
Definition: DtMessageDispatcher.h:108
std::list< DtProxy * > InterfaceList
Definition: DtMessageDispatcher.h:118
unsigned short IGIInterfaceID
The IGIInterfaceID type. An IGIInterfaceID uniquely defines an instance.
Definition: DtMessageDispatcher.h:50
A remote UDP client that the UDP server communicates with.
Definition: DtUdpMessageClient.h:27
IGIInterfaceID myFreeInterfaceId
Internal id used to generate IDs.
Definition: DtMessageDispatcher.h:104
Contains DLL export macros.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)