Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 57b50e5f631570931606c0c767e127231f29e1fc (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
43
44
45
46
47
48
/*******************************************************************************
 * Copyright (c) 2012 Draeger Medical GmbH (http://www.draeger.com).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * CONTRIBUTORS:
 * 		Peter Karlitschek (initial contribution)
 *
 *******************************************************************************/

#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:
		MessageDispatcher(IRTObject* parent, Address addr, std::string name);
		virtual ~MessageDispatcher();

		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