2015-01-07 01:26:14 +08:00
|
|
|
|
/*
|
|
|
|
|
* DatabaseDriverFactory.h
|
|
|
|
|
*
|
|
|
|
|
* Created on: 2012-8-14
|
|
|
|
|
* Author: fasiondog
|
|
|
|
|
*/
|
|
|
|
|
|
2019-08-03 21:53:24 +08:00
|
|
|
|
#pragma once
|
2015-01-07 01:26:14 +08:00
|
|
|
|
#ifndef DATADRIVERFACTORY_H_
|
|
|
|
|
#define DATADRIVERFACTORY_H_
|
|
|
|
|
|
|
|
|
|
#include "BaseInfoDriver.h"
|
|
|
|
|
#include "KDataDriver.h"
|
2016-04-03 00:08:31 +08:00
|
|
|
|
#include "BlockInfoDriver.h"
|
2015-01-07 01:26:14 +08:00
|
|
|
|
|
|
|
|
|
namespace hku {
|
|
|
|
|
|
2017-10-20 02:11:57 +08:00
|
|
|
|
/**
|
|
|
|
|
* 数据驱动工厂类
|
|
|
|
|
* @ingroup DataDriver
|
|
|
|
|
*/
|
2017-10-09 02:25:02 +08:00
|
|
|
|
class HKU_API DataDriverFactory {
|
2015-01-07 01:26:14 +08:00
|
|
|
|
public:
|
2020-04-05 02:02:05 +08:00
|
|
|
|
/**
|
|
|
|
|
* 初始化支持的默认驱动
|
|
|
|
|
*/
|
|
|
|
|
static void init();
|
|
|
|
|
|
2020-04-04 01:39:19 +08:00
|
|
|
|
/**
|
|
|
|
|
* 主动释放资源,主要用于内存泄漏检测,退出时主动清理,避免误报
|
|
|
|
|
*/
|
|
|
|
|
static void release();
|
|
|
|
|
|
|
|
|
|
static void regBaseInfoDriver(const BaseInfoDriverPtr &);
|
|
|
|
|
static void removeBaseInfoDriver(const string &name);
|
|
|
|
|
static BaseInfoDriverPtr getBaseInfoDriver(const Parameter &);
|
|
|
|
|
|
|
|
|
|
static void regBlockDriver(const BlockInfoDriverPtr &);
|
|
|
|
|
static void removeBlockDriver(const string &name);
|
|
|
|
|
static BlockInfoDriverPtr getBlockDriver(const Parameter &);
|
|
|
|
|
|
|
|
|
|
static void regKDataDriver(const KDataDriverPtr &);
|
|
|
|
|
static void removeKDataDriver(const string &name);
|
|
|
|
|
static KDataDriverPtr getKDataDriver(const Parameter &);
|
2017-10-12 01:58:08 +08:00
|
|
|
|
|
2017-10-09 02:25:02 +08:00
|
|
|
|
private:
|
2020-04-05 02:02:05 +08:00
|
|
|
|
static map<string, BaseInfoDriverPtr> *m_baseInfoDrivers;
|
|
|
|
|
static map<string, BlockInfoDriverPtr> *m_blockDrivers;
|
|
|
|
|
static map<string, KDataDriverPtr> *m_kdataDrivers;
|
2015-01-07 01:26:14 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} /* namespace hku */
|
|
|
|
|
#endif /* DATABASEDRIVERFACTORY_H_ */
|