FDO API Reference Feature Data Objects
Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION > Class Template Reference

#include <RestrictedNamedCollection.h>

Inherits FdoIDisposable.

Inheritance diagram for FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >:

[legend]
List of all members.

Detailed Description

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
class FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >

FdoRestrictedNamedCollection is an abstract template class that can be wrapped around a base collection of type specified by the BASECOLLECTION template argument. However, the members of this collection are restricted to being of a subtype of the type of members allowed in the base collection. The subtype is specified by the SUBOBJ template argument.

Any class deriving from this template must also defined a:

SUBOBJ* DownCast(BASEOBJ* value )

function, which must cast the member of the base type to the subtype. It is recommended that static_cast be used, when possible, to perform the down cast.

Note:
BASEOBJ must match the item class for BASECOLLECTION.

Definition at line 42 of file RestrictedNamedCollection.h.


Public Member Functions

virtual FdoInt32 Add (SUBOBJ *value)
 Adds the specified item to the end of the collection. Returns the index of the newly added item.
virtual void Clear ()
 Removes all items from the collection.
virtual bool Contains (const SUBOBJ *value) const
 Returns true if the collection contains the specified item, false otherwise.
virtual SUBOBJ * FindItem (const wchar_t *name) const
 Gets an item by name.
virtual const BASECOLLECTION * GetBaseCollection ()
 Returns a read only pointer to the base collection.
virtual FdoInt32 GetCount () const
 Gets the number of items in the collection.
virtual SUBOBJ * GetItem (const wchar_t *name) const
 Gets an item by name. Throws an invalid argument exception if the item is not in this collection.
virtual SUBOBJ * GetItem (FdoInt32 index) const
 Gets the item in the collection at the specified index. Throws an invalid argument exception if the index is out of range.
virtual FdoInt32 IndexOf (const SUBOBJ *value) const
 Returns the index of the specified item in the collection or -1 if the item does not exist.
virtual void Insert (FdoInt32 index, SUBOBJ *value)
 Inserts the specified item at the specified index within the collection. Items following the insertion point are moved down to accommodate the new item. Throws an invalid argument exception if the specified index is out of range.
virtual void Remove (const SUBOBJ *value)
 Removes the specified item from the collection. Throws an invalid argument exception if the item does not exist within the collection.
virtual void RemoveAt (FdoInt32 index)
 Removes the specified item from the collection. Throws an invalid argument exception if the item does not exist within the collection.
virtual void SetItem (FdoInt32 index, SUBOBJ *value)
 Sets the item in the collection at the specified index to the specified value. Throws an invalid argument exception if the index is out of range.

Protected Member Functions

virtual SUBOBJ * DownCast (BASEOBJ *value) const =0
 Downcasts an item from the Base to the SubType.
 FdoRestrictedNamedCollection (BASECOLLECTION *baseCollection)
 FdoRestrictedNamedCollection ()

Constructor & Destructor Documentation

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::FdoRestrictedNamedCollection  )  [inline, protected]
 

Definition at line 45 of file RestrictedNamedCollection.h.

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::FdoRestrictedNamedCollection BASECOLLECTION *  baseCollection  )  [inline, protected]
 

Definition at line 46 of file RestrictedNamedCollection.h.

References FDO_SAFE_ADDREF.


Member Function Documentation

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual FdoInt32 FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::Add SUBOBJ *  value  )  [inline, virtual]
 

Adds the specified item to the end of the collection. Returns the index of the newly added item.

Parameters:
value Input value
Returns:
Returns the index of the newly added item

Definition at line 134 of file RestrictedNamedCollection.h.

References FdoInt32.

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual void FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::Clear  )  [inline, virtual]
 

Removes all items from the collection.

Returns:
Returns nothing

Definition at line 163 of file RestrictedNamedCollection.h.

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual bool FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::Contains const SUBOBJ *  value  )  const [inline, virtual]
 

Returns true if the collection contains the specified item, false otherwise.

Parameters:
value Input value
Returns:
Returns true if the collection contains the specified item, false otherwise

Definition at line 205 of file RestrictedNamedCollection.h.

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual SUBOBJ* FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::DownCast BASEOBJ *  value  )  const [protected, pure virtual]
 

Downcasts an item from the Base to the SubType.

Referenced by FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::FindItem(), and FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::GetItem().

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual SUBOBJ* FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::FindItem const wchar_t *  name  )  const [inline, virtual]
 

Gets an item by name.

Parameters:
name Input item name
Returns:
Returns the item in the collection with the specified name. Returns NULL if the item is not in this collection.

Definition at line 104 of file RestrictedNamedCollection.h.

References FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::DownCast().

Here is the call graph for this function:

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual const BASECOLLECTION* FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::GetBaseCollection  )  [inline, virtual]
 

Returns a read only pointer to the base collection.

Returns:
Returns const BASECOLLECTION*

Definition at line 230 of file RestrictedNamedCollection.h.

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual FdoInt32 FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::GetCount  )  const [inline, virtual]
 

Gets the number of items in the collection.

Returns:
Returns number of items in the collection

Definition at line 59 of file RestrictedNamedCollection.h.

References FdoInt32.

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual SUBOBJ* FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::GetItem const wchar_t *  name  )  const [inline, virtual]
 

Gets an item by name. Throws an invalid argument exception if the item is not in this collection.

Parameters:
name Input item name
Returns:
Returns the item in the collection with the specified name

Definition at line 88 of file RestrictedNamedCollection.h.

References FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::DownCast().

Here is the call graph for this function:

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual SUBOBJ* FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::GetItem FdoInt32  index  )  const [inline, virtual]
 

Gets the item in the collection at the specified index. Throws an invalid argument exception if the index is out of range.

Parameters:
index Input index
Returns:
Returns the item in the collection at the specified index

Definition at line 73 of file RestrictedNamedCollection.h.

References FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::DownCast().

Here is the call graph for this function:

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual FdoInt32 FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::IndexOf const SUBOBJ *  value  )  const [inline, virtual]
 

Returns the index of the specified item in the collection or -1 if the item does not exist.

Parameters:
value Input value
Returns:
Returns the index of the specified item in the collection or -1 if the item does not exist

Definition at line 219 of file RestrictedNamedCollection.h.

References FdoInt32.

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual void FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::Insert FdoInt32  index,
SUBOBJ *  value
[inline, virtual]
 

Inserts the specified item at the specified index within the collection. Items following the insertion point are moved down to accommodate the new item. Throws an invalid argument exception if the specified index is out of range.

Parameters:
index Input index
value Input value
Returns:
Returns nothing

Definition at line 152 of file RestrictedNamedCollection.h.

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual void FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::Remove const SUBOBJ *  value  )  [inline, virtual]
 

Removes the specified item from the collection. Throws an invalid argument exception if the item does not exist within the collection.

Parameters:
value Input value
Returns:
Returns nothing

Definition at line 177 of file RestrictedNamedCollection.h.

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual void FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::RemoveAt FdoInt32  index  )  [inline, virtual]
 

Removes the specified item from the collection. Throws an invalid argument exception if the item does not exist within the collection.

Parameters:
index Input index
Returns:
Returns nothing

Definition at line 191 of file RestrictedNamedCollection.h.

template<class BASEOBJ, class SUBOBJ, class BASECOLLECTION>
virtual void FdoRestrictedNamedCollection< BASEOBJ, SUBOBJ, BASECOLLECTION >::SetItem FdoInt32  index,
SUBOBJ *  value
[inline, virtual]
 

Sets the item in the collection at the specified index to the specified value. Throws an invalid argument exception if the index is out of range.

Parameters:
index Input index
value Input value
Returns:
Returns nothing

Definition at line 120 of file RestrictedNamedCollection.h.


The documentation for this class was generated from the following file:
Comments or suggestions? Send us feedback.