Subversion Repositories HomeAutomation

Rev

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

Rev 1596 Rev 1599
Line 26... Line 26...
26
#include <boost/filesystem.hpp>
26
#include <boost/filesystem.hpp>
27
 
27
 
28
namespace atom {
28
namespace atom {
29
namespace config {
29
namespace config {
30
 
30
 
31
Manager::Pointer Manager::instance_ = Manager::Pointer(new Manager());
31
Manager::Pointer Manager::instance_;
32
 
32
 
33
Manager::Manager() : command_line_("Command line options"), configuration_file_("Configuration file options")
33
Manager::Manager() : command_line_("Command line options"), configuration_file_("Configuration file options")
34
{
34
{
35
    std::string default_config_file = "/etc/atom.conf";
35
    std::string default_config_file = "/etc/atom.conf";
36
   
36
   
Line 41... Line 41...
41
 
41
 
42
    this->configuration_file_.add_options()
42
    this->configuration_file_.add_options()
43
    ("MonitorPort", boost::program_options::value<int>()->default_value(1201), "TCP port to open for monitor output")
43
    ("MonitorPort", boost::program_options::value<int>()->default_value(1201), "TCP port to open for monitor output")
44
    ("CommandPort", boost::program_options::value<int>()->default_value(1202), "TCP port to open for command input")
44
    ("CommandPort", boost::program_options::value<int>()->default_value(1202), "TCP port to open for command input")
45
    ("LogFile",     boost::program_options::value<std::string>(),              "File to log output to")
45
    ("LogFile",     boost::program_options::value<std::string>(),              "File to log output to")
46
    ("LogLevel",    boost::program_options::value<std::string>(),              "Level of logging")
46
    ("LogLevel",    boost::program_options::value<int>()->default_value(4),    "Level of logging")
47
    ("ScriptsPath", boost::program_options::value<std::string>(),              "Path to where the scripts")
47
    ("ScriptsPath", boost::program_options::value<std::string>(),              "Path to where the scripts")
48
    ("ProtocolFile",boost::program_options::value<std::string>(),              "File to read the protocol form")
48
    ("ProtocolFile",boost::program_options::value<std::string>(),              "File to read the protocol form")
49
    ("CanNet",      boost::program_options::value<type::StringList>(),         "Information on where to locate the CAN networks");
49
    ("CanNet",      boost::program_options::value<type::StringList>(),         "Information on where to locate the CAN networks");
50
 
50
 
51
    this->command_line_.add_options()
51
    this->command_line_.add_options()
Line 62... Line 62...
62
}
62
}
63
 
63
 
64
Manager::Pointer Manager::Instance()
64
Manager::Pointer Manager::Instance()
65
{
65
{
66
    return Manager::instance_;
66
    return Manager::instance_;
-
 
67
}
-
 
68
 
-
 
69
void Manager::Create()
-
 
70
{
-
 
71
    Manager::instance_ = Manager::Pointer(new Manager());
67
}
72
}
68
 
73
 
69
void Manager::Delete()
74
void Manager::Delete()
70
{
75
{
71
    Manager::instance_.reset();
76
    Manager::instance_.reset();