本文整理汇总了C++中UMLClassifier::setIsReference方法的典型用法代码示例。如果您正苦于以下问题:C++ UMLClassifier::setIsReference方法的具体用法?C++ UMLClassifier::setIsReference怎么用?C++ UMLClassifier::setIsReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMLClassifier
的用法示例。
在下文中一共展示了UMLClassifier::setIsReference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: l
void CppTree2Uml::parseTypedef(TypedefAST* ast)
{
TypeSpecifierAST* typeSpec = ast->typeSpec();
InitDeclaratorListAST* declarators = ast->initDeclaratorList();
if (typeSpec && declarators){
QString typeId;
if (typeSpec->name())
typeId = typeSpec->name()->text();
QList<InitDeclaratorAST*> l(declarators->initDeclaratorList());
InitDeclaratorAST* initDecl = 0;
for (int i = 0; i < l.size(); ++i) {
initDecl = l.at(i);
if (initDecl==0) break;
QString type, id;
if (initDecl->declarator()){
type = typeOfDeclaration(typeSpec, initDecl->declarator());
DeclaratorAST* d = initDecl->declarator();
while (d->subDeclarator()){
d = d->subDeclarator();
}
if (d->declaratorId())
id = d->declaratorId()->text();
}
/* @todo Trace typedefs back to their root type for deciding
whether to build a Datatype (for pointers.) */
/* check out if the ID type is a Datatype
ex: typedef unsigned int uint;
where unsigned int is a known datatype
I'm not sure if setIsReference() should be run
*/
bool isDatatype = Import_Utils::isDatatype(typeId, m_currentNamespace[m_nsCnt]);
if (type.contains(QLatin1Char('*')) || isDatatype) {
UMLObject *inner = 0;
if (m_currentNamespace[m_nsCnt] &&
m_currentNamespace[m_nsCnt]->baseType() == UMLObject::ot_Class &&
typeId == m_currentNamespace[m_nsCnt]->name())
inner = m_currentNamespace[m_nsCnt];
else
inner = Import_Utils::createUMLObject(UMLObject::ot_Class, typeId,
m_currentNamespace[m_nsCnt]);
UMLObject *typedefObj =
Import_Utils::createUMLObject(UMLObject::ot_Datatype, id,
m_currentNamespace[m_nsCnt]);
UMLClassifier *dt = static_cast<UMLClassifier*>(typedefObj);
dt->setIsReference();
dt->setOriginType(static_cast<UMLClassifier*>(inner));
} else {
Import_Utils::createUMLObject(UMLObject::ot_Class, id,
m_currentNamespace[m_nsCnt],
QString() /* doc */,
QLatin1String("typedef") /* stereotype */);
}
}
}
}