blob: ad1f064cc99531fbc77d980bf8f134870a2c0d41 (
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
/*******************************************************************************
* 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 MESSAGE_H_
#define MESSAGE_H_
#include "common/messaging/Address.h"
#include "stddef.h"
#include <iostream>
#include <sstream>
#include <string>
namespace etRuntime {
class Message {
public:
// Messages with data TODO MessageBuffer
Message(const Address& addr, int evtId, const void* dataToCopy, std::size_t dataSize);
Message(const Address& addr, int evtId, void* dataPtr);
Message(const Address& addr, int evtId);
~Message();
const Address& getAddress() const {
return m_address;
}
int getEvtId() const {
return m_evtId;
}
/** Pointer to data */
void* getData() const {
return m_data;
}
std::string toString() const;
protected:
friend class MessageSeQueue;
void setNext(Message* msg) {
m_next = msg;
}
Message* getNext() const {
return m_next;
}
private:
Address m_address;
int m_evtId;
Message* m_next;
size_t m_dataSize;
void* m_data;
Message();
Message(Message const&);
Message& operator =(Message const&);
};
} /* namespace etRuntime */
#endif /* MESSAGE_H_ */
|