You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

54 lines
2.1 KiB

#ifndef __IM_DATABASEADAPTER_H_INCL__
#define __IM_DATABASEADAPTER_H_INCL__
#include "../../lib/data/mysql/mysql_class.h"
#include "../../lib/components/base/basicSettingsProvider.h"
#include "../../lib/App/common/imageParser.h"
//#include "IM_DataStructs.h"
/**
* TODO: Add class description
*
* @author Gagua
*/
class IM_DataBaseAdapter {
private:
basicLogCollection * m_pLog;
config_setting_t * m_pSettings;
bool m_bIsConnected;
MySQL_Connector * m_pConnectorClass;
public:
// Method to fetch singleton instance.
static IM_DataBaseAdapter* getInstance( config_setting_t * Settings = NULL );
// Destructor
virtual ~IM_DataBaseAdapter();
IM_ITEM_DATA * getItemDataById( uint32_t itemID );
IM_ITEM_DATA * getItemDataByMd5( CSTR md5 );
void insertItemROI( uint32_t itemID, uint32_t classID, float weight, uint32_t x, uint32_t y, uint32_t w, uint32_t h );
uint32_t insertItemFace( uint32_t itemID, CSTR md5, uint32_t x, uint32_t y, uint32_t w, uint32_t h );
void updateItemFace( uint32_t itemID, uint8_t dID, float P );
protected:
// Constructor - protected so users cannot call it.
explicit IM_DataBaseAdapter( config_setting_t * Settings );
private:
// private static member referencing the single instance of the object
// TODO: Replace IM_DataBaseAdapter with the type of object you want to
// return the single instance of
static IM_DataBaseAdapter* _instance;
// Copy constructor
// Declared but not defined to prevent auto-generated
// copy constructor. Refer to "Effective C++" by Meyers
IM_DataBaseAdapter(const IM_DataBaseAdapter& src);
// Assignment operator
// Declared but not defined to prevent auto-generated
// assignment operator. Refer to "Effective C++" by Meyers
IM_DataBaseAdapter& operator=(const IM_DataBaseAdapter& src);
};
#endif // __IM_DATABASEADAPTER_H_INCL__