~ubuntu-branches/ubuntu/maverick/aspectc++/maverick

« back to all changes in this revision

Viewing changes to Puma/gen-release/step2/src/CObjectInfo.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-04-10 17:40:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080410174052-xdnsm7oi8hauyyf1
Tags: 1.0pre4~svn.20080409+dfsg-3
Fix another missing include, this time in Ag++/StdSystem.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
396
396
  }
397
397
}
398
398
 
399
 
const char *CObjectInfo::QualName () {
400
 
  if (! _QualName && _Name.empty() == false ) {
401
 
    // for template instances the qualified name is the name of the template
 
399
const char *CObjectInfo::QualName (bool abs, bool tdef) {
 
400
  if ((! _QualName && _Name.empty() == false) || abs != _abs || tdef != _tdef) {
 
401
//    // for template instances the qualified name is the name of the template
402
402
    CObjectInfo *obj = this;
403
 
    if (TemplateInstance ())
404
 
      obj = TemplateInstance ()->Template ();
 
403
//    if (TemplateInstance ())
 
404
//      obj = TemplateInstance ()->Template ();
405
405
      
406
406
    // get the scope object
407
 
    CObjectInfo *info = obj->QualifiedScope ();
408
 
    if (!info) info = obj->AssignedScope (); 
409
 
    if (!info) info = obj->Scope (); 
410
 
    Array<const char*> scopes;
411
 
    while (info && ! info->isAnonymous () &&
412
 
           (info->Record () || 
413
 
            (info->NamespaceInfo () && ! info->FileInfo ()))) {
414
 
      scopes.append (info->Name ());
415
 
      info = info->Scope (); 
416
 
    }
 
407
    CScopeInfo *info = obj->QualifiedScope ();
 
408
        if (!info) info = obj->AssignedScope (); 
 
409
    if (!info) info = obj->Scope ();
 
410
 
 
411
                // if this an anonymous (generated) template scope, skip it
 
412
                while (info && info->isNamespace () && info->isAnonymous () &&
 
413
                  !info->GlobalScope ()) {
 
414
                        info = info->Scope ();
 
415
                }
 
416
    
417
417
    std::ostringstream qname;
418
 
    for (long i = scopes.length () - 1; i >= 0; i--)
419
 
      qname << scopes.lookup (i) << "::";
420
 
    qname << _Name.c_str () << std::ends;
 
418
    if (info->TypeInfo () && info->TypeInfo ()->isRecord ()) {
 
419
            // if the scope has an associated type we can use CTypeInfo::TypeText ()
 
420
        info->TypeInfo ()->TypeText (qname, 0, abs, tdef);
 
421
        qname << "::";
 
422
    }
 
423
    else { 
 
424
                // if the scope is not a type we run through all the namespace 
 
425
            Array<const char*> scopes;
 
426
          while (info && ! info->isAnonymous () &&
 
427
               (info->Record () || 
 
428
              (info->NamespaceInfo () && ! info->FileInfo ()))) {
 
429
        scopes.append (info->Name ());
 
430
        info = info->Scope (); 
 
431
        }
 
432
            if (abs)
 
433
                qname << "::";
 
434
        for (long i = scopes.length () - 1; i >= 0; i--)
 
435
        qname << scopes.lookup (i) << "::";
 
436
    }
 
437
    qname << _Name.c_str ();
421
438
    _QualName = StrCol::dup (qname.str ().c_str ());
 
439
    
 
440
    // remember these parameters, because on a different request the name
 
441
    // has to be regenerated
 
442
    _abs = abs;
 
443
    _tdef = tdef;
422
444
  }
423
445
  return _QualName;
424
446
}