1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-16 07:07:13 +02:00

More code cleanup and fixes in the MaxmindDB module.

Implemented the SearchNode wrapper.
This commit is contained in:
Sandu Liviu Catalin
2016-11-14 15:46:48 +02:00
parent fb5a5b0090
commit 7d1493afd3
13 changed files with 583 additions and 80 deletions

View File

@ -12,10 +12,7 @@ namespace SqMod {
*/
class LookupResult
{
// --------------------------------------------------------------------------------------------
friend class Database; // Only a valid database instance can construct this type.
protected:
public:
// --------------------------------------------------------------------------------------------
typedef MMDB_lookup_result_s Type; // The managed type.
@ -28,6 +25,8 @@ protected:
typedef Type& Reference; // Reference to the managed type.
typedef const Type& ConstRef; // Constant reference to the managed type.
protected:
/* --------------------------------------------------------------------------------------------
* Validate the managed database handle and throw an error if invalid.
*/
@ -37,8 +36,6 @@ protected:
void Validate() const;
#endif // _DEBUG
private:
/* --------------------------------------------------------------------------------------------
* Validate the managed database handle and throw an error if invalid.
*/
@ -54,6 +51,13 @@ private:
DbRef m_Handle; // The database from which this result comes from.
Type m_Result; // The managed result structure.
public:
/* --------------------------------------------------------------------------------------------
* Default constructor. (null)
*/
LookupResult();
/* --------------------------------------------------------------------------------------------
* Construct and take ownership of a certain result.
*/
@ -63,13 +67,6 @@ private:
/* ... */
}
public:
/* --------------------------------------------------------------------------------------------
* Default constructor. (null)
*/
LookupResult();
/* --------------------------------------------------------------------------------------------
* Copy constructor.
*/
@ -80,14 +77,6 @@ public:
*/
LookupResult(LookupResult &&) = default;
/* --------------------------------------------------------------------------------------------
* Destructor.
*/
~LookupResult()
{
/* We let the smart reference deal with deallocations if necessary. */
}
/* --------------------------------------------------------------------------------------------
* Copy assignment operator.
*/