本文整理汇总了C++中Package::declare_if_needed方法的典型用法代码示例。如果您正苦于以下问题:C++ Package::declare_if_needed方法的具体用法?C++ Package::declare_if_needed怎么用?C++ Package::declare_if_needed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Package
的用法示例。
在下文中一共展示了Package::declare_if_needed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compute_type
void Package::compute_type(WrapperStr name, UmlTypeSpec & typespec,
Class ** need_object)
{
typespec.type = 0;
typespec.explicit_type = 0;
// no base type like int
Class * cl;
if (((cl = Defined[name]) != 0) ||
((cl = Undefined[name]) != 0) ||
((cl = classes[name]) != 0)) {
if (need_object != 0)
*need_object = cl;
typespec.type = cl->get_uml();
return;
}
UmlClass * uml_cl;
if ((uml_cl = user_classes[name]) != 0) {
typespec.type = uml_cl;
return;
}
if ((cl = php_classes[name]) != 0) {
// a php class
if (need_object != 0)
*need_object = cl;
typespec.type = cl->get_uml();
return;
}
if (need_object == 0)
typespec.explicit_type = name;
else if (! Lex::identifierp(name))
// strange
typespec.explicit_type = name;
else {
// the class does not already exist, create it
Package * pack = package_unknown();
cl = pack->declare_if_needed(name, FALSE);
typespec.type = cl->get_uml();
*need_object = cl;
}
}