2024-02-09 13:37:58 +00:00
|
|
|
#ifndef __CDCLIENTMANAGER__H__
|
|
|
|
#define __CDCLIENTMANAGER__H__
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-03-20 13:10:52 +00:00
|
|
|
#define UNUSED_TABLE(v)
|
|
|
|
|
2023-03-17 14:36:21 +00:00
|
|
|
/**
|
|
|
|
* Initialize the CDClient tables so they are all loaded into memory.
|
2021-12-05 17:54:36 +00:00
|
|
|
*/
|
2024-02-09 05:40:43 +00:00
|
|
|
namespace CDClientManager {
|
2024-01-08 23:32:09 +00:00
|
|
|
void LoadValuesFromDatabase();
|
|
|
|
void LoadValuesFromDefaults();
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2023-03-17 14:36:21 +00:00
|
|
|
/**
|
|
|
|
* Fetch a table from CDClient
|
|
|
|
*
|
|
|
|
* @tparam Table type to fetch
|
|
|
|
* @return A pointer to the requested table.
|
2022-07-28 13:39:57 +00:00
|
|
|
*/
|
|
|
|
template<typename T>
|
2024-02-09 13:37:58 +00:00
|
|
|
T* GetTable();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fetch a table from CDClient
|
|
|
|
* Note: Calling this function without a template specialization in CDClientManager.cpp will cause a linker error.
|
|
|
|
*
|
|
|
|
* @tparam Table type to fetch
|
|
|
|
* @return A pointer to the requested table.
|
|
|
|
*/
|
|
|
|
template<typename T>
|
|
|
|
typename T::StorageType& GetEntriesMutable();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// These are included after the CDClientManager namespace declaration as CDTable as of Jan 29 2024 relies on CDClientManager in Templated code.
|
|
|
|
#include "CDTable.h"
|
|
|
|
|
|
|
|
#include "Singleton.h"
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
T* CDClientManager::GetTable() {
|
|
|
|
return &T::Instance();
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|
2024-02-09 13:37:58 +00:00
|
|
|
|
|
|
|
#endif //!__CDCLIENTMANAGER__H__
|