KnowledgeInterfaces Interface CATIList

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATIList

Interface dedicated to the management of list objects.

A list is an ordered collection of items, which are objects.
This interface is multi implemented (on List feature and volatile list implementation).
Volatile list can reference any kind of object (CATBaseUnknown) including parameters (CATICkeParm).
List feature can only reference persisten features (CATISpecObject) or literals (CATICkeParm).
Lists are created with CATICkeParmFactory

See also:


Method Index


o AllowDuplicateElements(int)
Prevents or allows duplication of elements.
o GetIndexOfItem(CATBaseUnknown*,int)
Retrieves the position of the first occurence if the item in the list, starting from the index iStartIndex included.
o GetItem(int,CATBaseUnknown_var&)
Retrieves an item in the list.
o GetListType()
Returns the type allowed for elements of the list.
o GetSize()
Returns the size of the list.
o InsertItem(int,CATBaseUnknown*)
Insert an item in the list.
o IsDuplicateElementsAllowed()
Indicates if the list can contain duplicate items.
o IsListTypeLocked()
Indicates if the list type has been locked.
o IsTypeSet()
Indicates if the type of the elements of the list has been set.
o LockListType()
Locks the type of the items in the list for users modifications.
o RemoveAll()
Removes all the items from the list.
o RemoveItem(int)
Removes an item from the list.
o Reorder(int,int)
Reorders an element by moving it from current position to target position.
o SetItem(int,CATBaseUnknown*)
Sets an item in the list.
o SetListType(CATUnicodeString&)
Limits the elements in the interface to instances of a certain type.
o UnLockListType()
UnLocks the List type modifications.
o UnsetListType()
Authorize objects of any type to be put in the list.

Methods


o AllowDuplicateElements
public virtual AllowDuplicateElements( iDuplicate)
Prevents or allows duplication of elements. Allowed by default.
Parameters:
iDuplicate
If iDuplicate is 0, prevents, otherwise, allows duplication. Note this method doesn't remove duplicate elements already present. It just allows to set whether duplicates should be alloed or not.
Returns:
classic HRESULT
o GetIndexOfItem
public virtual GetIndexOfItem( iValue,
iStartIndex= 1)
Retrieves the position of the first occurence if the item in the list, starting from the index iStartIndex included.
Parameters:
iValue
item
iStartIndex
index to start in the list
Returns:
index of the item and 0 if the item is not found. Returns 0 if the item is not found.
o GetItem
public virtual GetItem( iIndex,
oItem)
Retrieves an item in the list.
Parameters:
iIndex
Starts at 1.
oItem
Object to return.
Returns:
S_OK
if the index is comprised between 1 and the size of the list and the returned object is different from NULL.
S_FALSE
if the index is comprised between 1 and the size of the list but the returned object is equal to NULL.
E_FAIL
else.
o GetListType
public virtual GetListType()
Returns the type allowed for elements of the list. Returns a null string if type is not set.
o GetSize
public virtual GetSize()
Returns the size of the list. i.e. non null elements of the list.
Returns:
list size.
o InsertItem
public virtual InsertItem( index,
iValue)
Insert an item in the list. Does an AddRef on the item.
Parameters:
index
Starts at 1.
iValue
the inserted item.
Returns:
S_OK
if the index is comprised between 1 and the size of the list and if the object type is correct.
E_FAIL
if the object type is not correct, if index is out of bounds or if you try to insert an already existing element while IsDuplicateElementsAllowed is equal to FALSE.
o IsDuplicateElementsAllowed
public virtual IsDuplicateElementsAllowed()
Indicates if the list can contain duplicate items.
Returns:
1 if elements can be duplicated, 0 otherwise.
o IsListTypeLocked
public virtual IsListTypeLocked()
Indicates if the list type has been locked.
Returns:
1 if the list type is locked,0 if it is not Locked.
o IsTypeSet
public virtual IsTypeSet()
Indicates if the type of the elements of the list has been set.
Returns:
1 if elements of the list must be of a given type, 0 otherwise.
o LockListType
public virtual LockListType()
Locks the type of the items in the list for users modifications.
Returns:
E_FAIL if the list type has not been valuated.
o RemoveAll
public virtual RemoveAll()
Removes all the items from the list. Does a Release on the items.
Returns:
S_OK
if the the operation succeeded and if all the objects have been removed.
E_FAIL
if the objects have not been removed.
o RemoveItem
public virtual RemoveItem( index)
Removes an item from the list. Does a Release on the item. This method pushes back all following items of the list.
Parameters:
index
index of the object to suppress. Starts at 1.
Returns:
S_OK
if the index is comprised between 1 and the size of the list and if the operation succeeded.
E_FAIL
if the object has not been removed or if index is out of bounds.
o Reorder
public virtual Reorder( iCurrent,
iTarget)
Reorders an element by moving it from current position to target position. Doesn't change the list if either position is out of the list.
Parameters:
iCurrent
current position of item to reorder
iTarget
target position
Returns:
S_OK
if the the operation succeeded.
E_FAIL
if cannot reorder.
o SetItem
public virtual SetItem( index,
iValue)
Sets an item in the list. Does an AddRef on the item.
Parameters:
index
Starts at 1.
iValue
the item to set.
Returns:
S_OK
if the index is comprised between 0 (means append) and the size of the list and if the object type is correct.
E_FAIL
if the object type is not correct, if index is out of bounds or if you try to insert an already existing element while IsDuplicateElementsAllowed is equal to FALSE.
o SetListType
public virtual SetListType( const iTypeName)
Limits the elements in the interface to instances of a certain type. If there are already elements of another type, returns E_FAIL. Note the argument should be a type structure, but which one??? Passing a null argument will have same effect as UnsetListType.
Parameters:
iTypeName
Name of the type.
Returns:
classic HRESULT
o UnLockListType
public virtual UnLockListType()
UnLocks the List type modifications.
Returns:
E_FAIL if the list type has not been valuated.
o UnsetListType
public virtual UnsetListType()
Authorize objects of any type to be put in the list.
Returns:
classic HRESULT

This object is included in the file: CATIList.h
If needed, your Imakefile.mk should include the module: KnowledgeItf

Copyright © 1999-2015, Dassault Systèmes. All rights reserved.