本文整理汇总了C++中PreClassEmitter::attrs方法的典型用法代码示例。如果您正苦于以下问题:C++ PreClassEmitter::attrs方法的具体用法?C++ PreClassEmitter::attrs怎么用?C++ PreClassEmitter::attrs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PreClassEmitter
的用法示例。
在下文中一共展示了PreClassEmitter::attrs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: txn
void PreClassRepoProxy::GetPreClassesStmt
::get(UnitEmitter& ue) {
RepoTxn txn(m_repo);
if (!prepared()) {
std::stringstream ssSelect;
ssSelect << "SELECT preClassId,name,hoistable,extraData FROM "
<< m_repo.table(m_repoId, "PreClass")
<< " WHERE unitSn == @unitSn ORDER BY preClassId ASC;";
txn.prepare(*this, ssSelect.str());
}
RepoTxnQuery query(txn, *this);
query.bindInt64("@unitSn", ue.sn());
do {
query.step();
if (query.row()) {
Id preClassId; /**/ query.getId(0, preClassId);
StringData* name; /**/ query.getStaticString(1, name);
int hoistable; /**/ query.getInt(2, hoistable);
BlobDecoder extraBlob = /**/ query.getBlob(3);
PreClassEmitter* pce = ue.newPreClassEmitter(
name, (PreClass::Hoistable)hoistable);
pce->serdeMetaData(extraBlob);
if (!SystemLib::s_inited) {
assert(pce->attrs() & AttrPersistent);
assert(pce->attrs() & AttrUnique);
}
assert(pce->id() == preClassId);
}
} while (!query.done());
txn.commit();
}
示例2: FTRACE
std::unique_ptr<php::Class> parse_class(ParseUnitState& puState,
borrowed_ptr<php::Unit> unit,
const PreClassEmitter& pce) {
FTRACE(2, " class: {}\n", pce.name()->data());
auto ret = folly::make_unique<php::Class>();
ret->name = pce.name();
ret->srcInfo = php::SrcInfo { pce.getLocation(),
pce.docComment() };
ret->unit = unit;
ret->closureContextCls = nullptr;
ret->parentName = pce.parentName()->empty() ? nullptr
: pce.parentName();
ret->attrs = static_cast<Attr>(pce.attrs() & ~AttrNoOverride);
ret->hoistability = pce.hoistability();
ret->userAttributes = pce.userAttributes();
for (auto& iface : pce.interfaces()) {
ret->interfaceNames.push_back(iface);
}
ret->usedTraitNames = pce.usedTraits();
ret->traitPrecRules = pce.traitPrecRules();
ret->traitAliasRules = pce.traitAliasRules();
ret->requirements = pce.requirements();
parse_methods(puState, borrow(ret), unit, pce);
auto& propMap = pce.propMap();
for (size_t idx = 0; idx < propMap.size(); ++idx) {
auto& prop = propMap[idx];
ret->properties.push_back(
php::Prop {
prop.name(),
prop.attrs(),
prop.docComment(),
prop.typeConstraint(),
prop.val()
}
);
}
auto& constMap = pce.constMap();
for (size_t idx = 0; idx < constMap.size(); ++idx) {
auto& cconst = constMap[idx];
ret->constants.push_back(
php::Const {
cconst.name(),
borrow(ret),
cconst.val(),
cconst.phpCode(),
cconst.typeConstraint()
}
);
}
ret->enumBaseTy = pce.enumBaseTy();
return ret;
}