本文整理汇总了C++中ClassList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ClassList::end方法的具体用法?C++ ClassList::end怎么用?C++ ClassList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassList
的用法示例。
在下文中一共展示了ClassList::end方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: typedefMap
static void typedefMap( QMap<QString, QString> & map, ClassDom klass )
{
const TypeAliasList aliasList = klass->typeAliasList();
for( TypeAliasList::ConstIterator it=aliasList.begin(); it!=aliasList.end(); ++it )
map[ ( *it )->name() ] = ( *it )->type();
const ClassList classList = klass->classList();
for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
typedefMap( map, *it );
}
示例2: typeNameList
static void typeNameList( QStringList & path, QStringList & lst, ClassDom klass )
{
path.push_back( klass->name() );
lst << path.join( "::" );
const ClassList classList = klass->classList();
for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
typeNameList( path, lst, *it );
path.pop_back();
}
示例3: refreshClasses
void refreshClasses(ClassViewPart *part, KComboView *view, const QString &dom)
{
view->clear();
view->setCurrentText(EmptyClasses);
NamespaceDom nsdom;
if (dom == "::")
nsdom = part->codeModel()->globalNamespace();
else
{
nsdom = namespaceByName(part->codeModel()->globalNamespace(), dom);
if (!nsdom)
return;
}
ClassList classes = nsdom->classList();
for (ClassList::const_iterator it = classes.begin(); it != classes.end(); ++it)
{
ClassItem *item = new ClassItem(part, view->listView(), part->languageSupport()->formatModelItem(*it), *it);
view->addItem(item);
item->setOpen(true);
}
}
示例4:
bool
FreezeScript::AnalyzeTransformVisitor::checkClasses(const ClassDeclPtr& from, const ClassDeclPtr& to)
{
string fromScoped = from->scoped();
string toScoped = to->scoped();
if(fromScoped == toScoped)
{
return true;
}
//
// The types don't match, so check them for compatibility. Specifically,
// look up the old type id in the new Slice and see if it has the target
// type as a base class.
//
TypeList l = to->unit()->lookupTypeNoBuiltin(from->scoped(), false);
if(!l.empty())
{
ClassDeclPtr decl = ClassDeclPtr::dynamicCast(l.front());
if(decl)
{
ClassDefPtr def = decl->definition();
if(def)
{
ClassList bases = def->allBases();
for(ClassList::iterator p = bases.begin(); p != bases.end(); ++p)
{
if((*p)->scoped() == toScoped)
{
return true;
}
}
}
}
}
return false;
}
示例5: __construct
bool
CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
{
string scoped = p->scoped();
string name = getName(p);
string type = getTypeVar(p);
string abs = getAbsolute(p, _ns);
string prxName = getName(p, "Prx");
string prxType = getTypeVar(p, "Prx");
string prxAbs = getAbsolute(p, _ns, "", "Prx");
ClassList bases = p->bases();
ClassDefPtr base;
OperationList ops = p->operations();
OperationList::iterator oli;
DataMemberList members = p->dataMembers();
bool isInterface = p->isInterface();
bool isAbstract = isInterface || p->allOperations().size() > 0; // Don't use isAbstract() - see bug 3739
startNamespace(p);
//
// Define the class.
//
if(isInterface)
{
_out << sp << nl << "if(!interface_exists('" << escapeName(abs) << "'))";
_out << sb;
_out << nl << "interface " << name;
if(!bases.empty())
{
_out << " extends ";
for(ClassList::const_iterator q = bases.begin(); q != bases.end(); ++q)
{
if(q != bases.begin())
{
_out << ", ";
}
_out << getAbsolute(*q, _ns);
}
}
_out << sb;
for(oli = ops.begin(); oli != ops.end(); ++oli)
{
_out << nl << "public function " << fixIdent((*oli)->name()) << '(';
ParamDeclList params = (*oli)->parameters();
for(ParamDeclList::iterator q = params.begin(); q != params.end(); ++q)
{
if(q != params.begin())
{
_out << ", ";
}
_out << '$' << fixIdent((*q)->name());
}
_out << ");";
}
_out << eb;
}
else
{
_out << sp << nl << "if(!class_exists('" << escapeName(abs) << "'))";
_out << sb;
_out << nl;
if(isAbstract)
{
_out << "abstract ";
}
_out << "class " << name;
if(!bases.empty() && !bases.front()->isInterface())
{
base = bases.front();
bases.pop_front();
}
if(base)
{
_out << " extends " << getAbsolute(base, _ns);
}
else
{
if(!p->isLocal())
{
_out << " extends " << scopedToName("::Ice::ObjectImpl", _ns);
}
}
if(!bases.empty())
{
_out << " implements ";
for(ClassList::const_iterator q = bases.begin(); q != bases.end(); ++q)
{
if(q != bases.begin())
{
_out << ", ";
}
_out << getAbsolute(*q, _ns);
}
}
_out << sb;
//
// __construct
//.........这里部分代码省略.........
示例6: fixIdent
bool
Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
{
string scoped = p->scoped();
string name = fixIdent(p->name(), IdentToUpper);
ClassList bases = p->bases();
ClassDefPtr base;
OperationList ops = p->operations();
OperationList::iterator oli;
//
// Define a mix-in module for the class.
//
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << "_mixin)";
_out.inc();
_out << nl << "module " << name << "_mixin";
_out.inc();
if(!p->isLocal())
{
if(!bases.empty() && !bases.front()->isInterface())
{
base = bases.front();
_out << nl << "include " << getAbsolute(bases.front(), IdentToUpper) << "_mixin";
}
else
{
_out << nl << "include ::Ice::Object_mixin";
}
//
// ice_ids
//
ClassList allBases = p->allBases();
StringList ids;
#if defined(__IBMCPP__) && defined(NDEBUG)
//
// VisualAge C++ 6.0 does not see that ClassDef is a Contained,
// when inlining is on. The code below issues a warning: better
// than an error!
//
transform(allBases.begin(), allBases.end(), back_inserter(ids),
IceUtil::constMemFun<string,ClassDef>(&Contained::scoped));
#else
transform(allBases.begin(), allBases.end(), back_inserter(ids), IceUtil::constMemFun(&Contained::scoped));
#endif
StringList other;
other.push_back(scoped);
other.push_back("::Ice::Object");
other.sort();
ids.merge(other);
ids.unique();
_out << sp << nl << "def ice_ids(current=nil)";
_out.inc();
_out << nl << "[";
for(StringList::iterator q = ids.begin(); q != ids.end(); ++q)
{
if(q != ids.begin())
{
_out << ", ";
}
_out << "'" << *q << "'";
}
_out << ']';
_out.dec();
_out << nl << "end";
//
// ice_id
//
_out << sp << nl << "def ice_id(current=nil)";
_out.inc();
_out << nl << "'" << scoped << "'";
_out.dec();
_out << nl << "end";
}
if(!ops.empty())
{
//
// Emit a comment for each operation.
//
_out << sp
<< nl << "#"
<< nl << "# Operation signatures."
<< nl << "#";
for(oli = ops.begin(); oli != ops.end(); ++oli)
{
string fixedOpName = fixIdent((*oli)->name(), IdentNormal);
/* If AMI/AMD is ever implemented...
if(!p->isLocal() && (p->hasMetaData("amd") || (*oli)->hasMetaData("amd")))
{
_out << nl << "# def " << fixedOpName << "_async(_cb";
ParamDeclList params = (*oli)->parameters();
for(ParamDeclList::iterator pli = params.begin(); pli != params.end(); ++pli)
{
if(!(*pli)->isOutParam())
{
//.........这里部分代码省略.........
示例7: typeToString
bool Slice::ChecksumVisitor::visitClassDefStart(const ClassDefPtr& p)
{
if (p->isLocal()) {
return false;
}
ClassList bases = p->bases();
ostringstream ostr;
if (p->isInterface()) {
ostr << "interface ";
} else {
ostr << "class ";
}
ostr << p->name();
if (!bases.empty()) {
if (!bases.front()->isInterface()) {
ostr << " extends " << bases.front()->scoped();
bases.erase(bases.begin());
}
if (!bases.empty()) {
if (p->isInterface()) {
ostr << " extends ";
} else {
ostr << " implements ";
}
for (ClassList::iterator q = bases.begin(); q != bases.end(); ++q) {
if (q != bases.begin()) {
ostr << ", ";
}
ostr << (*q)->scoped();
}
}
}
ostr << endl;
if (p->hasDataMembers()) {
DataMemberList members = p->dataMembers();
for (DataMemberList::iterator q = members.begin(); q != members.end(); ++q) {
ostr << typeToString((*q)->type()) << ' ' << (*q)->name() << endl;
}
}
if (p->hasOperations()) {
OperationList ops = p->operations();
for (OperationList::iterator q = ops.begin(); q != ops.end(); ++q) {
ostr << typeToString((*q)->returnType()) << ' ' << (*q)->name() << '(';
ParamDeclList params = (*q)->parameters();
for (ParamDeclList::iterator r = params.begin(); r != params.end(); ++r) {
if (r != params.begin()) {
ostr << ", ";
}
if ((*r)->isOutParam()) {
ostr << "out ";
}
ostr << typeToString((*r)->type()) << ' ' << (*r)->name();
}
ostr << ')';
ExceptionList ex = (*q)->throws();
if (!ex.empty()) {
ostr << " throws ";
for (ExceptionList::iterator s = ex.begin(); s != ex.end(); ++s) {
if (s != ex.begin()) {
ostr << ", ";
}
ostr << (*s)->scoped();
}
}
ostr << endl;
}
}
updateMap(p->scoped(), ostr.str());
return false;
}