Rev 1602 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1602 | Rev 1642 | ||
|---|---|---|---|
| 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 "Module.h" |
21 | #include "Module.h" |
| 22 | 22 | ||
| 23 | #include <boost/lexical_cast.hpp> |
23 | #include <boost/lexical_cast.hpp> |
| 24 | 24 | ||
| 25 | namespace atom { |
25 | namespace atom { |
| 26 | namespace |
26 | namespace control { |
| 27 | 27 | ||
| 28 | Module::Module(Module::Id id, std::string name, std::string class_name) |
28 | Module::Module(Module::Id id, std::string name, std::string class_name) |
| 29 | { |
29 | { |
| 30 | this->id_ = id; |
30 | this->id_ = id; |
| 31 | this->name_ = name; |
31 | this->name_ = name; |
| 32 | this->class_name_ = class_name; |
32 | this->class_name_ = class_name; |
| 33 | this->full_id_ = Module::MakeFullId(id, name); |
33 | this->full_id_ = Module::MakeFullId(id, name); |
| 34 | } |
34 | } |
| 35 | 35 | ||
| 36 | Module::~Module() |
36 | Module::~Module() |
| 37 | { |
37 | { |
| 38 | 38 | ||
| 39 | } |
39 | } |
| 40 | 40 | ||
| 41 | std::string Module::MakeFullId(Module::Id id, std::string name) |
41 | std::string Module::MakeFullId(Module::Id id, std::string name) |
| 42 | { |
42 | { |
| 43 | return name + ":" + boost::lexical_cast<std::string>(id); |
43 | return name + ":" + boost::lexical_cast<std::string>(id); |
| 44 | } |
44 | } |
| 45 | 45 | ||
| 46 | Module::FullId Module::GetFullId() |
46 | Module::FullId Module::GetFullId() |
| 47 | { |
47 | { |
| 48 | return this->full_id_; |
48 | return this->full_id_; |
| 49 | } |
49 | } |
| 50 | 50 | ||
| 51 | Module::Id Module::GetId() |
51 | Module::Id Module::GetId() |
| 52 | { |
52 | { |
| 53 | return this->id_; |
53 | return this->id_; |
| 54 | } |
54 | } |
| 55 | 55 | ||
| 56 | Node::Id Module::GetNodeId() |
56 | Node::Id Module::GetNodeId() |
| 57 | { |
57 | { |
| 58 | return this->node_id_; |
58 | return this->node_id_; |
| 59 | } |
59 | } |
| 60 | 60 | ||
| 61 | void Module::SetNodeId(Node::Id node_id) |
61 | void Module::SetNodeId(Node::Id node_id) |
| 62 | { |
62 | { |
| 63 | this->node_id_ = node_id; |
63 | this->node_id_ = node_id; |
| 64 | } |
64 | } |
| 65 | 65 | ||
| 66 | std::string Module::GetName() |
66 | std::string Module::GetName() |
| 67 | { |
67 | { |
| 68 | return this->name_; |
68 | return this->name_; |
| 69 | } |
69 | } |
| 70 | 70 | ||
| 71 | std::string Module::GetClassName() |
71 | std::string Module::GetClassName() |
| 72 | { |
72 | { |
| 73 | return this->class_name_; |
73 | return this->class_name_; |
| 74 | } |
74 | } |
| 75 | 75 | ||
| 76 | }; // namespace |
76 | }; // namespace control |
| 77 | }; // namespace atom |
77 | }; // namespace atom |
| 78 | 78 | ||