1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 16:57:16 +01:00
SqMod/modules/mmdb/Handle/Database.hpp
2016-11-14 15:50:06 +02:00

70 lines
2.5 KiB
C++

#ifndef _SQMMDB_HANDLE_DATABASE_HPP_
#define _SQMMDB_HANDLE_DATABASE_HPP_
// ------------------------------------------------------------------------------------------------
#include "Common.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
* Manages a reference counted database instance.
*/
class DbHnd
{
// --------------------------------------------------------------------------------------------
friend class Database;
public:
// --------------------------------------------------------------------------------------------
typedef MMDB_s Type; // The managed type.
// --------------------------------------------------------------------------------------------
typedef Type* Pointer; // Pointer to the managed type.
typedef const Type* ConstPtr; // Constant pointer to the managed type.
// --------------------------------------------------------------------------------------------
typedef Type& Reference; // Reference to the managed type.
typedef const Type& ConstRef; // Constant reference to the managed type.
public:
// --------------------------------------------------------------------------------------------
MMDB_s mDb; // The managed database handle.
/* --------------------------------------------------------------------------------------------
* Default constructor.
*/
DbHnd(CSStr filepath, Uint32 flags);
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
*/
DbHnd(const DbHnd & o) = delete;
/* --------------------------------------------------------------------------------------------
* Move constructor. (disabled)
*/
DbHnd(DbHnd && o) = delete;
/* --------------------------------------------------------------------------------------------
* Destructor.
*/
~DbHnd();
/* --------------------------------------------------------------------------------------------
* Copy assignment operator. (disabled)
*/
DbHnd & operator = (const DbHnd & o) = delete;
/* --------------------------------------------------------------------------------------------
* Move assignment operator. (disabled)
*/
DbHnd & operator = (DbHnd && o) = delete;
};
} // Namespace:: SqMod
#endif // _SQMMDB_HANDLE_DATABASE_HPP_