ac61c26d56
add: improved sql calls
41 lines
601 B
C++
41 lines
601 B
C++
#ifndef EMGAUWA_CORE_RELAY_DBO_H
|
|
#define EMGAUWA_CORE_RELAY_DBO_H
|
|
|
|
#include <string>
|
|
#include <sqlite3.h>
|
|
#include <json/value.h>
|
|
|
|
class relay_dbo
|
|
{
|
|
public:
|
|
|
|
int id;
|
|
char name[128];
|
|
int number;
|
|
char device_id[33];
|
|
char active_schedule_id[33];
|
|
|
|
bool
|
|
update();
|
|
|
|
bool
|
|
insert();
|
|
|
|
bool
|
|
remove();
|
|
|
|
Json::Value
|
|
to_json();
|
|
|
|
static void
|
|
free_list(relay_dbo **relays_list);
|
|
|
|
static relay_dbo**
|
|
get_by_simple(const char *key, const void *value, intptr_t bind_func);
|
|
|
|
static relay_dbo**
|
|
get_all();
|
|
};
|
|
|
|
|
|
#endif //EMGAUWA_CORE_RELAY_DBO_H
|