Defining a new AttributeGroupHandle and InternalAttributeGroup

Much of the time you can use TAttributeGroup directly. In some cases, you might want the reference semantics offered by TAttributeGroupHandle. You might also want to derive new classes from either of these to attach additional information to the group.

This is similar to defining new shared attributes. The main addition is the use of NotifyChanged, which you might want to override because of the explicitly shared semantics of TAttributeGroupHandle.

The primary difference is the setup of the relationship between the group handle and its internal group. Because there is no manager for internal groups as there is for internal attributes, the internal group is just set directly.

      TPaperAttributeGroup::TPaperAttributeGroup(const TStandardText& paperName)
          : TAttributeGroupHandle()
      {
          TAttributeGroupHandle::SetInternalAttributeGroup(
              new TInternalPaperAttributeGroup(paperName));
      }
This group simply defines a TStandardText name for the group. As this is straightforward, no interface or other implementation is shown.


[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