Programming Reference: ODPlatformTypeList

# Programming Reference

## ODPlatformTypeList

Class Definition File | PfTypLs.idl
Class C++ Binding | PfTypLs.xh

Class Hierarchy

    SOMObject
       ODObject
          ODPlatformTypeList

Description

An object of the ODPlatformTypeList class is an ordered set of ODPlatformType elements.

A platform type list is an ordered set of elements, each specifying a different value of some platform-specific type. Because these elements are of the ODPlatformType type, they can represent any platform-specific value used to identify data formats for data interchange.

To create a platform type list, call the CreatePlatformTypeList method of the storage-system object. If the call to that method specifies an existing platform type list, the new platform type list is initialized to a copy of that list; otherwise, the new list is initialized to an empty list (a list with no elements).

You can add elements one at a time to the end of the platform type list. OpenDoc ensures that each element of a platform 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 ODPlatformTypeListIterator class and use it to iterate through the list.

Methods

The methods defined by the ODPlatformTypeList class include:

- AddLast
- Contains
- Count
- CreatePlatformTypeListIterator
- Remove

Overridden Methods | There are no methods overridden by the ODPlatformTypeList class.

### AddLast

This method adds an element to the end of this platform type list.

Signature

    void AddLast (ODPlatformType type)

Parameters

type (ODPlatformType) - input

  The element to be added to the list.

Returns

None.

Remarks

If this platform type list already contains the specified element, no action is taken; otherwise, 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 platform type list.

Related Methods

- ODPlatformTypeList::Contains
- ODPlatformTypeList::Remove

### Contains

This method indicates whether this platform type list contains the specified element.

Signature

    ODBoolean Contains (ODPlatformType type)

Parameters

type (ODPlatformType) - input

  The element to be tested for inclusion in this list.

Returns

rv (ODBoolean) - returns

  A flag indicating whether this platform type list contains the specified element.

  kODTrue | This platform type list contains the specified element.
  kODFalse | This platform type list does not contain the specified element.

Related Methods

- ODPlatformTypeList::AddLast
- ODPlatformTypeList::Remove

### Count

This method returns the number of elements in this platform type list.

Signature

    ODULong Count ()

Parameters

None.

Returns

rv (ODULong) - returns

  The number of elements in this platform type list or 0 if the list is empty.

### CreatePlatformTypeListIterator

This method creates a platform type-list iterator for this platform type list.

Signature

    ODPlatformTypeListIterator *CreatePlatformTypeListIterator ()

Parameters

None.

Returns

rv (ODPlatformTypeListIterator *) - returns

  A reference to the newly created platform type-list iterator.

Remarks

You call this method if you need to apply an operation to each element of this platform type list.

While you are using the returned platform type-list iterator, you must not modify this platform type list; in particular, you must not add or remove elements, and you must not delete this platform type list.

You must delete the returned platform type-list iterator when it is no longer needed.

Exception Handling

kODErrOutOfMemory | There is not enough memory to create the iterator.

### Remove

This method removes the specified element from this platform type list.

Signature

    void Remove (ODPlatformType type)

Parameters

type (ODPlatformType) - input

  The element to be removed.

Returns

None.

Remarks

If this platform type list does not contain the specified element, no action is taken.

Related Methods

- ODPlatformTypeList::AddLast
- ODPlatformTypeList::Contains

[ Top | Previous | Next | Contents | Index | Documentation Homepage ]