View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

messagerouter.h
Go to the documentation of this file.
1#ifndef MESSAGEROUTER_H
2#define MESSAGEROUTER_H
3
4#include "messages.h"
5#include "export.h"
6
7namespace vistle {
8
9class Communicator;
10class Parameter;
11class Port;
12
13namespace message {
14
16
17 Track = 0x000001,
18 NodeLocal = 0x000002,
19 ClusterLocal = 0x000004,
20
21 DestMasterHub = 0x000008,
22 DestSlaveHub = 0x000010,
23 DestLocalHub = 0x000020,
25 DestUi = 0x000040,
26 DestModules = 0x000080,
28 DestSlaveManager = 0x000200,
29 DestLocalManager = 0x000400,
31
32 Special = 0x000800,
34
35 //Broadcast = DestHub|DestUi|DestManager,
36 Broadcast = 0x100000,
38
39 HandleOnNode = 0x002000,
40 HandleOnRank0 = 0x004000,
41 HandleOnHub = 0x008000,
42 HandleOnMaster = 0x010000,
43 HandleOnDest = 0x020000,
44
45 QueueIfUnhandled = 0x040000,
46 TriggerQueue = 0x080000,
47 CleanQueue = 0x100000,
48
49 OnlyRank0 = 0x200000,
50};
51
53 friend class Message;
54
55public:
56 static Router &the();
57 static void init(Identify::Identity identity, int hubId);
58 static bool toRank0(const Message &msg);
59
60 bool toUi(const Message &msg, Identify::Identity senderType = Identify::UNKNOWN);
61 bool toMasterHub(const Message &msg, Identify::Identity senderType = Identify::UNKNOWN,
62 int senderHub = Id::Invalid);
63 bool toSlaveHub(const Message &msg, Identify::Identity senderType = Identify::UNKNOWN, int senderHub = Id::Invalid);
64 bool toManager(const Message &msg, Identify::Identity senderType = Identify::UNKNOWN, int senderHub = Id::Invalid);
65 bool toModule(const Message &msg, Identify::Identity senderType = Identify::UNKNOWN);
66 bool toTracker(const Message &msg, Identify::Identity senderType = Identify::UNKNOWN);
67 bool toHandler(const Message &msg, Identify::Identity senderType = Identify::UNKNOWN);
68
69private:
70 static unsigned rt[NumMessageTypes];
71 Router();
72 Identify::Identity m_identity;
73 int m_hubId;
74
75 static void initRoutingTable();
76};
77
78} // namespace message
79} // namespace vistle
80
81#endif
Definition: message.h:157
Definition: messagerouter.h:52
#define V_COREEXPORT
Definition: export.h:9
RoutingFlags
Definition: messagerouter.h:15
@ CleanQueue
Definition: messagerouter.h:47
@ DestUi
Definition: messagerouter.h:25
@ DestLocalHub
Definition: messagerouter.h:23
@ OnlyRank0
Definition: messagerouter.h:49
@ DestSlaveHub
Definition: messagerouter.h:22
@ Broadcast
Definition: messagerouter.h:36
@ DestManager
Definition: messagerouter.h:30
@ DestHub
Definition: messagerouter.h:24
@ QueueIfUnhandled
Definition: messagerouter.h:45
@ HandleOnRank0
Definition: messagerouter.h:40
@ DestSlaveManager
Definition: messagerouter.h:28
@ NodeLocal
Definition: messagerouter.h:18
@ DestMasterManager
Definition: messagerouter.h:27
@ DestMasterHub
Definition: messagerouter.h:21
@ Track
Definition: messagerouter.h:17
@ BroadcastModule
Definition: messagerouter.h:37
@ DestLocalManager
Definition: messagerouter.h:29
@ HandleOnHub
Definition: messagerouter.h:41
@ ClusterLocal
Definition: messagerouter.h:19
@ HandleOnMaster
Definition: messagerouter.h:42
@ TriggerQueue
Definition: messagerouter.h:46
@ DestModules
Definition: messagerouter.h:26
@ RequiresSubscription
Definition: messagerouter.h:33
@ HandleOnDest
Definition: messagerouter.h:43
@ HandleOnNode
Definition: messagerouter.h:39
@ Special
Definition: messagerouter.h:32
Definition: allobjects.cpp:30