Subversion Repositories HomeAutomation

Rev

Rev 1766 | Rev 2066 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1766 Rev 1989
Line 22... Line 22...
22
 
22
 
23
#include <stdexcept>
23
#include <stdexcept>
24
#include <string.h>
24
#include <string.h>
25
 
25
 
26
#include <boost/lexical_cast.hpp>
26
#include <boost/lexical_cast.hpp>
-
 
27
 
-
 
28
#include "common/log.h"
27
 
29
 
28
namespace atom {
30
namespace atom {
29
namespace can {
31
namespace can {
30
 
32
 
31
Protocol::Pointer Protocol::instance_;
33
Protocol::Pointer Protocol::instance_;
-
 
34
 
-
 
35
static const std::string log_module_ = "can::protocol";
32
 
36
 
33
Protocol::Protocol() : LOG("can::Protocol")
37
Protocol::Protocol() : LOG("can::Protocol")
34
{
38
{
35
}
39
}
36
 
40
 
Line 51... Line 55...
51
void Protocol::Delete()
55
void Protocol::Delete()
52
{
56
{
53
    Protocol::instance_.reset();
57
  Protocol::instance_.reset();
54
}
58
}
55
   
59
 
56
bool Protocol::Load(std::string filename)
60
bool Protocol::Load(std::string file_path)
57
{
61
{
58
    try
62
  try
59
    {
63
  {
60
        this->root_node_.LoadFile(filename);
64
    this->root_node_.LoadFile(file_path);
61
    }
65
  }
62
    catch (std::runtime_error& e)
66
  catch (std::runtime_error& e)
63
    {
67
  {
64
        LOG.Error(e.what());
68
    LOG.Error(e.what());
65
        return false;
69
    return false;