本文整理汇总了C++中RuntimeType类的典型用法代码示例。如果您正苦于以下问题:C++ RuntimeType类的具体用法?C++ RuntimeType怎么用?C++ RuntimeType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RuntimeType类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
RuntimeType
RuntimeType::setKnownClass(const Class* klass) const {
assert(isObject());
RuntimeType rtt;
rtt.m_kind = VALUE;
rtt.m_value.outerType = outerType();
rtt.m_value.klass = m_value.klass;
rtt.m_value.knownClass = klass;
rtt.consistencyCheck();
return rtt;
}
示例2: assert
RuntimeType
RuntimeType::setArrayKind(ArrayData::ArrayKind arrayKind) const {
assert(isArray() || (isRef() && innerType() == KindOfArray));
RuntimeType rtt;
rtt.m_kind = this->m_kind;
rtt.m_value.outerType = outerType();
rtt.m_value.innerType = innerType();
rtt.m_value.arrayKindValid = true;
rtt.m_value.arrayKind = arrayKind;
rtt.consistencyCheck();
return rtt;
}
示例3: ASSERT
RuntimeType RuntimeType::box() const {
ASSERT(m_kind == VALUE);
if (m_value.outerType == KindOfRef) {
consistencyCheck();
return *this;
}
RuntimeType rtt;
rtt.m_value.outerType = KindOfRef;
rtt.m_value.innerType = m_value.outerType;
rtt.consistencyCheck();
return rtt;
}
示例4: assert
RuntimeType
RuntimeType::setKnownClass(const Class* klass) const {
assert(isObject() || (isRef() && innerType() == KindOfObject));
RuntimeType rtt;
rtt.m_kind = this->m_kind;
rtt.m_value.outerType = outerType();
rtt.m_value.innerType = innerType();
rtt.m_value.klass = m_value.klass;
rtt.m_value.knownClass = klass;
rtt.consistencyCheck();
return rtt;
}
示例5: if
Type::Type(const RuntimeType& rtt)
: m_bits(bitsFromDataType(rtt.outerType(), rtt.innerType()))
, m_class(nullptr)
{
if (rtt.outerType() == KindOfObject && rtt.hasKnownClass()) {
m_class = rtt.knownClass();
} else if (rtt.outerType() == KindOfArray && rtt.hasArrayKind()) {
m_arrayKindValid = true;
m_arrayKind = rtt.arrayKind();
}
}
示例6: if
Type::Type(const RuntimeType& rtt)
: m_bits(bitsFromDataType(rtt.outerType(), rtt.innerType()))
, m_hasConstVal(false)
, m_class(nullptr)
{
if (rtt.outerType() == KindOfObject && rtt.hasKnownClass()) {
m_class = rtt.knownClass();
} else if (rtt.outerType() == KindOfArray && rtt.hasArrayKind()) {
m_arrayInfo = makeArrayInfo(rtt.arrayKind(), nullptr);
}
}
示例7: fromRuntimeType
Type Type::fromRuntimeType(const RuntimeType& rtt) {
return fromDataType(rtt.outerType(), rtt.innerType(), rtt.knownClass());
}