|
EvEmu
0.8.4
11 September 2021
|
#include "CachedObjectMgr.h"

Classes | |
| class | CacheRecord |
Public Member Functions | |
| ~CachedObjectMgr () | |
| bool | HaveCached (const std::string &objectID) const |
| bool | HaveCached (const PyRep *objectID) const |
| bool | IsCacheUpToDate (const PyRep *objectID, uint32 version, int64 timestamp) |
| void | InvalidateCache (const PyRep *objectID) |
| void | UpdateCacheFromSS (const std::string &objectID, PySubStream **in_cached_data) |
| void | UpdateCache (const std::string &objectID, PyRep **in_cached_data) |
| void | UpdateCache (const PyRep *objectID, PyRep **in_cached_data) |
| PyObject * | MakeCacheHint (const PyRep *objectID) |
| PyObject * | MakeCacheHint (const std::string &objectID) |
| PyObject * | GetCachedObject (const PyRep *objectID) |
| PyObject * | GetCachedObject (const std::string &objectID) |
| PySubStream * | LoadCachedFile (const char *obj_name) |
| PySubStream * | LoadCachedFile (PyRep *key, const char *oname) |
| PySubStream * | LoadCachedFile (const char *filename, const char *oname) |
| PyCachedObjectDecoder * | LoadCachedObject (const char *filename, const char *oname) |
| PyCachedCall * | LoadCachedCall (const char *filename, const char *oname) |
| bool | LoadCachedFromFile (const std::string &cacheDir, const std::string &objectID) |
| bool | LoadCachedFromFile (const std::string &cacheDir, const PyRep *objectID) |
| bool | SaveCachedToFile (const std::string &cacheDir, const std::string &objectID) const |
| bool | SaveCachedToFile (const std::string &cacheDir, const PyRep *objectID) const |
Static Public Member Functions | |
| static std::string | OIDToString (const PyRep *objectID) |
Protected Types | |
| typedef std::map< std::string, CacheRecord * > | CachedObjMap |
| typedef CachedObjMap::iterator | CachedObjMapItr |
| typedef CachedObjMap::const_iterator | CachedObjMapConstItr |
Protected Member Functions | |
| void | GetCacheFileName (PyRep *key, std::string &into) |
| void | _UpdateCache (const PyRep *objectID, PyBuffer **buffer) |
Protected Attributes | |
| CachedObjMap | m_cachedObjects |
Definition at line 58 of file CachedObjectMgr.h.
|
protected |
Definition at line 117 of file CachedObjectMgr.h.
|
protected |
Definition at line 119 of file CachedObjectMgr.h.
|
protected |
Definition at line 118 of file CachedObjectMgr.h.
| CachedObjectMgr::~CachedObjectMgr | ( | ) |
Definition at line 91 of file CachedObjectMgr.cpp.
References m_cachedObjects, and SafeDelete().

Definition at line 227 of file CachedObjectMgr.cpp.
References CachedObjectMgr::CacheRecord::cache, PyRep::Clone(), PyBuffer::content(), CRC32::Generate(), GetFileTimeNow(), m_cachedObjects, CachedObjectMgr::CacheRecord::objectID, OIDToString(), SafeDelete(), Buffer::size(), sLog, CachedObjectMgr::CacheRecord::timestamp, and CachedObjectMgr::CacheRecord::version.
Referenced by UpdateCache(), and UpdateCacheFromSS().


Definition at line 285 of file CachedObjectMgr.cpp.
References PyCachedObject::cache, PyRep::Clone(), PyCachedObject::compressed, PyCachedObject::Encode(), HackCacheNodeID, m_cachedObjects, MarshalHeaderByte, PyCachedObject::nodeID, PyCachedObject::objectID, OIDToString(), PyCachedObject::shared, sLog, PyCachedObject::timestamp, and PyCachedObject::version.
Referenced by GetCachedObject().


| PyObject * CachedObjectMgr::GetCachedObject | ( | const std::string & | objectID | ) |
Definition at line 276 of file CachedObjectMgr.cpp.
References GetCachedObject(), and PyDecRef.

|
protected |
Definition at line 543 of file CachedObjectMgr.cpp.
References Base64::encode(), Marshal(), and Buffer::size().
Referenced by LoadCachedFile().


| bool CachedObjectMgr::HaveCached | ( | const std::string & | objectID | ) | const |
Definition at line 151 of file CachedObjectMgr.cpp.
References PyDecRef.
Referenced by ObjCacheService::_LoadCachableObject(), and ObjCacheService::IsCacheLoaded().

| bool CachedObjectMgr::HaveCached | ( | const PyRep * | objectID | ) | const |
Definition at line 160 of file CachedObjectMgr.cpp.
References m_cachedObjects, OIDToString(), and PyIncRef.

| void CachedObjectMgr::InvalidateCache | ( | const PyRep * | objectID | ) |
Definition at line 168 of file CachedObjectMgr.cpp.
References m_cachedObjects, OIDToString(), PyIncRef, and SafeDelete().
Referenced by ObjCacheService::InvalidateCache().


Definition at line 314 of file CachedObjectMgr.cpp.
References m_cachedObjects, and OIDToString().

| PyCachedCall * CachedObjectMgr::LoadCachedCall | ( | const char * | filename, |
| const char * | oname | ||
| ) |
Definition at line 526 of file CachedObjectMgr.cpp.
References PyCachedCall::Decode(), LoadCachedFile(), and SafeDelete().

| PySubStream * CachedObjectMgr::LoadCachedFile | ( | const char * | obj_name | ) |
Definition at line 457 of file CachedObjectMgr.cpp.
References PyDecRef.
Referenced by ObjCacheService::_LoadCachableObject(), LoadCachedCall(), ObjCacheService::LoadCachedFile(), LoadCachedFile(), and LoadCachedObject().

| PySubStream * CachedObjectMgr::LoadCachedFile | ( | PyRep * | key, |
| const char * | oname | ||
| ) |
Definition at line 465 of file CachedObjectMgr.cpp.
References GetCacheFileName(), and LoadCachedFile().

| PySubStream * CachedObjectMgr::LoadCachedFile | ( | const char * | filename, |
| const char * | oname | ||
| ) |
new PyBuffer() never freed Definition at line 476 of file CachedObjectMgr.cpp.
References filesize(), SafeDelete(), and sLog.

| bool CachedObjectMgr::LoadCachedFromFile | ( | const std::string & | cacheDir, |
| const std::string & | objectID | ||
| ) |
Definition at line 327 of file CachedObjectMgr.cpp.
References PyDecRef.
Referenced by ObjCacheService::_LoadCachableObject().

| bool CachedObjectMgr::LoadCachedFromFile | ( | const std::string & | cacheDir, |
| const PyRep * | objectID | ||
| ) |
LoadCachedFromFile
Load a cached object from file.
Definition at line 341 of file CachedObjectMgr.cpp.
References CachedObjectMgr::CacheRecord::cache, CacheFileMagic, PyRep::Clone(), CacheFileHeader::length, m_cachedObjects, CacheFileHeader::magic, CachedObjectMgr::CacheRecord::objectID, OIDToString(), SafeDelete(), CacheFileHeader::timestamp, CachedObjectMgr::CacheRecord::timestamp, CacheFileHeader::version, and CachedObjectMgr::CacheRecord::version.

| PyCachedObjectDecoder * CachedObjectMgr::LoadCachedObject | ( | const char * | filename, |
| const char * | oname | ||
| ) |
Definition at line 511 of file CachedObjectMgr.cpp.
References PyCachedObjectDecoder::Decode(), LoadCachedFile(), and SafeDelete().
Referenced by ObjectToSQL().


Definition at line 265 of file CachedObjectMgr.cpp.
References m_cachedObjects, and OIDToString().
Referenced by ObjCacheService::GetCacheHint(), MakeCacheHint(), ObjCacheService::MakeObjectCachedMethodCallResult(), and ObjCacheService::MakeObjectCachedSessionMethodCallResult().


| PyObject * CachedObjectMgr::MakeCacheHint | ( | const std::string & | objectID | ) |
Definition at line 256 of file CachedObjectMgr.cpp.
References MakeCacheHint(), and PyDecRef.

|
static |
Definition at line 139 of file CachedObjectMgr.cpp.
References PyRep::Dump(), StringCollapseVisitor::result, sLog, and PyRep::visit().
Referenced by ObjCacheService::_LoadCachableObject(), _UpdateCache(), GetCachedObject(), ObjCacheService::GetCacheHint(), HaveCached(), InvalidateCache(), IsCacheUpToDate(), LoadCachedFromFile(), MakeCacheHint(), and SaveCachedToFile().


| bool CachedObjectMgr::SaveCachedToFile | ( | const std::string & | cacheDir, |
| const std::string & | objectID | ||
| ) | const |
Definition at line 393 of file CachedObjectMgr.cpp.
References PyDecRef.
Referenced by ObjCacheService::_LoadCachableObject().

| bool CachedObjectMgr::SaveCachedToFile | ( | const std::string & | cacheDir, |
| const PyRep * | objectID | ||
| ) | const |
Definition at line 401 of file CachedObjectMgr.cpp.
References CacheFileMagic, CacheFileHeader::length, m_cachedObjects, CacheFileHeader::magic, OIDToString(), CacheFileHeader::timestamp, and CacheFileHeader::version.

| void CachedObjectMgr::UpdateCache | ( | const std::string & | objectID, |
| PyRep ** | in_cached_data | ||
| ) |
Definition at line 197 of file CachedObjectMgr.cpp.
References PyDecRef.
Referenced by ObjCacheService::_LoadCachableObject(), and ObjCacheService::GiveCache().

Definition at line 204 of file CachedObjectMgr.cpp.
References _UpdateCache(), MarshalDeflate(), SafeDelete(), and sLog.

| void CachedObjectMgr::UpdateCacheFromSS | ( | const std::string & | objectID, |
| PySubStream ** | in_cached_data | ||
| ) |
Definition at line 182 of file CachedObjectMgr.cpp.
References _UpdateCache(), PyCachedObjectDecoder::cache, PySubStream::data(), PyCachedObjectDecoder::Decode(), PyDecRef, and sLog.
Referenced by ObjCacheService::_LoadCachableObject().


|
protected |
Definition at line 122 of file CachedObjectMgr.h.
Referenced by _UpdateCache(), GetCachedObject(), HaveCached(), InvalidateCache(), IsCacheUpToDate(), LoadCachedFromFile(), MakeCacheHint(), SaveCachedToFile(), and ~CachedObjectMgr().