EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DBCleaner Class Reference

#include "DBCleaner.h"

Inheritance diagram for DBCleaner:
Collaboration diagram for DBCleaner:

Public Member Functions

 DBCleaner ()
 
 ~DBCleaner ()
 
- Public Member Functions inherited from Singleton< DBCleaner >
 Singleton ()
 Primary constructor. More...
 

DBCleaner.cpp

Database cleaner module : James

Date
: 10 October 2021
void Initialize ()
 
void CleanEntity (uint32 type)
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< DBCleaner >
static DBCleanerget ()
 
- Static Protected Attributes inherited from Singleton< DBCleaner >
static std::shared_ptr< DBCleanermInstance
 

Detailed Description

Definition at line 15 of file DBCleaner.h.

Constructor & Destructor Documentation

DBCleaner::DBCleaner ( )
inline

Definition at line 19 of file DBCleaner.h.

19 { /* do nothing here */ }
DBCleaner::~DBCleaner ( )
inline

Definition at line 20 of file DBCleaner.h.

20 { /* do nothing here */ }

Member Function Documentation

void DBCleaner::CleanEntity ( uint32  type)
private

Definition at line 24 of file DBCleaner.cpp.

References sDatabase.

Referenced by Initialize().

24  {
25  DBerror err;
26  // Delete entity attributes associated with removed entities
27  sDatabase.RunQuery(err, "DELETE FROM entity_attributes WHERE itemID IN (SELECT itemID FROM entity WHERE typeID = %u);", type);
28  // Delete entities themselves
29  sDatabase.RunQuery(err, "DELETE FROM entity WHERE typeID = %u", type);
30 }
#define sDatabase
Definition: dbcore.h:199
Definition: dbcore.h:39

Here is the caller graph for this function:

void DBCleaner::Initialize ( )

Definition at line 14 of file DBCleaner.cpp.

References CleanEntity(), EVEDB::invTypes::CynosuralFieldI, and sLog.

14  {
15  sLog.Blue(" DBCleaner", "Database Cleaner Initialized.");
16 
17  // Add new cleaning jobs below
18  CleanEntity(EVEDB::invTypes::CynosuralFieldI); //Clean cynosural fields
19 
20  // Don't add anything below this line
21  sLog.Blue(" DBCleaner", "Cleaning complete.");
22 }
void CleanEntity(uint32 type)
Definition: DBCleaner.cpp:24
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250

Here is the call graph for this function:


The documentation for this class was generated from the following files: