Class: TSimpleAttributeGroup

Declaration: AttributeGroup.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TAttributeGroup

Inherited By:

TInternalAttributeGroup

Purpose:

TSimpleAttributeGroup is the base class for internal attribute groups, which are the objects to which the attribute group handles refer. This class does not support inheritance or notification of any kind.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TSimpleAttributeGroup is the base class for internal attribute groups, which are the objects to which the attribute group handles refer. The principal derived class is TInternalAttributeGroup.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TSimpleAttributeGroup::TSimpleAttributeGroup

  1. TSimpleAttributeGroup ()
  2. TSimpleAttributeGroup (const TSimpleAttributeGroup & copyFrom)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and may be called directly to construct a TSimpleAttributeGroup object.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::~TSimpleAttributeGroup

virtual ~ TSimpleAttributeGroup ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::DeepCopy

virtual TAttributeGroup * DeepCopy ()

Interface Category:

API.

Purpose:

Clones the attribute group.

Calling Context:

Called directly to copy an attribute group and its contents.

Parameters:

Return Value:

Returns a pointer to the new attribute group.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The user is responsible for deleting the resulting attribute group.

Member Function: TSimpleAttributeGroup::Member

  1. virtual TAttribute * Member (const TAttribute & anAttribute, EWhereToLookup lookup =TAttributeGroup :: kLocalAndParents) const
  2. virtual bool Member (const TAttributeGroup & anAttributeGroup, EWhereToLookup lookup =TAttributeGroup :: kLocalAndParents) const

Interface Category:

API.

Purpose:

  1. Determines if the given attribute is in this attribute group.
  2. Returns true if the given set of attributes are all members of this group.

Calling Context:

Called directly to determine if a specified attribute or group of attributes is contained in an attribute group.

Parameters:

Return Value:

  1. If there is an attribute in the group that is equivalent to the given attribute, then a pointer to the similar attribute is returned.
  2. Returns true if the given set of attributes are all members of this group.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::Add

  1. virtual void Add (const TAttribute & anAttribute)
  2. virtual void Add (const TAttributeGroup & aGroup)

Interface Category:

API.

Purpose:

  1. Adds a copy of the given attribute to this attribute group.
  2. Adds a copy of each attribute in the given group to this attribute group, replacing any duplicates. Only attributes in the given group are added. Attributes that are only inherited through the parent chain are not added.

Calling Context:

Called directly to add an attribute or group of attributes to an attribute group.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::AddAllInherited

virtual void AddAllInherited (const TAttributeGroup & aGroup)

Interface Category:

API.

Purpose:

Copies of all of the attributes in the specified group, including those in the parent chain for that group, and adds the copied attributes to the current attribute group. Duplicates are replaced.

Calling Context:

Called directly to add attributes from one group and all of the groups in its parent chain into another group.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::CountAllInherited

virtual long CountAllInherited () const

Interface Category:

API.

Purpose:

Returns the number of elements in this group and all of its ancestors.

Calling Context:

Called directly to determine the number of attributes contained in an attribute group and all of the attribute groups in its parent chain.

Parameters:

Return Value:

Returns the number of elements in this group and all of its ancestors.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TSimpleAttributeGroup does not support inheritance or notification of any kind, so in this class CountAllInherited does essentially the same thing as Count. However, Count is a much cheaper operation, so it is recommended that you use Count as opposed to CountAllInherited for this particular class.

Member Function: TSimpleAttributeGroup::Count

virtual long Count () const

Interface Category:

API.

Purpose:

Returns the number of elements in this attribute group.

Calling Context:

Called directly to determine the number of attributes contained in an attribute group.

Parameters:

Return Value:

Returns the number of elements in this attribute group.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::Delete

virtual void Delete (const TAttribute & anAttribute)

Interface Category:

API.

Purpose:

Removes the specified attribute from this attribute group and deletes it.

Calling Context:

Called directly to remove an attribute from an attribute group and delete it.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::DeleteAll

virtual void DeleteAll ()

Interface Category:

API.

Purpose:

Deletes all of the attributes in this attribute group.

Calling Context:

Called directly to remove and delete all of the attributes from an attribute group.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::CreateIterator

virtual TIteratorOver < TAttribute > * CreateIterator () const

Interface Category:

API.

Purpose:

Creates and returns an iterator that only iterates over the contents of this attribute group.

Calling Context:

Called directly to create an iterator to iterate over the attributes in an attribute group.

Parameters:

Return Value:

A pointer to an iterator that only iterates over the contents of this attribute group.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The user of this member function is responsible for deleting the iterator that is returned.

Member Function: TSimpleAttributeGroup::GetAllInheritedAttributes

virtual void GetAllInheritedAttributes (TSetOf < TAttribute > & fillIn) const

Interface Category:

API.

Purpose:

Builds an attribute group consisting of all attributes that are anywhere in this attribute group and this group's parent chain.

Calling Context:

Called to get a collection of all of the attributes that are contained anywhere in an attribute group and its parent chain.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The attributes in the resulting set are owned by the attribute group. They are not to be deleted.

Member Function: TSimpleAttributeGroup::GetParent

virtual TAttributeGroup * GetParent () const

Interface Category:

API.

Purpose:

Returns a pointer to this attribute group's parent group. Note: TSimpleAttributeGroup does not support inheritance, so in this class this member function returns NIL.

Calling Context:

Called directly to get a pointer to an attribute group's parent group.

Parameters:

Return Value:

Returns NIL.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::SetParent

virtual void SetParent (TAttributeGroup * myNewParent)

Interface Category:

API.

Purpose:

Sets the parent group pointer to point to the specified group. Note: TSimpleAttributeGroup does not support inheritance, so in this class this member function calls NotifyChanged to propagate change notification, but does not actually make any changes.

Calling Context:

Called directly to set the attribute group's parent group.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::NotifyChanged

virtual void NotifyChanged ()

Interface Category:

API.

Purpose:

Notifies all dependent attribute groups that this group has changed. Note: TSimpleAttributeGroup does not support notification, so in this class this member function simply returns true. This member function is much more important in classes that are derived from this class, such as TInternalAttributeGroup.

Calling Context:

Called when notification is turned on and this attribute group has been changed (something added or removed).

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::BeginChanges

virtual void BeginChanges ()

Interface Category:

API.

Purpose:

There is a changes pending flag which is used to prevent notification when a batch of changes is to be made to an attribute group. This member function sets this flag to true to indicate that a batch of changes is about to be made, and that change notification should be postponed until after the changes has been made. Note: TSimpleAttributeGroup does not support notification, so in this class this member function does nothing.

Calling Context:

This member function is used to prevent notification on each change in a batch of changes to an attribute group.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::EndChanges

virtual void EndChanges ()

Interface Category:

API.

Purpose:

This member function calls NotifyChanged to propagate change notification, and resets the changes pending flag to false so notification will no longer be postponed. Note: TSimpleAttributeGroup does not support notification, so in this class this member function does nothing.

Calling Context:

Call this member function when you have finished doing a batch of changes to an attribute group that supports notification. This member function calls the NotifyChanged member function so that all dependent attribute groups will be notified that the group has changed.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::ChangesPending

virtual bool ChangesPending ()

Interface Category:

API.

Purpose:

Returns the value of the flag that is used to indicate if notification is currently postponed. Note: TSimpleAttributeGroup does not support notification, so in this class this member function always returns false.

Calling Context:

Called directly to determine if notification is currently postponed on the attribute group.

Parameters:

Return Value:

TSimpleAttributeGroup does not support notification, so in this class this member function always returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::SetChangesPending

virtual void SetChangesPending (bool pending)

Interface Category:

API.

Purpose:

Sets the value of the flag that is used to indicate if notification is currently postponed. Setting the flag to true indicates that notification is to be postponed, and setting the flag to false indicates that notification is no longer postponed. Note: TSimpleAttributeGroup does not support notification, so in this class this member function does nothing.

Calling Context:

Called directly to change the value of the flag that indicates if change notification is currently postponed for an attribute group.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::operator=

TSimpleAttributeGroup & operator =(const TSimpleAttributeGroup & group)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::operator>>=

virtual TStream & operator >>=(TStream & toStream) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleAttributeGroup::operator<<=

virtual TStream & operator <<= (TStream & fromStream)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.