本文整理汇总了C++中BlockScopeRawPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ BlockScopeRawPtr::get方法的具体用法?C++ BlockScopeRawPtr::get怎么用?C++ BlockScopeRawPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlockScopeRawPtr
的用法示例。
在下文中一共展示了BlockScopeRawPtr::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addUse
void BlockScope::addUse(BlockScopeRawPtr user, int useKinds) {
if (is(ClassScope) ? static_cast<HPHP::ClassScope*>(this)->isUserClass() :
is(FunctionScope) &&
static_cast<HPHP::FunctionScope*>(this)->isUserFunction()) {
if (user.get() == this) {
m_selfUser |= useKinds;
return;
}
Lock lock(s_depsMutex);
Lock l2(s_jobStateMutex);
std::pair<BlockScopeRawPtrFlagsHashMap::iterator,bool> val =
m_userMap.insert(BlockScopeRawPtrFlagsHashMap::value_type(user,
useKinds));
if (val.second) {
m_orderedUsers.push_back(&*val.first);
user->m_orderedDeps.push_back(
std::make_pair(BlockScopeRawPtr(this), &(val.first->second)));
ASSERT(user->getMark() != BlockScope::MarkReady &&
user->getMark() != BlockScope::MarkWaiting);
} else {
val.first->second |= useKinds;
}
}
}
示例2: hasUser
bool BlockScope::hasUser(BlockScopeRawPtr user, int useKinds) const {
if (is(ClassScope) ?
static_cast<const HPHP::ClassScope*>(this)->isUserClass() :
is(FunctionScope) &&
static_cast<const HPHP::FunctionScope*>(this)->isUserFunction()) {
if (user.get() == this) {
return m_selfUser & useKinds;
}
Lock lock(s_depsMutex);
const auto it = m_userMap.find(user);
return it != m_userMap.end() && it->second & useKinds;
}
return true; // builtins/systems always have a user of anybody
}
示例3: setVolatile
void ClassScope::setVolatile() {
if (!m_volatile) {
m_volatile = true;
Lock lock(s_depsMutex);
const BlockScopeRawPtrFlagsVec &orderedUsers = getOrderedUsers();
for (BlockScopeRawPtrFlagsVec::const_iterator it = orderedUsers.begin(),
end = orderedUsers.end(); it != end; ++it) {
BlockScopeRawPtrFlagsVec::value_type pf = *it;
if (pf->second & UseKindParentRef) {
BlockScopeRawPtr scope = pf->first;
if (scope->is(BlockScope::ClassScope)) {
((HPHP::ClassScope*)scope.get())->setVolatile();
}
}
}
}
}
示例4: addUse
void BlockScope::addUse(BlockScopeRawPtr user, int useKinds) {
if ((is(ClassScope) || is(FunctionScope)) && !isBuiltin()) {
if (user.get() == this) {
m_selfUser |= useKinds;
return;
}
Lock lock(s_depsMutex);
Lock l2(s_jobStateMutex);
auto val = m_userMap.emplace(user, useKinds);
if (val.second) {
m_orderedUsers.push_back(&*val.first);
user->m_orderedDeps.emplace_back(BlockScopeRawPtr{this},
&(val.first->second));
assert(user->getMark() != BlockScope::MarkReady &&
user->getMark() != BlockScope::MarkWaiting);
} else {
val.first->second |= useKinds;
}
}
}