Subversion Repositories HomeAutomation

Rev

Rev 1309 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1309 Rev 1310
Line 12... Line 12...
12
#include <fstream>
12
#include <fstream>
13
#include <iterator>
13
#include <iterator>
14
 
14
 
15
#include <stdio.h>
15
#include <stdio.h>
16
 
16
 
-
 
17
#include "version.h"
17
#include <boost/asio.hpp>
18
#include <boost/asio.hpp>
18
#include <boost/bind.hpp>
19
#include <boost/bind.hpp>
19
#include <boost/foreach.hpp>
20
#include <boost/foreach.hpp>
20
#include <boost/program_options.hpp>
21
#include <boost/program_options.hpp>
21
#include "broker/Broker.h"
22
#include "broker/Broker.h"
Line 25... Line 26...
25
#include "xml/Node.h"
26
#include "xml/Node.h"
26
#include "utils/Thread.h"
27
#include "utils/Thread.h"
27
#include "utils/BitBuffer.h"
28
#include "utils/BitBuffer.h"
28
#include "utils/UdpServer.h"
29
#include "utils/UdpServer.h"
29
#include "xml/Node.h"
30
#include "xml/Node.h"
-
 
31
#include "db/Database.h"
30
 
32
 
31
namespace po = boost::program_options;
33
namespace po = boost::program_options;
32
 
34
 
33
#define foreach         BOOST_FOREACH
35
#define foreach         BOOST_FOREACH
34
#define reverse_foreach BOOST_REVERSE_FOREACH
36
#define reverse_foreach BOOST_REVERSE_FOREACH
Line 37... Line 39...
37
 
39
 
38
using namespace atom;
40
using namespace atom;
39
 
41
 
40
int main(int argc, char* argv[])
42
int main(int argc, char* argv[])
41
{
43
{
-
 
44
    Logger LOG;
-
 
45
    LOG.setName("Main");
-
 
46
 
-
 
47
    LOG.info("Atom (" + string(AutoVersion::FULLVERSION_STRING) + " " + string(AutoVersion::STATUS) + ")");
-
 
48
    LOG.info("Written by Mattias Runge 2009");
-
 
49
 
-
 
50
 
-
 
51
    db::Database::pointer db = db::Database::getInstance();
-
 
52
    db->load("../../Configuration/protocol.xml");
-
 
53
 
-
 
54
 
42
    xml::Node xmlNode("../../Configuration/protocol.xml");
55
    xml::Node xmlNode("../../Configuration/protocol.xml");
43
    cout << xmlNode.toString() << endl;
56
    cout << xmlNode.toString() << endl;
44
 
57
 
45
    cout << "::" << xmlNode.selectFirst("datatypes").selectFirst("datatype", xml::Node::attributePair("name", "moduleId"))["lenght"] << endl;
58
    cout << "::" << xmlNode.selectFirst("datatypes").selectFirst("datatype", xml::Node::attributePair("name", "moduleId"))["lenght"] << endl;
46
 
59