My Project
DatabaseEntity.h
1 #pragma once
2 #include "AssetEntity.h"
3 
4 struct sqlite3;
5 
6 namespace ParaEngine
7 {
8  //--------------------------------------------------------
11  //--------------------------------------------------------
12  struct DatabaseEntity : public AssetEntity
13  {
14  private:
16  sqlite3 * m_pDB;
17 
18  public:
19  virtual AssetEntity::AssetType GetType(){ return AssetEntity::database; };
21  string sFileName;
22 
23  public:
24 
25  DatabaseEntity(const AssetKey& key)
26  :AssetEntity(key)
27  {
28  m_pDB = NULL;
29  }
30 
32  {
33  m_pDB = NULL;
34  };
35 
36  virtual ~DatabaseEntity(){};
37 
38  virtual void Cleanup();
39 
42  sqlite3* OpenDB();
44  void CloseDB();
45 
46  };
47 
49 }
string sFileName
name of the file name (*.db)
Definition: DatabaseEntity.h:19
AssetType
each asset type has a unique asset type number
Definition: AssetEntity.h:82
different physics engine has different winding order.
Definition: EventBinding.h:32
AssetManager manages a set of asset entities of a certain type.
Definition: AssetManager.h:13
virtual void Cleanup()
Clean up additional resources.
Definition: DatabaseEntity.cpp:15
void CloseDB()
close the database file.
Definition: DatabaseEntity.cpp:38
std::string AssetKey
the unique key object for asset entity.
Definition: AssetEntity.h:13
DataBaseEntity distinguish one template from other TODO: I should wrap the SQLite3 interface in Datab...
Definition: DatabaseEntity.h:12
sqlite3 * OpenDB()
open the database file, if it is not already open.
Definition: DatabaseEntity.cpp:20
Base class for managed asset entity in ParaEngine.
Definition: AssetEntity.h:25