Subversion Repositories HomeAutomation

Rev

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

Rev 1310 Rev 1311
Line 1... Line 1...
1
/*
1
/*
2
 * Database.cpp
2
 * Protocol.cpp
3
 *
3
 *
4
 *  Created on: Jul 23, 2009
4
 *  Created on: Jul 23, 2009
5
 *      Author: Mattias Runge
5
 *      Author: Mattias Runge
6
 */
6
 */
7
 
7
 
8
#include "Database.h"
8
#include "Protocol.h"
9
 
9
 
10
namespace atom {
10
namespace atom {
11
namespace db {
-
 
12
 
11
 
13
Database::pointer Database::Instance(new Database());
12
Protocol::pointer Protocol::Instance(new Protocol());
14
 
13
 
15
Database::Database()
14
Protocol::Protocol()
16
{
15
{
17
    // TODO Auto-generated constructor stub
16
    // TODO Auto-generated constructor stub
18
 
17
 
19
}
18
}
20
 
19
 
21
Database::~Database()
20
Protocol::~Protocol()
22
{
21
{
23
    // TODO Auto-generated destructor stub
22
    // TODO Auto-generated destructor stub
24
}
23
}
25
 
24
 
26
Database::pointer Database::getInstance()
25
Protocol::pointer Protocol::getInstance()
27
{
26
{
28
    return Database::Instance;
27
    return Protocol::Instance;
29
}
28
}
30
 
29
 
31
void Database::load(string filename)
30
void Protocol::load(string filename)
32
{
31
{
33
    this->myXmlNode.load(filename);
32
    this->myXmlNode.load(filename);
-
 
33
 
-
 
34
    // TODO Catch exceptions thrown by load
-
 
35
 
-
 
36
    // TODO Do validation of XML-data, check if needed sections are defined
34
}
37
}
35
 
38
 
36
xml::Node & Database::getRootNode()
39
xml::Node & Protocol::getRootNode()
37
{
40
{
38
    return this->myXmlNode;
41
    return this->myXmlNode;
39
}
42
}
40
 
43
 
41
}
-
 
42
}
44
}
-
 
45