EvEmu
0.8.4
11 September 2021
|
#include "ObjCacheService.h"
Public Types | |
enum | hintSet { hLoginCachables, hCharCreateCachables, hCharCreateNewExtraCachables, hAppearanceCachables } |
Public Member Functions | |
ObjCacheService (PyServiceMgr *mgr, const char *cacheDir) | |
virtual | ~ObjCacheService () |
void | PrimeCache () |
void | InsertCacheHints (hintSet hset, PyDict *into) |
PyRep * | GetCacheHint (const PyRep *objectID) |
PySubStream * | LoadCachedFile (const char *filename, const char *oname) |
bool | IsCacheLoaded (const PyRep *objectID) const |
bool | IsCacheLoaded (const ObjectCachedMethodID &m) const |
bool | IsCacheLoaded (const ObjectCachedSessionMethodID &m) const |
void | InvalidateCache (const PyRep *objectID) |
void | InvalidateCache (const ObjectCachedMethodID &m) |
void | GiveCache (const PyRep *objectID, PyRep **contents) |
void | GiveCache (const ObjectCachedMethodID &m, PyRep **contents) |
void | GiveCache (const ObjectCachedSessionMethodID &m, PyRep **contents) |
PyObject * | MakeObjectCachedMethodCallResult (const PyRep *objectID, const char *versionCheck="run") |
PyObject * | MakeObjectCachedMethodCallResult (const ObjectCachedMethodID &m, const char *versionCheck="run") |
PyObject * | MakeObjectCachedSessionMethodCallResult (const PyRep *objectID, const char *sessionInfoName, const char *clientWhen="always") |
PyObject * | MakeObjectCachedSessionMethodCallResult (const ObjectCachedSessionMethodID &m, const char *sessionInfoName, const char *clientWhen="always") |
![]() | |
PyService (PyServiceMgr *mgr, const char *serviceName) | |
virtual | ~PyService () |
virtual PyResult | Call (const std::string &method, PyCallArgs &args) |
const char * | GetName () const |
![]() | |
PyCallable () | |
virtual | ~PyCallable () |
Protected Types | |
typedef std::map< std::string, std::string > | CacheKeysMap |
typedef CacheKeysMap::iterator | CacheKeysMapItr |
typedef CacheKeysMap::const_iterator | CacheKeysMapConstItr |
![]() | |
enum | CacheCheckTime { check_Always = 0, check_Never, check_in_year, check_in_6_months, check_in_3_months, check_in_1_month, check_in_1_week, check_in_1_day, check_in_12_hours, check_in_6_hours, check_in_3_hours, check_in_2_hours, check_in_1_hour, check_in_30_minutes, check_in_15_minutes, check_in_5_minutes, check_in_1_minute, check_in_30_seconds, check_in_15_seconds, check_in_5_seconds, check_in_1_second, _checkCount } |
Protected Member Functions | |
bool | _LoadCachableObject (const PyRep *objectID) |
![]() | |
PyObject * | _BuildCachedReturn (PySubStream **result, const char *sessionInfo, CacheCheckTime check) |
virtual PyBoundObject * | CreateBoundObject (Client *pClient, const PyRep *bind_args) |
virtual PyResult | Handle_MachoResolveObject (PyCallArgs &call) |
virtual PyResult | Handle_MachoBindObject (PyCallArgs &call) |
![]() | |
void | _SetCallDispatcher (CallDispatcher *d) |
Protected Attributes | |
Dispatcher *const | m_dispatch |
ObjCacheDB | m_db |
std::string | m_cacheDir |
CachedObjectMgr | m_cache |
CacheKeysMap | m_cacheKeys |
![]() | |
PyServiceMgr *const | m_manager |
Static Protected Attributes | |
static const char *const | LoginCachableObjects [] |
static const uint32 | LoginCachableObjectCount = sizeof(ObjCacheService::LoginCachableObjects) / sizeof(const char *) |
static const char *const | CharCreateCachableObjects [] |
static const uint32 | CharCreateCachableObjectCount = sizeof(ObjCacheService::CharCreateCachableObjects) / sizeof(const char *) |
static const char *const | AppearanceCachableObjects [] |
static const uint32 | AppearanceCachableObjectCount = sizeof(ObjCacheService::AppearanceCachableObjects) / sizeof(const char *) |
static const char *const | CharCreateNewExtraCachableObjects [] |
static const uint32 | CharCreateNewExtraCachableObjectCount = sizeof(ObjCacheService::CharCreateNewExtraCachableObjects) / sizeof(const char *) |
![]() | |
static const char *const | s_checkTimeStrings [_checkCount] |
Definition at line 51 of file ObjCacheService.h.
|
protected |
Definition at line 110 of file ObjCacheService.h.
|
protected |
Definition at line 112 of file ObjCacheService.h.
|
protected |
Definition at line 111 of file ObjCacheService.h.
Enumerator | |
---|---|
hLoginCachables | |
hCharCreateCachables | |
hCharCreateNewExtraCachables | |
hAppearanceCachables |
Definition at line 59 of file ObjCacheService.h.
ObjCacheService::ObjCacheService | ( | PyServiceMgr * | mgr, |
const char * | cacheDir | ||
) |
|
virtual |
|
protected |
Definition at line 316 of file ObjCacheService.cpp.
References _log, ObjCacheDB::GetCachableObject(), CachedObjectMgr::HaveCached(), CachedObjectMgr::LoadCachedFile(), CachedObjectMgr::LoadCachedFromFile(), m_cache, m_cacheDir, m_db, CachedObjectMgr::OIDToString(), CachedObjectMgr::SaveCachedToFile(), sLog, CachedObjectMgr::UpdateCache(), and CachedObjectMgr::UpdateCacheFromSS().
Referenced by GetCacheHint(), and PrimeCache().
Definition at line 364 of file ObjCacheService.cpp.
References _LoadCachableObject(), _log, m_cache, CachedObjectMgr::MakeCacheHint(), and CachedObjectMgr::OIDToString().
Referenced by InsertCacheHints().
Definition at line 430 of file ObjCacheService.cpp.
References m_cache, and CachedObjectMgr::UpdateCache().
Referenced by MarketMgr::GetNewPriceHistory(), MarketMgr::GetOldPriceHistory(), and PyServiceMgr::Initalize().
|
inline |
Definition at line 80 of file ObjCacheService.h.
References GiveCache(), and ObjectCachedMethodID::objectID.
Referenced by GiveCache().
|
inline |
Definition at line 81 of file ObjCacheService.h.
References GiveCache(), and ObjectCachedSessionMethodID::objectID.
Referenced by GiveCache().
Definition at line 377 of file ObjCacheService.cpp.
References _log, AppearanceCachableObjectCount, AppearanceCachableObjects, CharCreateCachableObjectCount, CharCreateCachableObjects, CharCreateNewExtraCachableObjectCount, CharCreateNewExtraCachableObjects, GetCacheHint(), hAppearanceCachables, hCharCreateCachables, hCharCreateNewExtraCachables, hLoginCachables, LoginCachableObjectCount, LoginCachableObjects, m_cacheKeys, objects(), PyDecRef, and PyDict::SetItemString().
void ObjCacheService::InvalidateCache | ( | const PyRep * | objectID | ) |
Definition at line 426 of file ObjCacheService.cpp.
References CachedObjectMgr::InvalidateCache(), and m_cache.
Referenced by MarketMgr::InvalidateOrdersCache().
|
inline |
Definition at line 77 of file ObjCacheService.h.
References InvalidateCache(), and ObjectCachedMethodID::objectID.
Referenced by InvalidateCache().
bool ObjCacheService::IsCacheLoaded | ( | const PyRep * | objectID | ) | const |
Definition at line 422 of file ObjCacheService.cpp.
References CachedObjectMgr::HaveCached(), and m_cache.
Referenced by MarketMgr::GetNewPriceHistory(), MarketMgr::GetOldPriceHistory(), PyServiceMgr::Initalize(), MakeObjectCachedMethodCallResult(), and MakeObjectCachedSessionMethodCallResult().
|
inline |
Definition at line 73 of file ObjCacheService.h.
References IsCacheLoaded(), and ObjectCachedMethodID::objectID.
Referenced by IsCacheLoaded().
|
inline |
Definition at line 74 of file ObjCacheService.h.
References IsCacheLoaded(), and ObjectCachedSessionMethodID::objectID.
Referenced by IsCacheLoaded().
PySubStream * ObjCacheService::LoadCachedFile | ( | const char * | filename, |
const char * | oname | ||
) |
Definition at line 309 of file ObjCacheService.cpp.
References CachedObjectMgr::LoadCachedFile(), and m_cache.
PyObject * ObjCacheService::MakeObjectCachedMethodCallResult | ( | const PyRep * | objectID, |
const char * | versionCheck = "run" |
||
) |
Definition at line 446 of file ObjCacheService.cpp.
References IsCacheLoaded(), m_cache, and CachedObjectMgr::MakeCacheHint().
Referenced by MarketMgr::GetNewPriceHistory(), and MarketMgr::GetOldPriceHistory().
|
inline |
Definition at line 84 of file ObjCacheService.h.
References MakeObjectCachedMethodCallResult(), and ObjectCachedMethodID::objectID.
Referenced by MakeObjectCachedMethodCallResult().
PyObject * ObjCacheService::MakeObjectCachedSessionMethodCallResult | ( | const PyRep * | objectID, |
const char * | sessionInfoName, | ||
const char * | clientWhen = "always" |
||
) |
Definition at line 435 of file ObjCacheService.cpp.
References IsCacheLoaded(), m_cache, and CachedObjectMgr::MakeCacheHint().
|
inline |
Definition at line 87 of file ObjCacheService.h.
References MakeObjectCachedSessionMethodCallResult(), and ObjectCachedSessionMethodID::objectID.
Referenced by MakeObjectCachedSessionMethodCallResult().
void ObjCacheService::PrimeCache | ( | ) |
Definition at line 298 of file ObjCacheService.cpp.
References _LoadCachableObject(), m_cacheKeys, and PyDecRef.
|
staticprotected |
Definition at line 96 of file ObjCacheService.h.
Referenced by InsertCacheHints().
|
staticprotected |
Definition at line 95 of file ObjCacheService.h.
Referenced by InsertCacheHints().
|
staticprotected |
Definition at line 94 of file ObjCacheService.h.
Referenced by InsertCacheHints().
|
staticprotected |
Definition at line 93 of file ObjCacheService.h.
Referenced by InsertCacheHints().
|
staticprotected |
Definition at line 98 of file ObjCacheService.h.
Referenced by InsertCacheHints().
|
staticprotected |
Definition at line 97 of file ObjCacheService.h.
Referenced by InsertCacheHints().
|
staticprotected |
Definition at line 92 of file ObjCacheService.h.
Referenced by InsertCacheHints().
|
staticprotected |
Definition at line 91 of file ObjCacheService.h.
Referenced by InsertCacheHints().
|
protected |
Definition at line 106 of file ObjCacheService.h.
Referenced by _LoadCachableObject(), GetCacheHint(), GiveCache(), InvalidateCache(), IsCacheLoaded(), LoadCachedFile(), MakeObjectCachedMethodCallResult(), and MakeObjectCachedSessionMethodCallResult().
|
protected |
Definition at line 105 of file ObjCacheService.h.
Referenced by _LoadCachableObject().
|
protected |
Definition at line 114 of file ObjCacheService.h.
Referenced by InsertCacheHints(), and PrimeCache().
|
protected |
Definition at line 103 of file ObjCacheService.h.
Referenced by _LoadCachableObject().
|
protected |
Definition at line 100 of file ObjCacheService.h.
Referenced by ~ObjCacheService().