oaGroup Class Reference

Inheritance diagram for oaGroup:

oaObject


Public Methods

void destroy ()
void getName (oaString &name) const
oaDomain getGroupDomain () const
oaGroupType getGroupType () const
oaGroupDeleteWhen getDeleteWhen () const
oaBoolean isUniqueName () const
oaBoolean isOrdered () const
oaBoolean isEmpty () const
void setName (const oaString &name)
void setGroupType (oaGroupType type)
void setDeleteWhen (oaGroupDeleteWhen deleteWhen)
void setUniqueName (oaBoolean value)
void setOrdered (oaBoolean value)
void setLeader (oaGroupMember *leader=NULL)
oaBoolean hasDefaultConstraintGroup () const
oaConstraintGroupgetDefaultConstraintGroup () const
oaObjectgetOwner ()
oaGroupMembergetLeader ()
oaGroupDefgetDef () const
oaCollection< oaGroupMember, oaGroup > getMembers () const

Static Public Methods

oaGroup * create (oaObject *database, const oaString &name, oaGroupType groupType=oacSetGroupType, oaBoolean isUniqueName=true, oaBoolean isOrdered=false, oaGroupDeleteWhen deleteWhen=oacNeverGroupDeleteWhen)
oaGroup * create (oaObject *database, const oaString &name, oaDomain domain, oaGroupType groupType=oacSetGroupType, oaBoolean isUniqueName=true, oaBoolean isOrdered=false, oaGroupDeleteWhen deleteWhen=oacNeverGroupDeleteWhen)
oaGroup * create (oaObject *database, const oaString &name, oaGroupDef *groupDef, oaGroupType groupType=oacSetGroupType, oaBoolean isUniqueName=true, oaBoolean isOrdered=false, oaGroupDeleteWhen deleteWhen=oacNeverGroupDeleteWhen)
oaGroup * create (oaObject *database, const oaString &name, oaDomain domain, oaGroupDef *groupDef, oaGroupType groupType=oacSetGroupType, oaBoolean isUniqueName=true, oaBoolean isOrdered=false, oaGroupDeleteWhen deleteWhen=oacNeverGroupDeleteWhen)

Public Types

enum  { dtIndex = oacBaseGroupDataType }
enum  { domain = oacNoDomain }

Detailed Description

The oaGroup class implements a general collection of database objects. This collection of objects is designated a group. Groups are associated with a specified database, and all added objects must be in the same database.

Groups are designed specifically for applications that need to extend the data model by adding new relationships, which are usually specific to the application. An application creates a group by using the oaGroup::create function and adds objects to groups by using the oaGroupMember::create function. You can also set certain attributes to manage a group.

An example of using a group is an application that clusters together multiple shapes and stores this relationship persistently. The application creates the group and adds the required shapes.

All groups have a name. When you create a group, you can indicate that the group name must be unique within a given database, and you can set or reset the unique name attribute after a group is created by using the oaGroup::setUniqueName function. If a group is marked as requiring a unique name, the database validates that no other group has the same name. The database also ensures that no other group is ever assigned the same name.

A group can be restricted to having members of a particular hierarchy domain by specifying this to the create API using the oaDomain argument. If the domain specified is oacNoDomain, then the group is not restricted; this is the same as not specifying a domain. If any other domain type is specified then all of the members of the group must be of the same domain.

Groups can either be sets or collections as specified with the oaGroupType enum. A given object may only appear once in a set whereas an object may appear in a collection multiple times. Only sets may have leaders.

A group of type set can optionally have a leader. A group leader can be specified when you create a group and set or reset after a group is created using the oaGroup::setLeader function. Specifying a group leader is useful when a group implements a set of objects that must be manipulated together. If an object of a group is designated the leader, other objects of the group are designated as followers. If a destroy, move, or copy operation, or an addition to or removal from an oaFigGroup are applied to an oaGroup leader, the same operation also applies to the followers--for example, if the leader is destroyed, its followers are destroyed.

Note: The leader/follower relationship only applies to destroy, move, or copy operations, or to additions or removals from an oaFigGroup. Other operations performed on the leader do not apply to its followers.

The members of a group can be ordered by using the oaGroup::setOrdered function. The default order of group members corresponds to the order in which they are added, with the first member added being the first in the order. You can change the order of members in an ordered group by using oaGroupMember::moveToFirst and oaGroupMember::moveAfter functions.

Also note that oaGroup::setLeader moves its object to the first group position. If you later call oaGroupMember::moveToFirst() on a member of an ordered group to move a different member in front of the leader, an exception will be thrown.

Groups can be constructed in oaDesign, oaTech and oaWafer databases. Any object in a given database may be placed in a group in that database except for the database itself and the following paged parasitic objects: oaDevice, oaNode, oaParasiticNetwork, and oaSubNetwork. All members of a group must be objects in the same database the group was created in.

The database can automatically delete a group when a particular event occurs. This is controlled by the oaGroupDeleteWhen enum. You can use it to specify that the group is automatically deleted whenever any member is deleted, or when it becomes empty, or that it is never deleted automatically, only by oaGroup::destroy.

The use of groups and other database extensions should be considered carefully. These extensions are not part of the standard OpenAccess data model and can interfere with the interoperability of tools in a flow. See the Extending the Database section of the Programmers Guide for another method of adding extensions that can be more compact and higher performance.

The collection of groups in a given database is implemented by the getGroups function in each database class. See oaDesign::getGroups, oaDMData::getGroups, oaLib::getGroups and oaTech::getGroups.

The oaGroup class can be observed by deriving from oaObserver<oaGroup>.


Member Function Documentation

oaGroup * oaGroup::create oaObject *    database,
const oaString &    name,
oaDomain    domain,
oaGroupDef *    groupDef,
oaGroupType    groupType = oacSetGroupType,
oaBoolean    isUniqueName = true,
oaBoolean    isOrdered = false,
oaGroupDeleteWhen    deleteWhen = oacNeverGroupDeleteWhen
[static]
 

This function creates a group for the specified object with the specified attributes. If isUniqueName is true and the specified name is not unique among all groups on the specified object, an exception will be thrown. When a domain other than oacNoDomain is specified, objects added to the group are restricted to the domain specified.

Parameters:
database The design, technology, or design-data database in which the group is created.
name The name of the group.
domain The domain of the group. If the domain is oacNoDomain, group membership is not restricted. Otherwise, each member of the group must be of the specified domain.
groupDef A pointer to the oaGroupDef object that defines this group.
groupType Specifies whether objects can appear in this set multiple times (see oaGroupType).
isUniqueName Specifies whether the group name must be unique within the database; the default is true.
isOrdered Specifies if the order of objects in the group must be maintained; the default is false.
deleteWhen An enum that indicates the event that causes the group to be deleted (if ever); the default is oacNeverGroupDeleteWhen
Exceptions:
oacInvalidUniqueGroupName 

oaGroup * oaGroup::create oaObject *    database,
const oaString &    name,
oaGroupDef *    groupDef,
oaGroupType    groupType = oacSetGroupType,
oaBoolean    isUniqueName = true,
oaBoolean    isOrdered = false,
oaGroupDeleteWhen    deleteWhen = oacNeverGroupDeleteWhen
[static]
 

This function creates a group for the specified object with the specified attributes. If isUniqueName is true and the specified name is not unique among all groups on the specified object, an exception will be thrown.

Parameters:
database The design, technology, or design-data database in which the group is created.
name The name of the group.
groupDef A pointer to the oaGroupDef object that defines this group.
groupType Specifies whether objects can appear in this set multiple times (see oaGroupType).
isUniqueName Specifies whether the group name must be unique within the database; the default is true.
isOrdered Specifies if the order of objects in the group must be maintained; the default is false.
deleteWhen An enum that indicates the event that causes the group to be deleted (if ever); the default is oacNeverGroupDeleteWhen
Exceptions:
oacInvalidUniqueGroupName 

oaGroup * oaGroup::create oaObject *    database,
const oaString &    name,
oaDomain    domain,
oaGroupType    groupType = oacSetGroupType,
oaBoolean    isUniqueName = true,
oaBoolean    isOrdered = false,
oaGroupDeleteWhen    deleteWhen = oacNeverGroupDeleteWhen
[static]
 

This function creates a group in the specified database, which must be a design, technology, or design-data database. This variant allows the specification of a hierarchy domain that the group is restricted to.

Parameters:
database The design, technology, or design-data database in which to create the group
name The name of the group
domain The domain of the group. If the domain is oacNoDomain, then the membership is not restricted. Otherwise, each member of the group must be of the specified domain.
groupType Specifies whether objects can appear in this set multiple times (see oaGroupTypeEnum).
isUniqueName Specifies if the group name must be unique within the database; the default is true
isOrdered Specifies if the order of objects in the group must be maintained; the default is false
deleteWhen An enum that indicates the event that causes the group to delete, if ever; the default is oacNeverGroupDeleteWhen
Exceptions:
oacInvalidDatabase 
oacInvalidUniqueGroupName 

oaGroup * oaGroup::create oaObject *    database,
const oaString &    name,
oaGroupType    groupType = oacSetGroupType,
oaBoolean    isUniqueName = true,
oaBoolean    isOrdered = false,
oaGroupDeleteWhen    deleteWhen = oacNeverGroupDeleteWhen
[static]
 

This function creates a group in the specified database, which must be a design, technology database, or design library database.

Parameters:
database The design, technology, or design-data database in which to create the group
name The name of the group
groupType Specifies whether objects can appear in this set multiple times (see oaGroupTypeEnum).
isUniqueName Specifies if the group name must be unique within the database; the default is true
isOrdered Specifies if the order of objects in the group must be maintained; the default is false
deleteWhen An enum that indicates the event that causes the group to be deleted, if ever; the default is oacNeverGroupDeleteWhen
Exceptions:
oacInvalidDatabase 
oacInvalidUniqueGroupName 

void oaGroup::destroy  
 

This function destroys this group. All of the oaGroupMember objects in the group are destroyed as well as the group. This doesn't affect the database objects that the oaGroupMembers point to.

oaGroupDef * oaGroup::getDef   const
 

This function returns a pointer to the group def to which this group refers.

oaConstraintGroup * oaGroup::getDefaultConstraintGroup   const
 

This function returns the constraint group for this oaGroup. If no constraints exist on the oaGroup, a new constraint group is created. Constraints in this constraint group apply to the objects which are members of the group.

oaGroupDeleteWhen oaGroup::getDeleteWhen   const
 

This function returns the deleteWhen attribute of this group. This attribute indicates the event, if any, that causes this group to be destroyed.

oaDomain oaGroup::getGroupDomain   const
 

This function returns the hierarchy domain that this group is restricted to. If no domain has been specified, oacNoDomain is returned.

oaGroupType oaGroup::getGroupType   const
 

This function returns whether this group is a collection or a set (see oaGroupTypeEnum).

oaGroupMember * oaGroup::getLeader  
 

This function returns the leader member of this group. If the group doesn't have a leader, NULL is returned.

oaCollection oaGroup::getMembers   const
 

This function returns a collection of all the groupMembers in this group.

void oaGroup::getName oaString &    name const
 

This function returns the name of this group in name.

oaObject * oaGroup::getOwner  
 

This function returns a pointer to the database that contains this group.

oaBoolean oaGroup::hasDefaultConstraintGroup   const
 

This function returns a Boolean indicating whether there are constraints associated with this oaGroup.

oaBoolean oaGroup::isEmpty   const
 

This function returns a boolean value indicating whether this group has any group members.

oaBoolean oaGroup::isOrdered   const
 

This function returns a boolean value indicating whether the objects in this group are ordered.

oaBoolean oaGroup::isUniqueName   const
 

This function returns a boolean value indicating whether the name of this group must be unique.

void oaGroup::setDeleteWhen oaGroupDeleteWhen    deleteWhen
 

This function sets the event type that determines when, if ever, this group will be deleted.

void oaGroup::setGroupType oaGroupType    type
 

This function sets whether this group is a collection or a set (see oaGroupTypeEnum).

Exceptions:
oacInvalidGroupForSameObj 

void oaGroup::setLeader oaGroupMember *    leader = NULL
 

This function sets the specified group member to the leader of this group. If this group already has a leader, the leader is reset. If the specified group member is already the leader of this group, this function does nothing. If NULL is specified and this group has a leader, this group is set to be leaderless.

Note that this function moves the leader to the first group position. If you later call oaGroupMember::moveToFirst() on a member of an ordered group to move a different member in front of the leader, an exception will be thrown.

Exceptions:
oacInvalidGroupLeader 

void oaGroup::setName const oaString &    name
 

This function sets the name of this group to name.

Exceptions:
oacInvalidUniqueGroupName 

void oaGroup::setOrdered oaBoolean    value
 

This function sets the boolean value indicating whether the objects in this group are ordered.

void oaGroup::setUniqueName oaBoolean    value
 

This function sets the boolean value indicating whether the name of this group must be unique in the database that owns the group.

Exceptions:
oacInvalidUniqueGroupName 


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
dtIndex 

anonymous enum
 

Enumeration values:
domain 


The documentation for this class was generated from the following files:

Return to top of page