本文整理汇总了C++中UmlOperation::set_isAbstract方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlOperation::set_isAbstract方法的具体用法?C++ UmlOperation::set_isAbstract怎么用?C++ UmlOperation::set_isAbstract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlOperation
的用法示例。
在下文中一共展示了UmlOperation::set_isAbstract方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: import
void UmlOperation::import(File & f, UmlClass * parent)
{
QByteArray s;
if (f.read(s) != STRING)
f.syntaxError(s, "operations's name");
QByteArray id;
QByteArray ste;
QByteArray doc;
QHash<QByteArray, QByteArray*> prop;
QByteArray s2;
int k;
do {
k = f.readDefinitionBeginning(s2, id, ste, doc, prop);
}
while (id.isEmpty());
UmlOperation * x;
if (scanning) {
QByteArray name;
if (s.left(8) != "operator")
name = (s.at(0) == '~')
? ("~" + legalName(s.mid(1)))
: legalName(s);
else
name = s;
if ((x = UmlBaseOperation::create(parent, name)) == 0) {
UmlCom::trace("<br>cannot create operation '" + s + "' in " +
parent->fullName());
throw 0;
}
newItem(x, id);
if (!ste.isEmpty()) {
bool managed = FALSE;
QStringList l = QString(ste).split(",");
for (QStringList::Iterator it = l.begin();
it != l.end();
++it) {
if ((*it) == "const") {
managed = TRUE;
x->set_isCppConst(TRUE);
}
else if ((*it) == "abstract") {
managed = TRUE;
x->set_isAbstract(TRUE);
x->set_isCppVirtual(TRUE);
}
else if ((*it) == "virtual") {
managed = TRUE;
x->set_isCppVirtual(TRUE);
}
else if ((*it) == "static") {
managed = TRUE;
x->set_isClassMember(TRUE);
}
}
if (!managed)
x->set_Stereotype(ste);
}
if (!doc.isEmpty())
x->set_Description(doc);
}
else if ((x = (UmlOperation *) findItem(id, anOperation)) == 0) {
UmlCom::trace("<br>unknown operation '" + s + "' in " +
parent->fullName());
throw 0;
}
else {
switch (((UmlClass *) x->parent())->language()) {
case Cplusplus:
case AnsiCplusplus:
case VCplusplus:
x->cplusplus(prop);
break;
case Oracle8:
x->oracle8(prop);
break;
case Corba:
x->corba(prop);
break;
case Java:
x->java(prop);
break;
default:
break;
}
//.........这里部分代码省略.........
示例2: new_one
bool UmlOperation::new_one(Class * container, const Q3CString & name,
const Q3ValueList<FormalParameterList> & tmplts,
const Q3CString & oper_templ,
UmlTypeSpec & type, Q3CString str_actuals,
UmlClass * first_actual_class, Q3CString type_def,
aVisibility visibility,
bool finalp, bool abstractp, bool staticp,
bool nativep, bool strictfp, bool synchronizedp,
const Q3CString & array, Q3CString comment,
Q3CString description, Q3CString annotation
#ifdef ROUNDTRIP
, bool roundtrip, Q3PtrList<UmlItem> & expected_order
#endif
)
{
// the "(" was read
#ifdef TRACE
QLOG_INFO() <<"OPERATION '" << name << "'\n";
#endif
UmlClass * cl = container->get_uml();
UmlOperation * op;
#ifdef ROUNDTRIP
bool may_roundtrip = roundtrip &&
(!container->from_libp() || (visibility != PrivateVisibility));
UmlTypeSpec return_type;
Q3ValueList<UmlParameter> params;
Q3ValueList<UmlTypeSpec> exceptions;
Q3CString body;
if (may_roundtrip)
#else
if (
# ifdef REVERSE
container->from_libp() &&
# endif
(visibility == PrivateVisibility))
#endif
op = 0;
else {
op = UmlBaseOperation::create(cl, name);
if (op == 0) {
JavaCatWindow::trace(Q3CString("<font face=helvetica><b>cannot add operation <i>")
+ name + "</i> in <i>" + cl->name()
+ "</i></b></font><br>");
return FALSE;
}
#ifndef ROUNDTRIP
# if defined(REVERSE)
Statistic::one_operation_more();
# endif
#endif
}
Q3CString def;
#ifdef ROUNDTRIP
if (may_roundtrip || (op != 0)) {
#else
if (op != 0) {
op->set_Visibility(visibility);
if (staticp) op->set_isClassMember(TRUE);
if (abstractp) op->set_isAbstract(TRUE);
if (finalp) op->set_isJavaFinal(TRUE);
if (synchronizedp) op->set_isJavaSynchronized(TRUE);
if (! annotation.isEmpty()) op->set_JavaAnnotations(annotation);
#endif
def = JavaSettings::operationDef();
int index;
if (((index = def.find("${(}")) == -1) ||
((index = def.find("${)}", index + 4)) == -1) ||
((index = def.find("${throws}", index + 4)) == -1) ||
(def.find("${body}", index + 9) == -1) ||
((index = def.find("${type}")) == -1)) {
// use a definition where ${body] is not indented
def = " ${comment}${@}${visibility}${final}${static}${abstract}${synchronized}${type} ${name}${(}${)}${throws}${staticnl}{\n${body}}\n";
index = def.find("${type}");
}
if (!array.isEmpty())
def.insert(index + 7, (const char *)array);
if (nativep) {
def.insert(index, "native ");
index += 7;
// no body
int index2 = def.find("${throws}", index+7);
if (index2 != -1) {
def.resize(index2 + 12);
def[index2 + 9] = ';';
def[index2 + 10] = '\n';
}
//.........这里部分代码省略.........