本文整理汇总了C++中CStrRef::isStatic方法的典型用法代码示例。如果您正苦于以下问题:C++ CStrRef::isStatic方法的具体用法?C++ CStrRef::isStatic怎么用?C++ CStrRef::isStatic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStrRef
的用法示例。
在下文中一共展示了CStrRef::isStatic方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: declareVariable
int Block::declareVariable(CStrRef var) {
ASSERT(var->isStatic());
VariableIndices::const_iterator it = m_variableIndices.find(var);
if (it == m_variableIndices.end()) {
int i = m_variableIndices.size();
m_variableIndices[var].set(var, i);
return i;
}
return it->second.idx();
}
示例2: write
void VariableSerializer::write(CStrRef v) {
if (m_type == APCSerialize && !v.isNull() && v->isStatic()) {
union {
char buf[8];
StringData *sd;
} u;
u.sd = v.get();
m_buf->append("S:");
m_buf->append(u.buf, 8);
m_buf->append(';');
} else {
v.serialize(this);
}
}
示例3: constructPrime
bool ConcurrentTableSharedStore::constructPrime(CStrRef v, KeyValuePair& item,
bool serialized) {
if (s_apc_file_storage.getState() != SharedStoreFileStorage::StateInvalid &&
(!v->isStatic() || serialized)) {
// StaticString for non-object should consume limited amount of space,
// not worth going through the file storage
// TODO: currently we double serialize string for uniform handling later,
// hopefully the unserialize won't be called often. We could further
// optimize by storing more type info.
String s = apc_serialize(v);
char *sAddr = s_apc_file_storage.put(s.data(), s.size());
if (sAddr) {
item.sAddr = sAddr;
item.sSize = serialized ? 0 - s.size() : s.size();
return false;
}
}
item.value = SharedVariant::Create(v, serialized);
return true;
}