本文整理汇总了C++中Type::AcquireReference方法的典型用法代码示例。如果您正苦于以下问题:C++ Type::AcquireReference方法的具体用法?C++ Type::AcquireReference怎么用?C++ Type::AcquireReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type::AcquireReference方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetInfo
void SetInfo(Type* type, ValueLocation* location)
{
if (type != NULL)
type->AcquireReference();
if (location != NULL)
location->AcquireReference();
if (this->type != NULL)
this->type->ReleaseReference();
if (this->location != NULL)
this->location->ReleaseReference();
this->type = type;
this->location = location;
}
示例2: cacheLocker
status_t
TeamDebugInfo::GetType(GlobalTypeCache* cache, const BString& name,
const TypeLookupConstraints& constraints, Type*& _type)
{
// maybe the type is already cached
AutoLocker<GlobalTypeCache> cacheLocker(cache);
Type* type = cache->GetType(name, constraints);
if (type != NULL) {
type->AcquireReference();
_type = type;
return B_OK;
}
cacheLocker.Unlock();
// Clone the image list and get references to the images, so we can iterate
// through them without locking.
AutoLocker<BLocker> locker(fLock);
ImageList images;
for (int32 i = 0; ImageDebugInfo* imageDebugInfo = fImages.ItemAt(i); i++) {
if (images.AddItem(imageDebugInfo))
imageDebugInfo->AcquireReference();
}
locker.Unlock();
// get the type
status_t error = B_ENTRY_NOT_FOUND;
for (int32 i = 0; ImageDebugInfo* imageDebugInfo = images.ItemAt(i); i++) {
error = imageDebugInfo->GetType(cache, name, constraints, type);
if (error == B_OK) {
_type = type;
break;
}
}
// release the references
for (int32 i = 0; ImageDebugInfo* imageDebugInfo = images.ItemAt(i); i++)
imageDebugInfo->ReleaseReference();
return error;
}
示例3:
TypeEntry(Type* type)
:
type(type)
{
type->AcquireReference();
}