Extended attributes

TGrafBundle3D has a CreateBundleIterator function that returns a TGrafBundleIterator3D instance for iterating through the extended attributes of a TGrafBundle3D. Extended attributes are created with the TGrafAttribute class and adopted through the TGrafBundle3D::AdoptGrafAttribute function. Extending attributes is described in Chapter 11.

    virtual TGrafBundleIterator3D* CreateGrafBundleIterator();
The following code fragment shows how you might iterate through a bundle and orphan all of its extended attributes. An attribute retrieved through the iteration operation is stored as a TGrafAttribute instance so that you can orphan the attribute by calling the TGrafBundle3D::OrphanGrafAttribute function.

      TGrafBundle3D* bundle;
      TGrafBundleIterator3D* iterator = bundle>CreateGrafBundleIterator( TRUE );
      
      for( const TGrafAttribute* attrib = iterator>First(); attrib != NIL; 
                      attrib = ( TGrafAttribute* )iterator>Next() )
          bundle>OrphanGrafAttribute( attrib>GetName() );
      
      delete iterator;

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker