Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 1a246e95911672505cf6967f6d34a03ff82a4157 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * MessageDispatcher.h
 *
 *  Created on: 22.08.2012
 *      Author: karlitsc
 */

#ifndef MESSAGEDISPATCHER_H_
#define MESSAGEDISPATCHER_H_

#include "common/messaging/IMessageReceiver.h"
#include "common/messaging/IRTObject.h"
#include "common/messaging/RTObject.h"
#include <map>
#include <string>

namespace etRuntime {

class MessageDispatcher : public RTObject, public IMessageReceiver {
public:
	virtual ~MessageDispatcher();
	MessageDispatcher(IRTObject* parent, Address addr, std::string name);
	void addMessageReceiver(IMessageReceiver& receiver);
	void receive(Message* msg);

	Address getAddress() const { return m_address; };

private:
	std::map<int, IMessageReceiver*> m_local_map;
	std::map<int, IMessageReceiver*> m_thread_map;
	std::map<int, IMessageReceiver*> m_node_map;
	Address m_address;

	MessageDispatcher();
	MessageDispatcher(const MessageDispatcher& right);
	MessageDispatcher& operator=(const MessageDispatcher& right);
};

} /* namespace etRuntime */
#endif /* MESSAGEDISPATCHER_H_ */


Back to the top