Class Definition File | TypeList.idl |
Class C++ Binding | TypeList.xh |
Class Hierarchy |
SOMObject ODObject ODTypeList |
Description | An object of the ODTypeList class is an ordered set of ODType elements. A type list is an ordered set of elements, each specifying a different value. Elements are of the ODType type. ODType types are strings that can specify part kinds, focus types, or storage-unit types. Most often, all elements of a type list are part kinds. Because an ODType value is a pointer to an ISO string, any value to be added to a type list is copied first. The pointer is not added to the list, but the string is copied and a pointer to the new copy is added to the list. To create a type list, call the CreateTypeList method of the storage-system object. If the call to this method specifies an existing type list, the new type list is initialized to contain a copy of each element in that list. The elements in the new type list are in the same order as the elements of the original list. Otherwise, the new list is initialized to an empty list. You can add elements, one at a time, to the end of the type list. OpenDoc ensures that each element of a type list is unique; if you attempt to add a value that is already in the list, the list remains unchanged. You can remove elements from the list, test whether the list contains a particular element, and get the number of elements in the list. If you need to perform an operation for each element of the list, you can create an object of the ODTypeListIterator class and use it to iterate through the list. |
Methods | The methods defined by the ODTypeList class include: |
Overridden Methods | There are no methods overridden by the ODTypeList class. |
This method adds an element to the end of this type list.
Signature
void AddLast (ODType type) |
Parameters
Returns
None.
Remarks
If this type list already contains an element equal to the specified element, no action is taken; otherwise, a copy of the specified element is added to the end of the list.
Exception Handling
kODErrOutOfMemory | There is not enough memory to add the specified element to this type list. |
Related Methods
This method indicates whether this type list contains a specified element.
Signature
ODBoolean Contains (ODType type) |
Parameters
Returns
kODTrue | This type list contains an element equal to the specified element. |
kODFalse | This type list does not contain an element equal to the specified element. |
Related Methods
This method returns the number of elements in this type list.
Signature
ODULong Count () |
Parameters
None.
Returns
This method creates a type-list iterator for this type list.
Signature
ODTypeListIterator *CreateTypeListIterator () |
Parameters
None.
Returns
Remarks
You call this method if you need to apply an operation to each element of this type list.
While you are using the returned type-list iterator, you must not modify this type list; in particular, your must not add or remove elements, and you must not delete this type list.
You must delete the returned type-list iterator when it is no longer needed.
Exception Handling
kODErrOutOfMemory | There is not enough memory to create the iterator. |
This method removes a specified element from this type list.
Signature
void Remove (ODType type) |
Parameters
Returns
None.
Remarks
If this type list contains an element equal to the specified type, that element is removed from the list; if not, no action is taken.
Related Methods