Rev 1595 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1595 | Rev 2216 | ||
|---|---|---|---|
| 1 | /* |
1 | /* |
| 2 | * |
2 | * |
| 3 | * Copyright (C) 2010 Mattias Runge |
3 | * Copyright (C) 2010 Mattias Runge |
| 4 | * |
4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
8 | * (at your option) any later version. |
| 9 | * |
9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
13 | * GNU General Public License for more details. |
| 14 | * |
14 | * |
| 15 | * You should have received a copy of the GNU General Public License along |
15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., |
16 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
18 | * |
| 19 | */ |
19 | */ |
| 20 | 20 | ||
| 21 | #include "Message.h" |
21 | #include "Message.h" |
| 22 | 22 | ||
| 23 | namespace atom { |
23 | namespace atom { |
| 24 | namespace broker { |
24 | namespace broker { |
| 25 | 25 | ||
| 26 | Message::Message(Message::Type type, Message::PayloadPointer payload, Origin* origin) |
26 | Message::Message(Message::Type type, Message::PayloadPointer payload, Origin* origin) |
| 27 | { |
27 | { |
| 28 | this->type_ = type; |
28 | this->type_ = type; |
| 29 | this->payload_ = payload; |
29 | this->payload_ = payload; |
| 30 | this->origin_ = origin; |
30 | this->origin_ = origin; |
| 31 | } |
31 | } |
| 32 | 32 | ||
| 33 | Message:: |
33 | Message::Message(Message::Type type, common::Byteset data, Origin* origin) |
| 34 | { |
34 | { |
| - | 35 | this->type_ = type; |
|
| - | 36 | this->data_ = data; |
|
| - | 37 | this->origin_ = origin; |
|
| 35 | } |
38 | } |
| - | 39 | ||
| - | 40 | ||
| - | 41 | Message::~Message() |
|
| - | 42 | { |
|
| - | 43 | } |
|
| 36 | 44 | ||
| 37 | Message::Type Message::GetType() |
45 | Message::Type Message::GetType() |
| 38 | { |
46 | { |
| 39 | return this->type_; |
47 | return this->type_; |
| 40 | } |
48 | } |
| 41 | 49 | ||
| 42 | Message::PayloadPointer Message::GetPayload() |
50 | Message::PayloadPointer Message::GetPayload() |
| 43 | { |
51 | { |
| 44 | return this->payload_; |
52 | return this->payload_; |
| 45 | } |
53 | } |
| - | 54 | ||
| - | 55 | common::Byteset Message::GetRawData() |
|
| - | 56 | { |
|
| - | 57 | return this->data_; |
|
| - | 58 | } |
|
| - | 59 | ||
| 46 | 60 | ||
| 47 | bool Message::TestIfOrigin(Origin* origin) |
61 | bool Message::TestIfOrigin(Origin* origin) |
| 48 | { |
62 | { |
| 49 | return (this->origin_ == origin); |
63 | return (this->origin_ == origin); |
| 50 | } |
64 | } |
| 51 | 65 | ||
| 52 | }; // namespace broker |
66 | }; // namespace broker |
| 53 | }; // namespace atom |
67 | }; // namespace atom |
| 54 | 68 | ||