DB_Track/include/SQLHandler.hpp

42 lines
640 B
C++
Raw Normal View History

2018-10-16 13:05:13 +02:00
//
// SQLHandler.hpp
// DB_Track
//
// Created by Baranyai David on 2018. 10. 13..
//
#ifndef SQLHandler_hpp
#define SQLHandler_hpp
#include <stdio.h>
#include <iostream>
#include <mysql.h>
#include <vector>
#include <sstream>
#include <string>
struct Hit
{
unsigned int channel_id;
unsigned int elapsed_time;
unsigned int amplitude_peak;
};
class SQLHandler
{
public:
SQLHandler();
~SQLHandler();
std::vector<Hit> QueryNext();
void SetRange(unsigned int);
private:
unsigned int range;
uint64_t latest_value;
MYSQL *server;
unsigned int min_hits;
};
#endif /* SQLHandler_hpp */