ReadPtr(const_cast<T*&>(PtrRef), AllowBackpatch);
}
+
+ template <typename T>
+ void ReadPtr(T*& PtrRef, const SerializedPtrID& PtrID, bool AllowBackpatch = true) {
+ ReadUIntPtr(reinterpret_cast<uintptr_t&>(PtrRef), PtrID, AllowBackpatch);
+ }
+
+ template <typename T>
+ void ReadPtr(const T*& PtrRef, const SerializedPtrID& PtrID,
+ bool AllowBackpatch = true) {
+
+ ReadPtr(const_cast<T*&>(PtrRef), PtrID, AllowBackpatch);
+ }
+
template <typename T>
T* ReadPtr() { T* x; ReadPtr<T>(x,false); return x; }
- void ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch = true);
+ void ReadUIntPtr(uintptr_t& PtrRef, const SerializedPtrID& PtrID,
+ bool AllowBackpatch = true);
+
+ void ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch = true) {
+ ReadUIntPtr(PtrRef,ReadPtrID(),AllowBackpatch);
+ }
template <typename T>
T& ReadRef() {
return *p;
}
- void RegisterPtr(SerializedPtrID PtrId, const void* Ptr);
+ void RegisterPtr(const SerializedPtrID& PtrID, const void* Ptr);
void RegisterPtr(const void* Ptr) {
RegisterPtr(ReadPtrID(),Ptr);
}
template<typename T>
- void RegisterRef(SerializedPtrID PtrID, const T& x) {
+ void RegisterRef(const SerializedPtrID& PtrID, const T& x) {
RegisterPtr(PtrID,&x);
}
buff.push_back('\0');
}
-void Deserializer::RegisterPtr(SerializedPtrID PtrId, const void* Ptr) {
+void Deserializer::RegisterPtr(const SerializedPtrID& PtrId,
+ const void* Ptr) {
+
MapTy::value_type& E = BPatchMap.FindAndConstruct(BPKey(PtrId));
assert (!HasFinalPtr(E) && "Pointer already registered.");
SetPtr(E,Ptr);
}
-void Deserializer::ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch) {
- SerializedPtrID PtrId = ReadPtrID();
-
+void Deserializer::ReadUIntPtr(uintptr_t& PtrRef,
+ const SerializedPtrID& PtrId,
+ bool AllowBackpatch) {
if (PtrId == 0) {
PtrRef = 0;
return;