34 template <
class ObjType>
35 class RefCountedObject;
37 #define CHAR_PTR(c) ((char*)c)
95 template <
class ObjType>
96 class Handle :
public HandleBase {
104 PDBTemplateBase typeInfo;
114 Handle(
const std::nullptr_t rhs);
115 Handle<ObjType>& operator=(
const std::nullptr_t rhs);
120 Handle(GenericHandle rhs);
123 friend bool operator==(
const Handle<ObjType>& lhs, std::nullptr_t rhs) {
124 return lhs.isNullPtr();
126 friend bool operator==(std::nullptr_t rhs,
const Handle<ObjType>& lhs) {
127 return lhs.isNullPtr();
129 friend bool operator!=(std::nullptr_t rhs,
const Handle<ObjType>& lhs) {
130 return !lhs.isNullPtr();
132 friend bool operator!=(
const Handle<ObjType>& lhs, std::nullptr_t rhs) {
133 return !lhs.isNullPtr();
135 bool isNullPtr()
const;
138 size_t hash()
const {
139 return (*this)->hash();
143 unsigned getRefCount();
164 Handle<ObjType> copyTargetToCurrentAllocationBlock();
187 Handle(
const RefCountedObject<ObjType>* fromMe);
188 template <
class ObjTypeTwo>
189 Handle(
const RefCountedObject<ObjTypeTwo>* fromMe);
195 Handle(
const Handle<ObjType>& fromMe);
196 template <
class ObjTypeTwo>
197 Handle(
const Handle<ObjTypeTwo>& fromMe);
207 Handle& operator=(
const RefCountedObject<ObjType>* fromMe);
208 template <
class ObjTypeTwo>
209 Handle& operator=(
const RefCountedObject<ObjTypeTwo>* fromMe);
215 Handle<ObjType>& operator=(
const Handle<ObjType>& fromMe);
216 template <
class ObjTypeTwo>
217 Handle<ObjType>& operator=(
const Handle<ObjTypeTwo>& fromMe);
220 ObjType* operator->()
const;
221 ObjType& operator*()
const;
224 void setOffset(int64_t toMe);
225 int64_t getOffset()
const;
228 int16_t getTypeCode();
231 int32_t getExactTypeInfoValue()
const;
232 void setExactTypeInfoValue(int32_t toMe);
235 RefCountedObject<ObjType>* getTarget()
const;
239 Handle<ObjType>& shallowCopyToCurrentAllocationBlock(
const Handle<ObjType>& copyMe);
242 template <
class ObjTypeTwo>
245 template <
class Obj,
class... Args>
246 friend RefCountedObject<Obj>*
makeObject(Args&&... args);
247 template <
class OutObjType,
class InObjType>
248 friend Handle<OutObjType>
unsafeCast(Handle<InObjType>& castMe);
256 class GenericHandle {
258 PDBTemplateBase myBase;
262 GenericHandle(
int initValue) {
263 myBase.set(-initValue);
270 PDBTemplateBase& getMyBase() {
276 template <
class ObjTypeOne,
class ObjTypeTwo>
277 bool operator==(
const Handle<ObjTypeOne>& lhs,
const Handle<ObjTypeTwo>& rhs) {
278 if (lhs.isNullPtr() || rhs.isNullPtr())
283 template <
class ObjTypeOne,
class ObjTypeTwo>
284 bool operator==(
const ObjTypeOne& lhs,
const Handle<ObjTypeTwo>& rhs) {
290 template <
class ObjTypeOne,
class ObjTypeTwo>
291 bool operator==(
const Handle<ObjTypeOne>& lhs,
const ObjTypeTwo& rhs) {
LambdaTree< bool > operator==(LambdaTree< LeftType > lhs, LambdaTree< RightType > rhs)
bool operator!=(const STLSlabAllocator< T > &left, const STLSlabAllocator< U > &right)
RefCountedObject< ObjType > * makeObject(Args &&...args)
Handle< OutObjType > unsafeCast(Handle< InObjType > &castMe)
void emptyOutContainingBlock(void *forMe)