VR-Vantage API Documentation
DtMessageDispatcher.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtMessageDispatcher.h,v $ $Revision: 1.29 $ $State: Exp $
7 ******************************************************************************/
8 
11 
12 #ifndef DtMessageDispatcher_H_
13 #define DtMessageDispatcher_H_
14 
15 #include <map>
16 #include <list>
17 #include <string>
18 #include <vector>
19 #include <vrvUtil/DtMessage.h>
20 
21 #include <vrvCore/vrvCore.h>
22 
23 namespace makVrv
24 {
25 
26  class DtDe;
27  class DtProctor;
28  class DtProxy;
29  class DtMessage;
30  class DtMessageClient;
31 
35  {
36  public:
37 
38  enum
39  {
40  theInternalControlId = 1
41  };
42 
43  enum
44  {
45  id_AddInterfaceMap = 1
46  };
47 
49  DtMessageDispatcher(bool isMaster);
50 
53  typedef unsigned short IGIInterfaceID;
54 
56  virtual ~DtMessageDispatcher();
57 
62  void registerProctor(int classId, DtProctor* handler);
63 
65  DtProctor* findProctor(int classId);
66 
68  void deliverFromClients();
69 
71  void deliverToClients();
72 
75  void queueForDelivery(DtMessage* msg, bool toClients = true,bool toLocalInterface = false);
76 
78  void addClient(DtMessageClient* client);
79 
81  void removeClient(DtMessageClient* client);
82 
84  bool hasClients() const;
85 
87  bool isMaster() const;
88 
90  void setIsMaster(bool isMaster);
91 
92  protected:
93 
95  void sendInterfaceMapToClients(IGIInterfaceID id, const std::string& name);
96 
100 
103 
104  typedef std::list<DtMessageClient*> ClientList;
107 
108  typedef std::map<std::string,IGIInterfaceID> NameIdMap;
110 
111  typedef std::map<IGIInterfaceID,DtProxy*> IdInterfaceMap;
113 
114  typedef std::list<DtProxy*> InterfaceList;
116 
117  typedef std::map<int, DtProctor*> ProctorTable;
119 
120  typedef std::vector<DtMessage*> MessageList;
122  };
123 
124 }
125 #endif


Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)