greenhouse
source
database.cpp
Go to the documentation of this file.
1
#include "
database.h
"
2
#include <vector>
3
#include <cstring>
4
#include <string>
5
6
std::vector<Row>
store
;
7
8
Database::Database
() {
9
store
.begin();
10
}
11
12
std::vector<Row>
Database::all
() {
13
return
store
;
14
}
15
16
Row
Database::latest
() {
17
return
store
.front();
18
}
19
20
void
Database::append
(
Row
r) {
21
printf(
"[database::append]: temp: %s | dew: %s | hum: %s"
, r.
temperature
.c_str(), r.
dewity
.c_str(), r.
humidity
.c_str());
22
23
store
.push_back(r);
24
}
25
26
void
Database::flush
() {
27
store
.empty();
28
}
Database::append
void append(Row r)
Definition:
database.cpp:20
Database::Database
Database()
Definition:
database.cpp:8
Database::all
std::vector< Row > all()
Definition:
database.cpp:12
Database::latest
Row latest()
Definition:
database.cpp:16
Database::flush
void flush()
Definition:
database.cpp:26
store
std::vector< Row > store
Definition:
database.cpp:6
database.h
Row
Definition:
database.h:6
Row::temperature
std::string temperature
Definition:
database.h:7
Row::humidity
std::string humidity
Definition:
database.h:9
Row::dewity
std::string dewity
Definition:
database.h:8
Generated on Mon Aug 16 2021 20:30:21 for greenhouse by
1.9.1