Subversion Repositories HomeAutomation

Rev

Rev 1598 | Go to most recent revision | Blame | Last modification | View Log | SVN | RSS feed

  1. /*
  2.  *
  3.  *    Copyright (C) 2010  Mattias Runge
  4.  *
  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
  7.  *    the Free Software Foundation; either version 2 of the License, or
  8.  *    (at your option) any later version.
  9.  *
  10.  *    This program is distributed in the hope that it will be useful,
  11.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *    GNU General Public License for more details.
  14.  *
  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.,
  17.  *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18.  *
  19.  */
  20.  
  21. #include "Module.h"
  22.  
  23. #include <boost/lexical_cast.hpp>
  24.  
  25. namespace atom {
  26. namespace can {
  27.  
  28. Module::Module(Module::Id id, std::string name, std::string class_name)
  29. {
  30.     this->id_ = id;
  31.     this->name_ = name;
  32.     this->class_name_ = class_name;
  33.     this->full_id_ = Module::MakeFullId(id, name);
  34. }
  35.  
  36. Module::~Module()
  37. {
  38.  
  39. }
  40.  
  41. std::string Module::MakeFullId(Module::Id id, std::string name)
  42. {
  43.     return name + ":" + boost::lexical_cast<std::string>(id);
  44. }
  45.  
  46. Module::FullId Module::GetFullId()
  47. {
  48.     return this->full_id_;
  49. }
  50.  
  51. Module::Id Module::GetId()
  52. {
  53.     return this->id_;
  54. }
  55.  
  56. Node::Id Module::GetNodeId()
  57. {
  58.     return this->node_id_;
  59. }
  60.  
  61. void Module::SetNodeId(Node::Id node_id)
  62. {
  63.     this->node_id_ = node_id;
  64. }
  65.  
  66. std::string Module::GetName()
  67. {
  68.     return this->name_;
  69. }
  70.  
  71. std::string Module::GetClassName()
  72. {
  73.     return this->class_name_;
  74. }
  75.    
  76. }; // namespace can
  77. }; // namespace atom
  78.